trait Responses extends StatusCodes with InvariantFunctorSyntax

Self Type
Responses with Errors
Source
Responses.scala
Known Subclasses
BasicAuthentication, ChunkedEntities, ChunkedJsonEntities, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, JsonEntitiesFromSchemas, MuxEndpoints, BasicAuthentication, ChunkedEntities, ChunkedJsonEntities, Endpoints, EndpointsWithCustomErrors, JsonEntities, JsonEntitiesFromCodecs, JsonEntitiesFromEncodersAndDecoders, JsonEntitiesFromSchemas, MuxEndpoints, Assets, BasicAuthentication, ChunkedEntities, ChunkedJsonEntities, Endpoints, EndpointsWithCustomErrors, JsonCodecs, JsonEntities, JsonEntitiesFromCodecs, JsonEntitiesFromSchemas, LowLevelEndpoints, MuxEndpoints, JsonEntitiesFromCodecs, JsonEntitiesFromCodecs, BasicAuthentication, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, JsonEntitiesFromSchemas, Assets, BasicAuthentication, ChunkedEntities, ChunkedJsonEntities, Endpoints, EndpointsWithCustomErrors, JsonEntities, JsonEntitiesFromSchemas, MuxEndpoints, Responses, BasicAuthentication, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, MuxEndpoints, Assets, BasicAuthentication, ChunkedEntities, ChunkedJsonEntities, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, JsonEntitiesFromEncodersAndDecoders, JsonEntitiesFromSchemas, LowLevelEndpoints, MuxEndpoints, JsonEntities, JsonEntitiesFromCodecs, BasicAuthentication, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, Responses, BasicAuthentication, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, MuxEndpoints, Assets, BasicAuthentication, Endpoints, EndpointsWithCustomErrors, JsonEntitiesFromCodecs, JsonEntitiesFromSchemas, LowLevelEndpoints, MuxEndpoints, JsonEntities, Endpoints, MuxEndpoints, Endpoints, EndpointsWithCustomErrors, Endpoints, EndpointsWithCustomErrors, MuxEndpoints
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Responses
  2. InvariantFunctorSyntax
  3. StatusCodes
  4. AnyRef
  5. Any
Implicitly
  1. by StringFormat
  2. by Ensuring
  3. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. implicit class InvariantFunctorSyntax[A, F[_]] extends AnyRef

    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.

    Definition Classes
    InvariantFunctorSyntax
  2. abstract type Response[A]

    An HTTP response (status, headers, and entity) carrying an information of type A

    An HTTP response (status, headers, and entity) carrying an information of type A

    Note

    This type has implicit methods provided by the InvariantFunctorSyntax and ResponseSyntax classes

  3. abstract type ResponseEntity[A]

    An HTTP response entity carrying an information of type A

    An HTTP response entity carrying an information of type A

    Note

    This type has implicit methods provided by the InvariantFunctorSyntax class

  4. abstract type ResponseHeaders[A]

    Information carried by responses’ headers.

    Information carried by responses’ headers.

    You can construct values of type ResponseHeaders by using the operations responseHeader, optResponseHeader, or emptyResponseHeaders.

    Note

    This type has implicit methods provided by the SemigroupalSyntax and InvariantFunctorSyntax classes.

  5. implicit class ResponseSyntax[A] extends AnyRef

    Extension methods for Response.

  6. abstract type StatusCode

    HTTP Status Code

    HTTP Status Code

    Definition Classes
    StatusCodes

Abstract Value Members

  1. abstract def Accepted: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  2. abstract def BadRequest: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
    Note

    You should use the badRequest constructor provided by the endpoints.algebra.Responses trait to ensure that errors produced by endpoints are consistently handled by interpreters.

  3. abstract def Created: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  4. abstract def Forbidden: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  5. abstract def InternalServerError: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
    Note

    You should use the internalServerError constructor provided by the endpoints.algebra.Responses trait to ensure that errors produced by endpoints are consistently handled by interpreters.

  6. abstract def NoContent: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  7. abstract def NotFound: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  8. abstract def NotImplemented: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  9. abstract def OK: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  10. abstract def Unauthorized: (Responses.this)#StatusCode

    Definition Classes
    StatusCodes
  11. abstract def choiceResponse[A, B](responseA: (Responses.this)#Response[A], responseB: (Responses.this)#Response[B]): (Responses.this)#Response[Either[A, B]]

    Alternative between two possible choices of responses.

    Alternative between two possible choices of responses.

    Server interpreters construct either one or the other response. Client interpreters accept either one or the other response. Documentation interpreters list all the possible responses.

  12. abstract def emptyResponse: (Responses.this)#ResponseEntity[Unit]

    Empty response entity

  13. abstract def emptyResponseHeaders: (Responses.this)#ResponseHeaders[Unit]

    No particular response header.

    No particular response header. Client interpreters should ignore information carried by response headers.

  14. abstract def optResponseHeader(name: String, docs: Documentation = None): (Responses.this)#ResponseHeaders[Option[String]]

    Response headers optionally containing a header with the given name.

    Response headers optionally containing a header with the given name. Client interpreters should model the header value as Some[String], or None if the response header is missing. Server interpreters should produce such a response header. Documentation interpreters should document this header.

  15. abstract def response[A, B, R](statusCode: (Responses.this)#StatusCode, entity: (Responses.this)#ResponseEntity[A], docs: Documentation = None, headers: (Responses.this)#ResponseHeaders[B] = emptyResponseHeaders)(implicit tupler: Tupler.Aux[A, B, R]): (Responses.this)#Response[R]

    Server interpreters construct a response with the given status and entity.

    Server interpreters construct a response with the given status and entity. Client interpreters accept a response only if it has a corresponding status code.

    statusCode

    Response status code

    entity

    Response entity

    docs

    Response documentation

    headers

    Response headers

  16. implicit abstract def responseEntityInvariantFunctor: InvariantFunctor[(Responses.this)#ResponseEntity]
  17. abstract def responseHeader(name: String, docs: Documentation = None): (Responses.this)#ResponseHeaders[String]

    Response headers containing a header with the given name.

    Response headers containing a header with the given name. Client interpreters should model the header value as String, or fail if the response header is missing. Server interpreters should produce such a response header. Documentation interpreters should document this header.

    Example:

    val versionedResource: Endpoint[Unit, (SomeResource, String)] =
      endpoint(
        get(path / "versioned-resource"),
        ok(
          jsonResponse[SomeResource],
          headers = responseHeader("ETag")
        )
      )
  18. implicit abstract def responseHeadersInvariantFunctor: InvariantFunctor[(Responses.this)#ResponseHeaders]

    Provides xmap operation.

    Provides xmap operation.

    See also

    InvariantFunctorSyntax

  19. implicit abstract def responseHeadersSemigroupal: Semigroupal[(Responses.this)#ResponseHeaders]

    Provides ++ operation.

    Provides ++ operation.

    See also

    SemigroupalSyntax

  20. implicit abstract def responseInvariantFunctor: InvariantFunctor[(Responses.this)#Response]

    Provides the operation xmap to the type Response

    Provides the operation xmap to the type Response

    See also

    InvariantFunctorSyntax

  21. abstract def textResponse: (Responses.this)#ResponseEntity[String]

    Text response entity

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ->[B](y: B): (Responses, B)
    Implicit
    This member is added by an implicit conversion from Responses toArrowAssoc[Responses] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. final def badRequest[A, R](docs: Documentation = None, headers: (Responses.this)#ResponseHeaders[A] = emptyResponseHeaders)(implicit tupler: Tupler.Aux[(Responses.this)#ClientErrors, A, R]): (Responses.this)#Response[R]

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

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

    See also

    endpoints.algebra.Errors and endpoints.algebra.BuiltInErrors

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def ensuring(cond: (Responses) => Boolean, msg: => Any): Responses
    Implicit
    This member is added by an implicit conversion from Responses toEnsuring[Responses] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Responses) => Boolean): Responses
    Implicit
    This member is added by an implicit conversion from Responses toEnsuring[Responses] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): Responses
    Implicit
    This member is added by an implicit conversion from Responses toEnsuring[Responses] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Responses
    Implicit
    This member is added by an implicit conversion from Responses toEnsuring[Responses] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Responses toStringFormat[Responses] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def internalServerError[A, R](docs: Documentation = None, headers: (Responses.this)#ResponseHeaders[A] = emptyResponseHeaders)(implicit tupler: Tupler.Aux[(Responses.this)#ServerError, A, R]): (Responses.this)#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

    endpoints.algebra.Errors and endpoints.algebra.BuiltInErrors

  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def ok[A, B, R](entity: (Responses.this)#ResponseEntity[A], docs: Documentation = None, headers: (Responses.this)#ResponseHeaders[B] = emptyResponseHeaders)(implicit tupler: Tupler.Aux[A, B, R]): (Responses.this)#Response[R]

    OK (200) Response with the given entity

  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wheneverFound[A](responseA: (Responses.this)#Response[A], notFoundDocs: Documentation = None): (Responses.this)#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).

Deprecated Value Members

  1. def [B](y: B): (Responses, B)
    Implicit
    This member is added by an implicit conversion from Responses toArrowAssoc[Responses] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from StatusCodes

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion StringFormat fromResponses to StringFormat[Responses]

Inherited by implicit conversion Ensuring fromResponses to Ensuring[Responses]

Inherited by implicit conversion ArrowAssoc fromResponses to ArrowAssoc[Responses]

Types

Types introduced by the algebra

Operations

Operations creating and transforming values

Ungrouped