EndpointsWithCustomErrors

An interpreter for endpoints4s.algebra.Endpoints that builds a client issuing requests using a sttp’s com.softwaremill.sttp.SttpBackend.

Type parameters:
R

The monad wrapping the response. It is defined by the backend

trait Methods
trait Urls
trait Errors
trait Responses
trait Requests
trait Methods
trait Urls
class Object
trait Matchable
class Any
class Endpoints[R]

Type members

Classlikes

case class Endpoint[A, B](request: () => A, response: Response[B]) extends A => R[B]

A function that, given an A, eventually attempts to decode the B response.

A function that, given an A, eventually attempts to decode the B response.

trait Response[A]

Trait that indicates how a response should be interpreted

Trait that indicates how a response should be interpreted

Inherited classlikes

final class CallbackDocs extends Serializable
Value parameters:
entity

Contents of the callback message

method

HTTP method used for the callback

response

Expected response

Inherited from:
EndpointsWithCustomErrors
final class EndpointDocs extends Serializable
Value parameters:
callbacks

Callbacks indexed by event name

deprecated

Indicates whether this endpoint is deprecated or not

description

Detailed description

operationId

A unique identifier which identifies this operation

summary

Short description

tags

OpenAPI tags

Inherited from:
EndpointsWithCustomErrors
final implicit class EndpointSyntax[A, B](endpoint: Endpoint[A, B])

Extension methods for Endpoint.

Extension methods for Endpoint.

Inherited from:
EndpointsWithCustomErrors
implicit class InvariantFunctorSyntax[A, F[_]](val fa: F[A])(implicit ev: InvariantFunctor[F])

Extension methods for values of type F[A] for which there is an implicit InvariantFunctor[F] instance.

Extension methods for values of type F[A] for which there is an implicit InvariantFunctor[F] instance.

Inherited from:
InvariantFunctorSyntax
implicit class PartialInvariantFunctorSyntax[A, F[_]](val fa: F[A])(implicit ev: PartialInvariantFunctor[F])
trait Path[A] extends Url[A]
Inherited from:
Urls
implicit class PathOps[A](first: Path[A])

Convenient methods for Paths.

Convenient methods for Paths.

Inherited from:
Urls
trait QueryString[A]
Inherited from:
Urls
implicit class QueryStringSyntax[A](first: QueryString[A])

Extension methods on QueryString.

Extension methods on QueryString.

Inherited from:
Urls
implicit class RequestEntitySyntax[A](requestEntity: RequestEntity[A])
Inherited from:
Requests
final implicit class RequestSyntax[A](request: Request[A])

Extension methods for Request.

Extension methods for Request.

Inherited from:
Requests
implicit class ResponseSyntax[A](response: Response[A])

Extension methods for Response.

Extension methods for Response.

Inherited from:
Responses
trait Segment[A]
Inherited from:
Urls
implicit class SemigroupalSyntax[A, F[_]](val f: F[A])(implicit ev: Semigroupal[F])
Inherited from:
SemigroupalSyntax
trait Url[A]
Inherited from:
Urls

Types

type Request[A] = A => SttpRequest

A function that takes an A information and returns a SttpRequest

A function that takes an A information and returns a SttpRequest

A function that, given an A information and a SttpRequest, eventually returns a SttpRequest

A function that, given an A information and a SttpRequest, eventually returns a SttpRequest

A function that, given an A and a request model, returns an updated request containing additional headers

A function that, given an A and a request model, returns an updated request containing additional headers

type SttpRequest = RequestT[Identity, _, Any]

Inherited types

Callbacks indexed by URL pattern

Callbacks indexed by URL pattern

See also:
Inherited from:
EndpointsWithCustomErrors

Errors in a request built by a client

Errors in a request built by a client

Inherited from:
Errors
type Method = RequestT[Identity, _, Any] => RequestT[Identity, _, Any]
Inherited from:
Methods
type QueryStringParam[A] = A => List[String]

a query string parameter can have zero or several values

a query string parameter can have zero or several values

Inherited from:
Urls

Error raised by the business logic of a server

Error raised by the business logic of a server

Inherited from:
Errors
type StatusCode = StatusCode
Inherited from:
StatusCodes
type WithDefault[A] = Option[A]
Inherited from:
Urls

Value members

Concrete methods

override def addRequestHeaders[A, H](request: () => A, headers: () => H)(implicit tupler: Tupler[A, H]): () => Out
Definition Classes
override def addRequestQueryString[A, Q](request: () => A, qs: QueryString[Q])(implicit tupler: Tupler[A, Q]): () => Out
Definition Classes
override def addResponseHeaders[A, H](response: Response[A], headers: () => H)(implicit tupler: Tupler[A, H]): Response[Out]
Definition Classes
def choiceRequestEntity[A, B](requestEntityA: () => A, requestEntityB: () => B): () => Either[A, B]
def choiceResponse[A, B](responseA: Response[A], responseB: Response[B]): Response[Either[A, B]]

Successfully decodes no information from a response

Successfully decodes no information from a response

def endpoint[A, B](request: () => A, response: Response[B], docs: EndpointDocs): Endpoint[A, B]
override def mapEndpointDocs[A, B](endpoint: Endpoint[A, B], f: EndpointDocs => EndpointDocs): Endpoint[A, B]
Definition Classes
override def mapEndpointRequest[A, B, C](endpoint: Endpoint[A, B], f: (() => A) => () => C): Endpoint[C, B]
Definition Classes
override def mapEndpointResponse[A, B, C](endpoint: Endpoint[A, B], f: Response[B] => Response[C]): Endpoint[A, C]
Definition Classes
def request[A, B, C, AB, Out](method: Method, url: Url[A], entity: () => B, docs: Documentation, headers: () => C)(implicit tuplerAB: Aux[A, B, AB], tuplerABC: Aux[AB, C, Out]): () => Out
def requestHeader(name: String, docs: Documentation): () => String
def response[A, B, Res](statusCode: StatusCode, entity: ResponseEntity[A], docs: Documentation, headers: () => B)(implicit tupler: Aux[A, B, Res]): Response[Res]
def responseHeader(name: String, docs: Documentation): () => String
def stringCodecResponse[A](implicit codec: Codec[String, A]): ResponseEntity[A]

Successfully decodes string information from a response

Successfully decodes string information from a response

Inherited methods

Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
override def Conflict: StatusCode
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
Inherited from:
Methods
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
def Get: Method
Inherited from:
Methods
override def Gone: StatusCode
Definition Classes
Inherited from:
StatusCodes
override def IMUsed: StatusCode
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
override def Locked: StatusCode
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
override def MultiStatus: StatusCode
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
override def NotModified: StatusCode
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
Inherited from:
Methods
Definition Classes
Inherited from:
StatusCodes
Inherited from:
Methods
Definition Classes
Inherited from:
StatusCodes
Inherited from:
Methods
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
def Put: Method
Inherited from:
Methods
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
override def ResetContent: StatusCode
Definition Classes
Inherited from:
StatusCodes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
Definition Classes
Inherited from:
StatusCodes
override def UriTooLong: StatusCode
Definition Classes
Inherited from:
StatusCodes
final def badRequest[A, R](docs: Documentation, headers: () => A)(implicit tupler: Aux[ClientErrors, A, R]): Response[R]

Bad Request (400) response, with an entity of type ClientErrors.

Bad Request (400) response, with an entity of type ClientErrors.

See also:
Inherited from:
Responses
def chainPaths[A, B](first: Path[A], second: Path[B])(implicit tupler: Tupler[A, B]): Path[Out]
Inherited from:
Urls

Format of the response entity carrying the client errors.

Format of the response entity carrying the client errors.

Inherited from:
Errors

Convert the ClientErrors type into the endpoints4s internal client error type

Convert the ClientErrors type into the endpoints4s internal client error type

Inherited from:
Errors
def combineQueryStrings[A, B](first: QueryString[A], second: QueryString[B])(implicit tupler: Tupler[A, B]): QueryString[Out]
Inherited from:
Urls
final def delete[UrlP, HeadersP, Out](url: Url[UrlP], docs: Documentation, headers: () => HeadersP)(implicit tuplerUH: Aux[UrlP, HeadersP, Out]): () => Out

Helper method to perform DELETE request

Helper method to perform DELETE request

Type parameters:
HeadersP

Payload carried by headers

UrlP

Payload carried by url

Inherited from:
Requests
final def get[UrlP, HeadersP, Out](url: Url[UrlP], docs: Documentation, headers: () => HeadersP)(implicit tuplerUH: Aux[UrlP, HeadersP, Out]): () => Out

Helper method to perform GET request

Helper method to perform GET request

Type parameters:
HeadersP

Payload carried by headers

UrlP

Payload carried by url

Inherited from:
Requests
final def internalServerError[A, R](docs: Documentation, headers: () => A)(implicit tupler: Aux[ServerError, A, R]): Response[R]

Internal Server Error (500) response, with an entity of type ServerError.

Internal Server Error (500) response, with an entity of type ServerError.

See also:
Inherited from:
Responses

Convert the endpoints4s internal client error type into the ClientErrors type

Convert the endpoints4s internal client error type into the ClientErrors type

Inherited from:
Errors
final def ok[A, B, R](entity: ResponseEntity[A], docs: Documentation, headers: () => B)(implicit tupler: Aux[A, B, R]): Response[R]

OK (200) Response with the given entity

OK (200) Response with the given entity

Inherited from:
Responses
override def optQsWithDefault[A](name: String, default: A, docs: Documentation)(implicit value: () => A): QueryString[Option[A]]
Definition Classes
Inherited from:
Urls
final def patch[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: () => BodyP, docs: Documentation, headers: () => HeadersP)(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): () => Out

Helper method to perform PATCH request

Helper method to perform PATCH request

Type parameters:
BodyP

Payload carried by body

HeadersP

Payload carried by headers

UrlAndBodyPTupled

Payloads of Url and Body tupled together by Tupler

UrlP

Payload carried by url

Value parameters:
docs

Request documentation

Inherited from:
Requests
final def post[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: () => BodyP, docs: Documentation, headers: () => HeadersP)(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): () => Out

Helper method to perform POST request

Helper method to perform POST request

Type parameters:
BodyP

Payload carried by body

HeadersP

Payload carried by headers

UrlAndBodyPTupled

Payloads of Url and Body tupled together by Tupler

UrlP

Payload carried by url

Value parameters:
docs

Request documentation

Inherited from:
Requests
final def put[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: () => BodyP, docs: Documentation, headers: () => HeadersP)(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): () => Out

Helper method to perform PUT request

Helper method to perform PUT request

Type parameters:
BodyP

Payload carried by body

HeadersP

Payload carried by headers

UrlAndBodyPTupled

Payloads of Url and Body tupled together by Tupler

UrlP

Payload carried by url

Inherited from:
Requests
def qs[A](name: String, docs: Documentation)(implicit param: () => A): QueryString[A]
Inherited from:
Urls
Inherited from:
Urls
def segment[A](name: String, docs: Documentation)(implicit s: Segment[A]): Path[A]
Inherited from:
Urls

Format of the response entity carrying the server error.

Format of the response entity carrying the server error.

Inherited from:
Errors

Convert the ServerError type into the endpoints4s internal server error type

Convert the ServerError type into the endpoints4s internal server error type

Inherited from:
Errors
Inherited from:
Urls

Convert the endpoints4s internal server error type into the ServerError type

Convert the endpoints4s internal server error type into the ServerError type

Inherited from:
Errors
def urlWithQueryString[A, B](path: Path[A], qs: QueryString[B])(implicit tupler: Tupler[A, B]): Url[Out]
Inherited from:
Urls
final def wheneverFound[A](responseA: Response[A], notFoundDocs: Documentation): Response[Option[A]]

Turns a Response[A] into a Response[Option[A]].

Turns a Response[A] into a Response[Option[A]].

Interpreters represent None with an empty HTTP response whose status code is 404 (Not Found).

Inherited from:
Responses

Abstract fields

val backend: SttpBackend[R, Any]

Concrete fields

lazy val emptyRequest: () => Unit
lazy val emptyRequestHeaders: () => Unit

Does not modify the request

Does not modify the request

lazy val textRequest: () => String

Inherited fields

Response used by endpoints4s when decoding a request fails.

Response used by endpoints4s when decoding a request fails.

The provided implementation forwards to badRequest.

Inherited from:
Errors
val path: Path[Unit]

An empty path.

An empty path.

Useful to begin a path definition:

 path / "foo" / segment[Int] /? qs[String]("bar")
Inherited from:
Urls

Response used by endpoints4s when the business logic of an endpoint fails.

Response used by endpoints4s when the business logic of an endpoint fails.

The provided implementation forwards to internalServerError

Inherited from:
Errors
val utf8Name: String
Inherited from:
Urls

Implicits

Inherited implicits

final implicit def EndpointSyntax[A, B](endpoint: Endpoint[A, B]): EndpointSyntax[A, B]

Extension methods for Endpoint.

Extension methods for Endpoint.

Inherited from:
EndpointsWithCustomErrors
final implicit def InvariantFunctorSyntax[A, F[_]](fa: F[A])(implicit ev: InvariantFunctor[F]): InvariantFunctorSyntax[A, F]

Extension methods for values of type F[A] for which there is an implicit InvariantFunctor[F] instance.

Extension methods for values of type F[A] for which there is an implicit InvariantFunctor[F] instance.

Inherited from:
InvariantFunctorSyntax
final implicit def PartialInvariantFunctorSyntax[A, F[_]](fa: F[A])(implicit ev: PartialInvariantFunctor[F]): PartialInvariantFunctorSyntax[A, F]
final implicit def PathOps[A](first: Path[A]): PathOps[A]

Convenient methods for Paths.

Convenient methods for Paths.

Inherited from:
Urls
final implicit def QueryStringSyntax[A](first: QueryString[A]): QueryStringSyntax[A]

Extension methods on QueryString.

Extension methods on QueryString.

Inherited from:
Urls
final implicit def RequestEntitySyntax[A](requestEntity: () => A): RequestEntitySyntax[A]
Inherited from:
Requests
final implicit def RequestSyntax[A](request: () => A): RequestSyntax[A]

Extension methods for Request.

Extension methods for Request.

Inherited from:
Requests
final implicit def ResponseSyntax[A](response: Response[A]): ResponseSyntax[A]

Extension methods for Response.

Extension methods for Response.

Inherited from:
Responses
final implicit def SemigroupalSyntax[A, F[_]](f: F[A])(implicit ev: Semigroupal[F]): SemigroupalSyntax[A, F]
Inherited from:
SemigroupalSyntax
implicit def booleanQueryString: () => Boolean

Query string parameter containing a Boolean value

Query string parameter containing a Boolean value

Inherited from:
Urls
implicit def doubleQueryString: () => Double

Codec for query string parameters of type Double

Codec for query string parameters of type Double

Inherited from:
Urls

Path segment codec for type Double

Path segment codec for type Double

Inherited from:
Urls
implicit def intQueryString: () => Int

Ability to define Int query string parameters

Ability to define Int query string parameters

Inherited from:
Urls
implicit def intSegment: Segment[Int]

Path segment codec for type Int

Path segment codec for type Int

Inherited from:
Urls
implicit def longQueryString: () => Long

Query string parameter containing a Long value

Query string parameter containing a Long value

Inherited from:
Urls
implicit def longSegment: Segment[Long]

Path segment codec for type Long

Path segment codec for type Long

Inherited from:
Urls
implicit def optionalQueryStringParam[A](implicit param: () => A): () => Option[A]
Inherited from:
Urls
implicit def repeatedQueryStringParam[A, CC <: (Iterable)](implicit param: () => A, factory: Factory[A, CC[A]]): () => CC[A]
Inherited from:
Urls
implicit lazy val stringQueryString: () => String
Inherited from:
Urls
implicit lazy val stringSegment: Segment[String]
Inherited from:
Urls
implicit def uuidQueryString: () => UUID

Ability to define UUID query string parameters

Ability to define UUID query string parameters

Inherited from:
Urls
implicit def uuidSegment: Segment[UUID]

Path segment codec for type UUID

Path segment codec for type UUID

Inherited from:
Urls