Endpoint

zio.http.endpoint.Endpoint
See theEndpoint companion object
final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](route: RoutePattern[PathInput], input: HttpCodec[RequestType, Input], output: HttpCodec[ResponseType, Output], error: HttpCodec[ResponseType, Err], codecError: HttpCodec[ResponseType, HttpCodecError], documentation: Doc, authType: Auth) extends EndpointPlatformSpecific[PathInput, Input, Err, Output, Auth]

An zio.http.endpoint.Endpoint represents an API endpoint for the HTTP protocol. Every API has an input, which comes from a combination of the HTTP route, query string parameters, and headers, and an output, which is the data computed by the handler of the API.

MiddlewareInput : Example: A subset of HttpCodec[Input] that doesn't give access to Input MiddlewareOutput: Example: A subset of Out[Output] that doesn't give access to Output Input: Example: Int Output: Example: User

As zio.http.endpoint.Endpoint is a purely declarative encoding of an endpoint, it is possible to use this model to generate a zio.http.Route (by supplying a handler for the endpoint), to generate OpenAPI documentation, to generate a type-safe Scala client for the endpoint, and possibly, to generate client libraries in other programming languages.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait EndpointPlatformSpecific[PathInput, Input, Err, Output, Auth]
class Object
trait Matchable
class Any
Show all
Self type
Endpoint[PathInput, Input, Err, Output, Auth]

Members list

Type members

Types

type AuthedInput = authCombiner.Out

Value members

Concrete methods

def ??(that: Doc): Endpoint[PathInput, Input, Err, Output, Auth]

Returns a new API that is derived from this one, but which includes additional documentation that will be included in OpenAPI generation.

Returns a new API that is derived from this one, but which includes additional documentation that will be included in OpenAPI generation.

Attributes

def alternatives: Chunk[(Endpoint[PathInput, Input, Err, Output, Auth], Condition)]

Flattens out this endpoint to a chunk of alternatives. Each alternative is guaranteed to not have any alternatives itself.

Flattens out this endpoint to a chunk of alternatives. Each alternative is guaranteed to not have any alternatives itself.

Attributes

def apply(input: Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B](a: A, b: B)(implicit ev: (A, B) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C](a: A, b: B, c: C)(implicit ev: (A, B, C) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D](a: A, b: B, c: C, d: D)(implicit ev: (A, B, C, D) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E](a: A, b: B, c: C, d: D, e: E)(implicit ev: (A, B, C, D, E) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F](a: A, b: B, c: C, d: D, e: E, f: F)(implicit ev: (A, B, C, D, E, F) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G](a: A, b: B, c: C, d: D, e: E, f: F, g: G)(implicit ev: (A, B, C, D, E, F, G) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G, H](a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H)(implicit ev: (A, B, C, D, E, F, G, H) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G, H, I](a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I)(implicit ev: (A, B, C, D, E, F, G, H, I) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G, H, I, J](a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J)(implicit ev: (A, B, C, D, E, F, G, H, I, J) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G, H, I, J, K](a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, k: K)(implicit ev: (A, B, C, D, E, F, G, H, I, J, K) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def apply[A, B, C, D, E, F, G, H, I, J, K, L](a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, k: K, l: L)(implicit ev: (A, B, C, D, E, F, G, H, I, J, K, L) <:< Input): Invocation[PathInput, Input, Err, Output, Auth]
def auth[Auth0 <: AuthType](auth: Auth0): Endpoint[PathInput, Input, Err, Output, Auth0]
def emptyErrorResponse: Endpoint[PathInput, Input, Err, Output, Auth]

Hides any details of codec errors from the user.

Hides any details of codec errors from the user.

Attributes

def examplesIn(examples: (String, Input)*): Endpoint[PathInput, Input, Err, Output, Auth]
def examplesIn: Map[String, Input]
def examplesOut(examples: (String, Output)*): Endpoint[PathInput, Input, Err, Output, Auth]
def examplesOut: Map[String, Output]
def header[A](codec: HeaderCodec[A])(implicit combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified headers to be present.

Returns a new endpoint that requires the specified headers to be present.

Attributes

def header[A](name: String)(implicit schema: Schema[A], combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified headers to be present.

Returns a new endpoint that requires the specified headers to be present.

Attributes

def header[A](implicit schema: Schema[A], combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified headers to be present.

Returns a new endpoint that requires the specified headers to be present.

Attributes

def implement[Env](f: Input => ZIO[Env, Err, Output])(implicit trace: Trace): Route[Env, Nothing]
def implementAs(output: Output)(implicit trace: Trace): Route[Any, Nothing]
def implementAsError(err: Err)(implicit trace: Trace): Route[Any, Nothing]
def implementAsZIO[Env](output: ZIO[Env, Err, Output])(implicit trace: Trace): Route[Env, Nothing]
def implementAsZIOScoped[Env, Env1](output: ZIO[Env, Err, Output])(implicit ev: Env <:< (Env1 & Scope), trace: Trace): Route[Env1, Nothing]
def implementEither(f: Input => Either[Err, Output])(implicit trace: Trace): Route[Any, Nothing]
def implementHandler[Env](original: Handler[Env, Err, Input, Output])(implicit trace: Trace): Route[Env, Nothing]
def implementHandlerScoped[Env, Env1](original: Handler[Env, Err, Input, Output])(implicit ev: Env <:< (Env1 & Scope), trace: Trace): Route[Env1, Nothing]
def implementPurely(f: Input => Output)(implicit trace: Trace): Route[Any, Nothing]
def implementScoped[Env, Env1](f: Input => ZIO[Env, Err, Output])(implicit ev: Env <:< (Env1 & Scope), trace: Trace): Route[Env1, Nothing]
def in[Input2 : HttpContentCodec](implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema.

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema.

Attributes

def in[Input2 : HttpContentCodec](doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Attributes

def in[Input2 : HttpContentCodec](name: String)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Attributes

def in[Input2 : HttpContentCodec](name: String, doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.

Attributes

def in[Input2 : HttpContentCodec](mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]
def in[Input2 : HttpContentCodec](mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]
def in[Input2 : HttpContentCodec](mediaType: MediaType, name: String)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]
def in[Input2 : HttpContentCodec](mediaType: MediaType, name: String, doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]
def inCodec[Input2](codec: HttpCodec[RequestType, Input2])(implicit combiner: Combiner[Input, Input2]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose request must satisfy the specified codec.

Returns a new endpoint derived from this one, whose request must satisfy the specified codec.

Attributes

def inStream[Input2 : HttpContentCodec](implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, ZStream[Any, Nothing, Input2]]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose input type is a stream of the specified typ.

Returns a new endpoint derived from this one, whose input type is a stream of the specified typ.

Attributes

def inStream[Input2 : HttpContentCodec](doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, ZStream[Any, Nothing, Input2]]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.

Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.

Attributes

def inStream[Input2 : HttpContentCodec](name: String)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, ZStream[Any, Nothing, Input2]]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose input type is a stream of the specified type.

Returns a new endpoint derived from this one, whose input type is a stream of the specified type.

Attributes

def inStream[Input2 : HttpContentCodec](name: String, doc: Doc)(implicit evidence$1: HttpContentCodec[Input2], combiner: Combiner[Input, ZStream[Any, Nothing, Input2]]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.

Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.

Attributes

transparent inline def orOut[Output2 <: Res : HttpContentCodec](implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](status: Status)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](status: Status, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](status: Status, mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOut[Output2 <: Res : HttpContentCodec](status: Status, mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOutCodec[Output2 <: Res](codec: HttpCodec[ResponseType, Output2])(implicit alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, Res, Auth]
Extension method from zio.http.endpoint
transparent inline def orOutError[Err2 <: ErrorRes : HttpContentCodec](status: Status)(implicit evidence$1: HttpContentCodec[Err2], alt: Alternator[Err2, Err]): Endpoint[PathInput, Input, ErrorRes, Output, Auth]
Extension method from zio.http.endpoint
transparent inline def orOutError[Err2 <: ErrorRes : HttpContentCodec](status: Status, doc: Doc)(implicit evidence$1: HttpContentCodec[Err2], alt: Alternator[Err2, Err]): Endpoint[PathInput, Input, ErrorRes, Output, Auth]
Extension method from zio.http.endpoint
def out[Output2 : HttpContentCodec](implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.

Attributes

def out[Output2 : HttpContentCodec](doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.

Attributes

def out[Output2 : HttpContentCodec](mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.

Attributes

def out[Output2 : HttpContentCodec](status: Status)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.

Attributes

def out[Output2 : HttpContentCodec](status: Status, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.

Attributes

def out[Output2 : HttpContentCodec](mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.

Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.

Attributes

def out[Output2 : HttpContentCodec](status: Status, mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.

Attributes

def out[Output2 : HttpContentCodec](status: Status, mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.

Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.

Attributes

def outCodec[Output2](codec: HttpCodec[ResponseType, Output2])(implicit alt: Alternator[Output2, Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose response must satisfy the specified codec.

Returns a new endpoint derived from this one, whose response must satisfy the specified codec.

Attributes

def outCodecError(codec: HttpCodec[ResponseType, HttpCodecError]): Endpoint[PathInput, Input, Err, Output, Auth]

Converts a codec error into a specific error type. The given media types are sorted by q-factor. Beginning with the highest q-factor.

Converts a codec error into a specific error type. The given media types are sorted by q-factor. Beginning with the highest q-factor.

Attributes

def outError[Err2 : HttpContentCodec](status: Status)(implicit evidence$1: HttpContentCodec[Err2], alt: Alternator[Err2, Err]): Endpoint[PathInput, Input, alt.Out, Output, Auth]

Returns a new endpoint that can fail with the specified error type for the specified status code.

Returns a new endpoint that can fail with the specified error type for the specified status code.

Attributes

def outError[Err2 : HttpContentCodec](status: Status, doc: Doc)(implicit evidence$1: HttpContentCodec[Err2], alt: Alternator[Err2, Err]): Endpoint[PathInput, Input, alt.Out, Output, Auth]

Returns a new endpoint that can fail with the specified error type for the specified status code and is documented.

Returns a new endpoint that can fail with the specified error type for the specified status code and is documented.

Attributes

def outErrors[Err2]: OutErrors[PathInput, Input, Err, Output, Auth, Err2]
def outHeader[A](codec: HeaderCodec[A])(implicit combiner: Combiner[Output, A]): Endpoint[PathInput, Input, Err, combiner.Out, Auth]
def outHeader[A](name: String)(implicit schema: Schema[A], combiner: Combiner[Output, A]): Endpoint[PathInput, Input, Err, combiner.Out, Auth]

Returns a new endpoint that requires the specified headers to be part of the response.

Returns a new endpoint that requires the specified headers to be part of the response.

Attributes

def outHeader[A](implicit schema: Schema[A], combiner: Combiner[Output, A]): Endpoint[PathInput, Input, Err, combiner.Out, Auth]

Returns a new endpoint that requires the specified headers to be part of the response.

Returns a new endpoint that requires the specified headers to be part of the response.

Attributes

def outStream[Output2 : HttpContentCodec](implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.

Attributes

def outStream[Output2 : HttpContentCodec](doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.

Attributes

def outStream[Output2 : HttpContentCodec](status: Status, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the specified status code and is documented.

Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the specified status code and is documented.

Attributes

def outStream[Output2 : HttpContentCodec](mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]
def outStream[Output2 : HttpContentCodec](mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]
def outStream[Output2 : HttpContentCodec](status: Status, mediaType: MediaType)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]
def outStream[Output2 : HttpContentCodec](status: Status, mediaType: MediaType, doc: Doc)(implicit evidence$1: HttpContentCodec[Output2], alt: Alternator[ZStream[Any, Nothing, Output2], Output]): Endpoint[PathInput, Input, Err, alt.Out, Auth]
def query[A](codec: QueryCodec[A])(implicit combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified query.

Returns a new endpoint that requires the specified query.

Attributes

def query[A](name: String)(implicit schema: Schema[A], combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified query.

Returns a new endpoint that requires the specified query.

Attributes

def query[A](implicit schema: Schema[A], combiner: Combiner[Input, A]): Endpoint[PathInput, combiner.Out, Err, Output, Auth]

Returns a new endpoint that requires the specified query.

Returns a new endpoint that requires the specified query.

Attributes

def scopes(scopes: String*): Endpoint[PathInput, Input, Err, Output, AuthType]
def tag(tag: String, tags: String*): Endpoint[PathInput, Input, Err, Output, Auth]

Adds tags to the endpoint. They are used for documentation generation. For example to group endpoints for OpenAPI.

Adds tags to the endpoint. They are used for documentation generation. For example to group endpoints for OpenAPI.

Attributes

def tags: List[String]

A list of tags for this endpoint.

A list of tags for this endpoint.

Attributes

def transformError[Err1](f: Err => Err1)(g: Err1 => Err): Endpoint[PathInput, Input, Err1, Output, Auth]

Transforms the error of this endpoint using the specified functions.

Transforms the error of this endpoint using the specified functions.

Attributes

def transformIn[Input1](f: Input => Input1)(g: Input1 => Input): Endpoint[PathInput, Input1, Err, Output, Auth]

Transforms the input of this endpoint using the specified functions. This is useful to build from different http inputs a domain specific input.

Transforms the input of this endpoint using the specified functions. This is useful to build from different http inputs a domain specific input.

For example

 case class ChangeUserName(userId: UUID, name: String)
 val endpoint =
 Endpoint(Method.POST / "user" / uuid("userId") / "changeName").in[String]
   .transformIn { case (userId, name) => ChangeUserName(userId, name) } {
     case ChangeUserName(userId, name) => (userId, name)
   }

Attributes

def transformOut[Output1](f: Output => Output1)(g: Output1 => Output): Endpoint[PathInput, Input, Err, Output1, Auth]

Transforms the output of this endpoint using the specified functions.

Transforms the output of this endpoint using the specified functions.

Attributes

def url(basePath: String, values: PathInput): Either[Exception, URL]

Generates a URL for this endpoint given the base path and the path input.

Generates a URL for this endpoint given the base path and the path input.

Attributes

def urlFromRequest(values: PathInput)(request: Request): Either[Exception, URL]
def urlRelative(values: PathInput): Either[Exception, URL]

Generates a URL for this endpoint given the path input.

Generates a URL for this endpoint given the path input.

Attributes

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

val authCombiner: Combiner[Input, authType.ClientRequirement]