Endpoint

zio.blocks.endpoint.Endpoint
See theEndpoint companion object
final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](route: RoutePattern[PathInput], input: HttpCodec[Request, Input], error: HttpCodec[Response, Err], output: HttpCodec[Response, Output], auth: Auth, doc: Doc)

Top-level endpoint descriptor. Combines a route pattern with input/output/error HTTP codecs, authentication, and documentation.

Pure data — no implement* methods, no Invocation, no codec errors.

Choosing an out overload — pick the row matching what the response needs:

| want status?          | want media-type? | call                                 |
|-----------------------|------------------|--------------------------------------|
| no (defaults to 200)  | no               | out(schema)                          |
| no (defaults to 200)  | no (+ docs)      | out(schema, doc)                     |
| yes                   | no               | out(status, schema)                  |
| no (defaults to 200)  | yes              | out(mediaType, schema)               |
| yes (+ docs)          | no (+ docs)      | out(status, schema, doc)             |
| no (defaults to 200)  | yes (+ docs)     | out(mediaType, schema, doc)          |
| yes                   | yes              | out(status, mediaType, schema)       |
| yes (+ docs)          | yes (+ docs)     | out(status, mediaType, schema, doc)  |
| (already a codec)     | (already a codec)| out(codec)                           |

Only the out(schema) / out(schema, doc) / out(mediaType, ...) rows default the status to 200 Ok; every overload that takes an explicit status uses exactly that status. The outError / orOutError overloads mirror these rows but always require an explicit status (errors never default to Ok).

Attributes

Companion
object
Source
Endpoint.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def auth[Auth0 <: AuthType](authType: Auth0): Endpoint[PathInput, Input, Err, Output, Auth0]

Attributes

Source
Endpoint.scala
def doc(documentation: Doc): Endpoint[PathInput, Input, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def header[I2, I3](codec: Header[Request, I2])(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def header[A, I2](name: String, schema: Schema[A])(implicit combiner: WithOut[Input, A, I2]): Endpoint[PathInput, I2, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def header[A, I2](headerCodec: Codec[A])(implicit combiner: WithOut[Input, A, I2]): Endpoint[PathInput, I2, Err, Output, Auth]

Adds a typed request header using a zio.http.Header.Codec.

Adds a typed request header using a zio.http.Header.Codec.

Attributes

Source
Endpoint.scala
def header[A, I2](name: String, schema: Schema[A], doc: Doc)(implicit combiner: WithOut[Input, A, I2]): Endpoint[PathInput, I2, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def in[I2, I3](codec: HttpCodec[Request, I2])(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def in[I2, I3](schema: Schema[I2])(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def in[I2, I3](schema: Schema[I2], doc: Doc)(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def in[I2, I3](mediaType: MediaType, schema: Schema[I2])(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def in[I2, I3](mediaType: MediaType, schema: Schema[I2], doc: Doc)(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def orOutError[E2, E3](codec: HttpCodec[Response, E2])(implicit builder: WithOut[Err, E2, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def orOutError[E2, E3](status: Status, schema: Schema[E2])(implicit builder: WithOut[Err, E2, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def orOutError[E2, E3](status: Status, schema: Schema[E2], doc: Doc)(implicit builder: WithOut[Err, E2, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def orOutError[E2, E3](status: Status, mediaType: MediaType, schema: Schema[E2])(implicit builder: WithOut[Err, E2, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def orOutError[E2, E3](status: Status, mediaType: MediaType, schema: Schema[E2], doc: Doc)(implicit builder: WithOut[Err, E2, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](codec: HttpCodec[Response, O2])(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](schema: Schema[O2])(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Adds a response body described by schema, defaulting the expected status to 200 Ok (via HttpCodec.Ok). This default applies ONLY to the overloads without an explicit status — out(status, schema) uses exactly the status given and nothing else. See the decision table on Endpoint for which overload to pick.

Adds a response body described by schema, defaulting the expected status to 200 Ok (via HttpCodec.Ok). This default applies ONLY to the overloads without an explicit status — out(status, schema) uses exactly the status given and nothing else. See the decision table on Endpoint for which overload to pick.

Attributes

Source
Endpoint.scala
def out[O2, O3](schema: Schema[O2], doc: Doc)(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Like out(schema), plus documentation — the expected status still defaults to 200 Ok (via HttpCodec.Ok).

Like out(schema), plus documentation — the expected status still defaults to 200 Ok (via HttpCodec.Ok).

Attributes

Source
Endpoint.scala
def out[O2, O3](status: Status, schema: Schema[O2])(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](mediaType: MediaType, schema: Schema[O2])(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](status: Status, schema: Schema[O2], doc: Doc)(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](mediaType: MediaType, schema: Schema[O2], doc: Doc)(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](status: Status, mediaType: MediaType, schema: Schema[O2])(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def out[O2, O3](status: Status, mediaType: MediaType, schema: Schema[O2], doc: Doc)(implicit alternator: WithOut[O2, Output, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def outError[E2, E3](codec: HttpCodec[Response, E2])(implicit alternator: WithOut[E2, Err, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def outError[E2, E3](status: Status, schema: Schema[E2])(implicit alternator: WithOut[E2, Err, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def outError[E2, E3](status: Status, schema: Schema[E2], doc: Doc)(implicit alternator: WithOut[E2, Err, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def outError[E2, E3](status: Status, mediaType: MediaType, schema: Schema[E2])(implicit alternator: WithOut[E2, Err, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def outError[E2, E3](status: Status, mediaType: MediaType, schema: Schema[E2], doc: Doc)(implicit alternator: WithOut[E2, Err, E3]): Endpoint[PathInput, Input, E3, Output, Auth]

Attributes

Source
Endpoint.scala
def outHeader[O2, O3](codec: Header[Response, O2])(implicit combiner: WithOut[Output, O2, O3]): Endpoint[PathInput, Input, Err, O3, Auth]

Attributes

Source
Endpoint.scala
def outHeader[A, O2](name: String, schema: Schema[A])(implicit combiner: WithOut[Output, A, O2]): Endpoint[PathInput, Input, Err, O2, Auth]

Attributes

Source
Endpoint.scala
def outHeader[A, O2](headerCodec: Codec[A])(implicit combiner: WithOut[Output, A, O2]): Endpoint[PathInput, Input, Err, O2, Auth]

Adds a typed response header using a zio.http.Header.Codec.

Adds a typed response header using a zio.http.Header.Codec.

Attributes

Source
Endpoint.scala
def outHeader[A, O2](name: String, schema: Schema[A], doc: Doc)(implicit combiner: WithOut[Output, A, O2]): Endpoint[PathInput, Input, Err, O2, Auth]

Attributes

Source
Endpoint.scala
def query[I2, I3](codec: Query[I2])(implicit combiner: WithOut[Input, I2, I3]): Endpoint[PathInput, I3, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def query[A, I2](name: String, schema: Schema[A])(implicit combiner: WithOut[Input, A, I2]): Endpoint[PathInput, I2, Err, Output, Auth]

Attributes

Source
Endpoint.scala
def unauthorizedStatus(status: Status): Endpoint[PathInput, Input, Err, Output, AuthType { type ClientRequirement = auth.ClientRequirement; }]

Attributes

Source
Endpoint.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala