Endpoint

case class Endpoint[I, E, O, -R](input: EndpointInput[I], errorOutput: EndpointOutput[E], output: EndpointOutput[O], info: EndpointInfo) extends EndpointInputsOps[I, E, O, R] with EndpointErrorOutputsOps[I, E, O, R] with EndpointOutputsOps[I, E, O, R] with EndpointInfoOps[I, E, O, R] with EndpointMetaOps[I, E, O, R] with EndpointServerLogicOps[I, E, O, R]
Type Params
E

Error output parameter types.

I

Input parameter types.

O

Output parameter types.

R

The capabilities that are required by this endpoint's inputs/outputs. This might be Any (no requirements), sttp.capabilities.Effect (the interpreter must support the given effect type), sttp.capabilities.Streams (the ability to send and receive streaming bodies) or sttp.capabilities.WebSockets (the ability to handle websocket requests).

trait Serializable
trait Product
trait Equals
trait EndpointServerLogicOps[I, E, O, R]
trait EndpointMetaOps[I, E, O, R]
trait EndpointInfoOps[I, E, O, R]
trait EndpointOutputsOps[I, E, O, R]
trait EndpointOutputsMacros[I, E, O, R]
trait EndpointErrorOutputsOps[I, E, O, R]
trait EndpointErrorOutputsMacros[I, E, O, R]
trait EndpointInputsOps[I, E, O, R]
trait EndpointInputsMacros[I, E, O, R]
class Object
trait Matchable
class Any

Type members

Types

override type EndpointType[_I, _E, _O, -_R] = Endpoint[_I, _E, _O, _R]

Value members

Inherited methods

protected def additionalInputsForShow: Vector[Basic[_]]
Inherited from
EndpointMetaOps
def connect: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def delete: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def deprecated(): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def description(d: String): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def docsExtension[A](key: String, value: A)(implicit evidence$2: JsonCodec[A]): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def errorOut[F, EF](i: EndpointOutput[F])(implicit ts: Aux[E, F, EF]): Endpoint[I, EF, O, R]
def get: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def head: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def httpMethod: Option[Method]
Inherited from
EndpointInputsOps
def in[BS, J, IJ, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[I, J, IJ]): Endpoint[IJ, E, O, R & R2]
Inherited from
EndpointInputsOps
def in[J, IJ](i: EndpointInput[J])(implicit concat: Aux[I, J, IJ]): Endpoint[IJ, E, O, R]
Inherited from
EndpointInputsOps
def info(i: EndpointInfo): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def mapErrorOut[EE](f: E => EE)(g: EE => E): Endpoint[I, EE, O, R]
def mapErrorOut[EE](m: Mapping[E, EE]): Endpoint[I, EE, O, R]
def mapErrorOutDecode[EE](f: E => DecodeResult[EE])(g: EE => E): Endpoint[I, EE, O, R]
inline def mapErrorOutTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): Endpoint[I, CASE_CLASS, O, R]
def mapIn[II](f: I => II)(g: II => I): Endpoint[II, E, O, R]
Inherited from
EndpointInputsOps
def mapIn[II](m: Mapping[I, II]): Endpoint[II, E, O, R]
Inherited from
EndpointInputsOps
def mapInDecode[II](f: I => DecodeResult[II])(g: II => I): Endpoint[II, E, O, R]
Inherited from
EndpointInputsOps
inline def mapInTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): Endpoint[CASE_CLASS, E, O, R]
Inherited from
EndpointInputsMacros
def mapOut[OO](f: O => OO)(g: OO => O): Endpoint[I, E, OO, R]
Inherited from
EndpointOutputsOps
def mapOut[OO](m: Mapping[O, OO]): Endpoint[I, E, OO, R]
Inherited from
EndpointOutputsOps
def mapOutDecode[OO](f: O => DecodeResult[OO])(g: OO => O): Endpoint[I, E, OO, R]
Inherited from
EndpointOutputsOps
inline def mapOutTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): Endpoint[I, E, CASE_CLASS, R]
Inherited from
EndpointOutputsMacros
def method(m: Method): Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def name(n: String): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def options: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def out[PIPE_REQ_RESP, P, OP, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[O, P, OP]): Endpoint[I, E, OP, R & R2 & WebSockets]
Inherited from
EndpointOutputsOps
def out[BS, P, OP, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[O, P, OP]): Endpoint[I, E, OP, R & R2]
Inherited from
EndpointOutputsOps
def out[P, OP](i: EndpointOutput[P])(implicit ts: Aux[O, P, OP]): Endpoint[I, E, OP, R]
Inherited from
EndpointOutputsOps
def patch: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def post: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def prependErrorOut[F, FE](i: EndpointOutput[F])(implicit ts: Aux[F, E, FE]): Endpoint[I, FE, O, R]
def prependIn[BS, J, JI, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[J, I, JI]): Endpoint[JI, E, O, R & R2]
Inherited from
EndpointInputsOps
def prependIn[J, JI](i: EndpointInput[J])(implicit concat: Aux[J, I, JI]): Endpoint[JI, E, O, R]
Inherited from
EndpointInputsOps
def prependOut[PIPE_REQ_RESP, P, PO, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[P, O, PO]): Endpoint[I, E, PO, R & R2 & WebSockets]
Inherited from
EndpointOutputsOps
def prependOut[BS, P, PO, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[P, O, PO]): Endpoint[I, E, PO, R]
Inherited from
EndpointOutputsOps
def prependOut[P, PO](i: EndpointOutput[P])(implicit ts: Aux[P, O, PO]): Endpoint[I, E, PO, R]
Inherited from
EndpointOutputsOps
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def put: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps
def renderPathTemplate(renderPathParam: RenderPathParam, renderQueryParam: Option[RenderQueryParam], includeAuth: Boolean): String

Renders endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for

Renders endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for

endpoint.in("p1" / path[String] / query[String]("par2"))

returns /p1/{param1}?par2={par2}

Value Params
includeAuth

Should authentication inputs be included in the result.

Inherited from
EndpointMetaOps
def serverLogic[F[_]](f: I => F[Either[E, O]]): ServerEndpoint[I, E, O, R, F]

Combine this endpoint description with a function, which implements the server-side logic. The logic returns a result, which is either an error or a successful output, wrapped in an effect type F.

Combine this endpoint description with a function, which implements the server-side logic. The logic returns a result, which is either an error or a successful output, wrapped in an effect type F.

A server endpoint can be passed to a server interpreter. Each server interpreter supports effects of a specific type(s).

Both the endpoint and logic function are considered complete, and cannot be later extended through the returned ServerEndpoint value (except for endpoint meta-data). To provide the logic in parts, see serverLogicPart and serverLogicForCurrent.

Inherited from
EndpointServerLogicOps
def serverLogicForCurrent[U, F[_]](f: I => F[Either[E, U]]): PartialServerEndpoint[I, U, Unit, E, O, R, F]

Combine this endpoint description with a function, which implements a part of the server-side logic, for the entire input defined so far. The partial logic returns a result, which is either an error or a success value, wrapped in an effect type F.

Combine this endpoint description with a function, which implements a part of the server-side logic, for the entire input defined so far. The partial logic returns a result, which is either an error or a success value, wrapped in an effect type F.

Subsequently, the endpoint inputs and outputs can be extended (but not error outputs!). Then, either further parts of the server logic can be provided (again, consuming the whole input defined so far). Or, the entire remaining server logic can be provided, given a function which accepts as arguments the results of applying the part-functions, and the remaining input. The final result is then a ServerEndpoint.

A complete server endpoint can be passed to a server interpreter. Each server interpreter supports effects of a specific type(s).

When using this method, each logic part consumes the whole input defined so far. To provide the server logic in parts, where only part of the input is consumed (but the endpoint cannot be later extended), see the serverLogicPart function.

An example use-case is defining an endpoint with fully-defined errors, and with authorization logic built-in. Such an endpoint can be then extended by multiple other endpoints.

Inherited from
EndpointServerLogicOps
def serverLogicForCurrentRecoverErrors[U, F[_]](f: I => F[U])(implicit eIsThrowable: E <:< Throwable, eClassTag: ClassTag[E]): PartialServerEndpoint[I, U, Unit, E, O, R, F]

Same as serverLogicForCurrent, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Same as serverLogicForCurrent, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Inherited from
EndpointServerLogicOps
def serverLogicPart[T, IR, U, F[_]](f: T => F[Either[E, U]])(implicit iMinusT: Aux[I, T, IR]): ServerEndpointInParts[U, IR, I, E, O, R, F]

Combine this endpoint description with a function, which implements a part of the server-side logic. The partial logic returns a result, which is either an error or a success value, wrapped in an effect type F.

Combine this endpoint description with a function, which implements a part of the server-side logic. The partial logic returns a result, which is either an error or a success value, wrapped in an effect type F.

Subsequent parts of the logic can be provided later using ServerEndpointInParts.andThenPart, consuming successive input parts. Finally, the logic can be completed, given a function which accepts as arguments the results of applying on part-functions, and the remaining input. The final result is then a ServerEndpoint.

A complete server endpoint can be passed to a server interpreter. Each server interpreter supports effects of a specific type(s).

When using this method, the endpoint description is considered complete, and cannot be later extended through the returned ServerEndpointInParts value. However, each part of the server logic can consume only a part of the input. To provide the logic in parts, while still being able to extend the endpoint description, see serverLogicForCurrent.

An example use-case is providing authorization logic, followed by server logic (using an authorized user), given a complete endpoint description.

Note that the type of the f partial server logic function cannot be inferred, it must be explicitly given (e.g. by providing a function or method value).

Inherited from
EndpointServerLogicOps
def serverLogicPartRecoverErrors[T, IR, U, F[_]](f: T => F[U])(implicit eIsThrowable: E <:< Throwable, eClassTag: ClassTag[E], iMinusR: Aux[I, T, IR]): ServerEndpointInParts[U, IR, I, E, O, R, F]

Same as serverLogicPart, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Same as serverLogicPart, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Inherited from
EndpointServerLogicOps
def serverLogicRecoverErrors[F[_]](f: I => F[O])(implicit eIsThrowable: E <:< Throwable, eClassTag: ClassTag[E]): ServerEndpoint[I, E, O, R, F]

Same as serverLogic, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Same as serverLogic, but requires E to be a throwable, and coverts failed effects of type E to endpoint errors.

Inherited from
EndpointServerLogicOps
def show: String

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.)

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.)

Inherited from
EndpointMetaOps
def showDetail: String

Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.

Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.

Inherited from
EndpointMetaOps
def showRaw: String

Equivalent to .toString, shows the whole case class structure.

Equivalent to .toString, shows the whole case class structure.

Inherited from
EndpointMetaOps
def summary(s: String): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def tag(t: String): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def tags(ts: List[String]): Endpoint[I, E, O, R]
Inherited from
EndpointInfoOps
def trace: Endpoint[I, E, O, R]
Inherited from
EndpointInputsOps