SttpClientInterpreter

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def toClient[F[_], I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit wsToPipe: WebSocketToPipe[R]): I => F[DecodeResult[Either[E, O]]]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The request is sent using the given backend, and the result of decoding the response (error or success value) is returned.

def toClientThrowDecodeFailures[F[_], I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit wsToPipe: WebSocketToPipe[R]): I => F[Either[E, O]]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The request is sent using the given backend, and the result (error or success value) is returned. If decoding the result fails, a failed effect is returned instead.

def toClientThrowErrors[F[_], I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit wsToPipe: WebSocketToPipe[R]): I => F[O]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The request is sent using the given backend, and the result (success value) is returned. If decoding the result fails, or if the response corresponds to an error value, a failed effect is returned instead.

def toRequest[I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri])(implicit wsToPipe: WebSocketToPipe[R]): I => Request[DecodeResult[Either[E, O]], R]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The result of the function is a description of a request, which can be sent using any sttp backend. The response will then contain the decoded error or success values (note that this can be the body enriched with data from headers/status code).

def toRequestThrowDecodeFailures[I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri])(implicit wsToPipe: WebSocketToPipe[R]): I => Request[Either[E, O], R]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The result of the function is a description of a request, which can be sent using any sttp backend. The response will then contain the decoded error or success values (note that this can be the body enriched with data from headers/status code), or will be a failed effect, when response parsing fails.

def toRequestThrowErrors[I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[Uri])(implicit wsToPipe: WebSocketToPipe[R]): I => Request[O, R]

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The result of the function is a description of a request, which can be sent using any sttp backend. The response will then contain the decoded success values (note that this can be the body enriched with data from headers/status code), or will be a failed effect, when response parsing fails or if the result is an error.

Throws
IllegalArgumentException

when response parsing fails

Inherited methods

def toQuickClient[I, E, O](e: Endpoint[I, E, O, Any], baseUri: Option[Uri]): I => Either[E, O]

Interprets the endpoint as a synchronous client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a synchronous client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The request is sent using a synchronous backend, and the result of decoding the response (error or success value) is returned. If decoding the result fails, an exception is thrown.

Inherited from
SttpClientInterpreterExtensions
def toQuickClientThrowErrors[I, E, O](e: Endpoint[I, E, O, Any], baseUri: Option[Uri]): I => O

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The request is sent using a synchronous backend, and the result (success value) is returned. If decoding the result fails, or if the response corresponds to an error value, an exception is thrown.

Inherited from
SttpClientInterpreterExtensions