LowLevelEndpoints

Interpreter for algebra.LowLevelEndpoints that represents the response as a XMLHttpRequest value.

Type members

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
abstract class Endpoint[A, B](val request: Request[A], val response: Response[B]) extends A => Result[B]

A function that takes the information needed to build a request and returns a task yielding the information carried by the response.

A function that takes the information needed to build a request and returns a task yielding the information carried by the 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]

Builds an URL path from an A

Builds an URL path from an 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]

Defines how to build a query string from an A

Defines how to build a query string from an A

Inherited from:
Urls

Defines how to build a query string parameter value from an A

Defines how to build a query string parameter value from an A

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

Extension methods on QueryString.

Extension methods on QueryString.

Inherited from:
Urls
trait Request[A]

A function that takes the information A and returns the data to create an XMLHttpRequest.

A function that takes the information A and returns the data to create an XMLHttpRequest.

Inherited from:
EndpointsWithCustomErrors
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]

Defines how to build a path segment from an A

Defines how to build a path segment from an A

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

Builds an URL from an A

Builds an URL from an A

Inherited from:
Urls

Types

type RawRequestEntity = Function1[XMLHttpRequest, Any]

Represents the request entity as a function that is passed the underlying XMLHttpRequest (so this one can be modified in place) and returns the actual entity to use

Represents the request entity as a function that is passed the underlying XMLHttpRequest (so this one can be modified in place) and returns the actual entity to use

type RawResponseEntity = XMLHttpRequest

The response can be retrieved from the XMLHttpRequest API

The response can be retrieved from the XMLHttpRequest API

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 = String
Inherited from:
Methods
type RequestEntity[A] = Function2[A, XMLHttpRequest, Any]

A function that, given information A and an XMLHttpRequest, returns a request entity. Also, as a side-effect, the function can set the corresponding Content-Type header on the given XMLHttpRequest.

A function that, given information A and an XMLHttpRequest, returns a request entity. Also, as a side-effect, the function can set the corresponding Content-Type header on the given XMLHttpRequest.

Inherited from:
EndpointsWithCustomErrors
type RequestHeaders[A] = Function2[A, XMLHttpRequest, Unit]

A function that takes the information A and the XMLHttpRequest and sets up some headers on it.

A function that takes the information A and the XMLHttpRequest and sets up some headers on it.

Inherited from:
EndpointsWithCustomErrors
type Response[A] = Function1[XMLHttpRequest, Option[ResponseEntity[A]]]

Attempts to decode an A from an XMLHttpRequest’s response

Attempts to decode an A from an XMLHttpRequest’s response

Inherited from:
EndpointsWithCustomErrors
type ResponseEntity[A] = Function1[XMLHttpRequest, Either[Throwable, A]]
type ResponseHeaders[A] = XMLHttpRequest => Validated[A]
type Result[A]

A value that eventually yields an A.

A value that eventually yields an A.

Typically, concrete representation of Result will have an instance of MonadError, so that we can perform requests (sequentially and in parallel) and recover errors.

Inherited from:
EndpointsWithCustomErrors

Error raised by the business logic of a server

Error raised by the business logic of a server

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

Value members

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: String
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
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: String
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
Definition Classes
Inherited from:
StatusCodes
override def TooEarly: StatusCode
Definition Classes
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
override def addRequestHeaders[A, H](request: Request[A], headers: RequestHeaders[H])(implicit tupler: Tupler[A, H]): Request[Out]
override def addRequestQueryString[A, Q](request: Request[A], qs: QueryString[Q])(implicit tupler: Tupler[A, Q]): Request[Out]
override def addResponseHeaders[A, H](response: Response[A], headers: () => H)(implicit tupler: Tupler[A, H]): Response[Out]
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
def choiceRequestEntity[A, B](requestEntityA: RequestEntity[A], requestEntityB: RequestEntity[B]): RequestEntity[Either[A, B]]
def choiceResponse[A, B](responseA: Response[A], responseB: Response[B]): Response[Either[A, B]]

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: RequestHeaders[HeadersP])(implicit tuplerUH: Aux[UrlP, HeadersP, Out]): Request[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

Discards response entity

Discards response entity

Inherited from:
EndpointsWithCustomErrors
def endpoint[A, B](request: Request[A], response: Response[B], docs: EndpointDocs): Endpoint[A, B]

Define an HTTP endpoint

Define an HTTP endpoint

Value parameters:
docs

Documentation (used by documentation interpreters)

request

Request

response

Response

Inherited from:
EndpointsWithCustomErrors
final def get[UrlP, HeadersP, Out](url: Url[UrlP], docs: Documentation, headers: RequestHeaders[HeadersP])(implicit tuplerUH: Aux[UrlP, HeadersP, Out]): Request[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
override def mapEndpointDocs[A, B](endpoint: Endpoint[A, B], f: EndpointDocs => EndpointDocs): Endpoint[A, B]
override def mapEndpointRequest[A, B, C](endpoint: Endpoint[A, B], f: Request[A] => Request[C]): Endpoint[C, B]
override def mapEndpointResponse[A, B, C](endpoint: Endpoint[A, B], f: Response[B] => Response[C]): Endpoint[A, C]
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: QueryStringParam[A]): QueryString[Option[A]]
Definition Classes
Inherited from:
Urls
final def patch[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: RequestEntity[BodyP], docs: Documentation, headers: RequestHeaders[HeadersP])(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): Request[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 protected def performXhr[A, B](request: Request[A], response: Response[B], a: A)(onload: Either[Throwable, B] => Unit, onerror: Throwable => Unit): Function0[Unit]
final def post[UrlP, BodyP, HeadersP, UrlAndBodyPTupled, Out](url: Url[UrlP], entity: RequestEntity[BodyP], docs: Documentation, headers: RequestHeaders[HeadersP])(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): Request[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: RequestEntity[BodyP], docs: Documentation, headers: RequestHeaders[HeadersP])(implicit tuplerUB: Aux[UrlP, BodyP, UrlAndBodyPTupled], tuplerUBH: Aux[UrlAndBodyPTupled, HeadersP, Out]): Request[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: QueryStringParam[A]): QueryString[A]
Inherited from:
Urls
Inherited from:
Urls
def request[A, B, C, AB, Out](method: Method, url: Url[A], entity: RequestEntity[B], docs: Documentation, headers: RequestHeaders[C])(implicit tuplerAB: Aux[A, B, AB], tuplerABC: Aux[AB, C, Out]): Request[Out]
def response[A, B, R](statusCode: StatusCode, entity: ResponseEntity[A], docs: Documentation, headers: () => B)(implicit tupler: Aux[A, B, R]): Response[R]
def responseHeader(name: String, docs: Documentation): () => String
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
def stringCodecResponse[A](implicit codec: Decoder[String, A]): ResponseEntity[A]

Decodes a text entity

Decodes a text entity

Inherited from:
EndpointsWithCustomErrors

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

Concrete fields

Sends the entity as it is

Sends the entity as it is

Successfully returns the underlying XMLHttpRequest, whatever its status code is

Successfully returns the underlying XMLHttpRequest, whatever its status code is

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

Sets up no headers on the given XMLHttpRequest

Sets up no headers on the given XMLHttpRequest

Inherited from:
EndpointsWithCustomErrors
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

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: RequestEntity[A]): RequestEntitySyntax[A]
Inherited from:
Requests
final implicit def RequestSyntax[A](request: 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

Query string parameter containing a Boolean value

Query string parameter containing a Boolean value

Inherited from:
Urls

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

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

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: QueryStringParam[A]): QueryStringParam[Option[A]]
Inherited from:
Urls
implicit def repeatedQueryStringParam[A, CC <: (Iterable)](implicit param: QueryStringParam[A], factory: Factory[A, CC[A]]): QueryStringParam[CC[A]]
Inherited from:
Urls
Inherited from:
Urls
implicit lazy val stringSegment: Segment[String]
Inherited from:
Urls
implicit def uuidQueryString: QueryStringParam[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