Package-level declarations

Types

Link copied to clipboard

Represents a request that has been prepared for execution. A call can be canceled. As this object represents a single request/response pair (stream), it cannot be executed twice.

Link copied to clipboard
interface Callback<ReqBody : Any, ResBody : Any>

The callback interface for an asynchronous execution of a Call instance.

Link copied to clipboard
class CallInterruptedException(val message: String, val cause: Throwable? = null, val errorfulCause: Error? = null) : HttpClientException

An exception raised if the Call under execution was interrupted for some reason See the underlying HttpClientException.cause for more information

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class EdgeServiceError(val header: Header)

Represents service call response payload failure with error condition { "header": { "source": "024-04", "code": -1, "message": "Failure", "system_time": 1726123052106, "tracking_id": "58646716-23d4-498a-aded-1f9e69bca936", "errors": { "code": "40250404", "description": "Item not found" } } }

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class EdgeServiceProxyError(val code: String, val errorCode: Int, val type: String, val message: String)

Represents service call response proxy payload with error condition e.g. { "code": "InvalidPTokenError", "errorCode": 201, "type": "CLIENT_ERROR", "message": "Not Authorized" }

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class ErrorDetail(val code: String, val description: String)
Link copied to clipboard
interface FormRequestBody

Represents An x-www-form-urlencoded Request Body The Form body is appropriately encoded before sending to Server

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class Header(val source: String, val code: Int, val message: String, val systemTime: Long, val trackingId: String, val errors: List<ErrorDetail>?)
Link copied to clipboard

The Client that is responsible for constructing a Call based on a Request and return an appropriate Response

Link copied to clipboard

Base class for all types of Exception raised while executing a Call The exception can either have an underlying exceptional cause or erroneous errorfulCause.

Link copied to clipboard

Enables Request / Response Logging

Link copied to clipboard
class HttpServerSentEventClient(connectionTimeout: Long = DEFAULT_CONNECTION_TIMEOUT_SECONDS, readTimeout: Long = DEFAULT_READ_TIMEOUT_MINUTES, sseSourceUrl: String)

Custom implementation of OkHttpClient that handles Server Sent Events.

Link copied to clipboard
interface Request<RequestBody>

Represents a Http Request

Link copied to clipboard
interface Response<RespBody>

Represents a HTTP Response

Link copied to clipboard
interface ResponseBody

Represents a Http raw response body if appropriate for the corresponding method.

Link copied to clipboard
class ResponseDeserializationException(val message: String, val cause: Throwable? = null, val errorfulCause: Error? = null) : HttpClientException

An exception raised if the Response deserialization failed See the underlying HttpClientException.cause for more information

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Convenience function to catch any Exception and return it as a Failure Result This is useful, if we want to use when classes in processing result

Link copied to clipboard

An extension Request.Builder that builds a new Request upon the passed request object.

Link copied to clipboard
inline fun <ReqBody : Any, ResBody : Any> Call.Factory.callWith(noinline builder: Request.Builder<ReqBody>.() -> Unit): Call<ReqBody, ResBody>

Constructs a call with the passed Request Builder instance. The Request and Response Types are passed as reified Generic Parameters.

Link copied to clipboard

An extension to get Error Category for a particular HttpClientException