Packages

trait Urls extends algebra.Urls with StatusCodes

algebra.Urls interpreter that decodes and encodes URLs.

Self Type
EndpointsWithCustomErrors
Source
Urls.scala
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Urls
  2. StatusCodes
  3. StatusCodes
  4. Urls
  5. PartialInvariantFunctorSyntax
  6. InvariantFunctorSyntax
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Types

Types introduced by the algebra

  1. type QueryString[A] = (EndpointsWithCustomErrors.Params) => Validated[A]

    A query string carrying an A information

    A query string carrying an A information

    QueryString values can be created with the qs operation, and can be combined with the & operation:

    val queryPageAndLang: QueryString[(Int, Option[String])] =
      qs[Int]("page") & qs[Option[String]]("lang")
    • Server interpreters raise an error if they can’t parse the incoming request query string parameters as a value of type A. By default, they produce a Bad Request (400) response with a list of error messages in a JSON array. Refer to the documentation of your server interpreter to customize this behavior.
    Definition Classes
    UrlsUrls
    Note

    This type has implicit methods provided by the QueryStringSyntax, InvariantFunctorSyntax, and the PartialInvariantFunctorSyntax classes.

  2. type StatusCode = Status

    HTTP Status Code

    HTTP Status Code

    Definition Classes
    StatusCodesStatusCodes
  3. type WithDefault[A] = A

    This type is necessary to express different perspectives of servers and clients on optional query string parameters with default value:

    This type is necessary to express different perspectives of servers and clients on optional query string parameters with default value:

    • Client interpreters should define it as Option[A] and omit query string parameters with default value that are empty
    • Server interpreters should define it as A and accept incoming requests whose query string parameters with default value are missing, while providing the defined default value
    • Documentation interpreters should mark the parameter as optional and document the provided default value
    Definition Classes
    UrlsUrls

Operations

Operations creating and transforming values

  1. implicit class PathOps[A] extends AnyRef

    Convenient methods for Paths.

    Convenient methods for Paths.

    Definition Classes
    Urls
  2. implicit class QueryStringSyntax[A] extends AnyRef

    Extension methods on QueryString.

    Extension methods on QueryString.

    Definition Classes
    Urls
  1. def Accepted: Status

    Definition Classes
    StatusCodesStatusCodes
  2. def AlreadyReported: Status

    Definition Classes
    StatusCodesStatusCodes
  3. def BadRequest: Status

    Definition Classes
    StatusCodesStatusCodes
    Note

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

  4. def Conflict: Status

    Definition Classes
    StatusCodesStatusCodes
  5. def Created: Status

    Definition Classes
    StatusCodesStatusCodes
  6. def ExpectationFailed: Status

    Definition Classes
    StatusCodesStatusCodes
  7. def FailedDependency: Status

    Definition Classes
    StatusCodesStatusCodes
  8. def Forbidden: Status

    Definition Classes
    StatusCodesStatusCodes
  9. def Gone: Status

    Definition Classes
    StatusCodesStatusCodes
  10. def IMUsed: Status

    Definition Classes
    StatusCodesStatusCodes
  11. def InternalServerError: Status

    Definition Classes
    StatusCodesStatusCodes
    Note

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

  12. def LengthRequired: Status

    Definition Classes
    StatusCodesStatusCodes
  13. def Locked: Status

    Definition Classes
    StatusCodesStatusCodes
  14. def MethodNotAllowed: Status

    Definition Classes
    StatusCodesStatusCodes
  15. def MisdirectedRequest: Status

    Definition Classes
    StatusCodesStatusCodes
  16. def MultiStatus: Status

    Definition Classes
    StatusCodesStatusCodes
  17. def NoContent: Status

    Definition Classes
    StatusCodesStatusCodes
  18. def NonAuthoritativeInformation: Status

    Definition Classes
    StatusCodesStatusCodes
  19. def NotAcceptable: Status

    Definition Classes
    StatusCodesStatusCodes
  20. def NotFound: Status

    Definition Classes
    StatusCodesStatusCodes
  21. def NotImplemented: Status

    Definition Classes
    StatusCodesStatusCodes
  22. def NotModified: Status

    Definition Classes
    StatusCodesStatusCodes
  23. def OK: Status

    Definition Classes
    StatusCodesStatusCodes
  24. def PartialContent: Status

    Definition Classes
    StatusCodesStatusCodes
  25. def PayloadTooLarge: Status

    Definition Classes
    StatusCodesStatusCodes
  26. def PaymentRequired: Status

    Definition Classes
    StatusCodesStatusCodes
  27. def PermanentRedirect: Status

    Definition Classes
    StatusCodesStatusCodes
  28. def PreconditionFailed: Status

    Definition Classes
    StatusCodesStatusCodes
  29. def PreconditionRequired: Status

    Definition Classes
    StatusCodesStatusCodes
  30. def ProxyAuthenticationRequired: Status

    Definition Classes
    StatusCodesStatusCodes
  31. def RangeNotSatisfiable: Status

    Definition Classes
    StatusCodesStatusCodes
  32. def RequestHeaderFieldsTooLarge: Status

    Definition Classes
    StatusCodesStatusCodes
  33. def RequestTimeout: Status

    Definition Classes
    StatusCodesStatusCodes
  34. def ResetContent: Status

    Definition Classes
    StatusCodesStatusCodes
  35. def TemporaryRedirect: Status

    Definition Classes
    StatusCodesStatusCodes
  36. def TooEarly: Status

    Definition Classes
    StatusCodesStatusCodes
  37. def TooManyRequests: Status

    Definition Classes
    StatusCodesStatusCodes
  38. def Unauthorized: Status

    Definition Classes
    StatusCodesStatusCodes
  39. def UnavailableForLegalReasons: Status

    Definition Classes
    StatusCodesStatusCodes
  40. def UnprocessableEntity: Status

    Definition Classes
    StatusCodesStatusCodes
  41. def UnsupportedMediaType: Status

    Definition Classes
    StatusCodesStatusCodes
  42. def UpgradeRequired: Status

    Definition Classes
    StatusCodesStatusCodes
  43. def UriTooLong: Status

    Definition Classes
    StatusCodesStatusCodes
  44. implicit def booleanQueryString: EndpointsWithCustomErrors.QueryStringParam[Boolean]

    Query string parameter containing a Boolean value

    Query string parameter containing a Boolean value

    Definition Classes
    Urls
  45. implicit def doubleQueryString: EndpointsWithCustomErrors.QueryStringParam[Double]

    Codec for query string parameters of type Double

    Codec for query string parameters of type Double

    Definition Classes
    Urls
  46. implicit def doubleSegment: EndpointsWithCustomErrors.Segment[Double]

    Path segment codec for type Double

    Path segment codec for type Double

    Definition Classes
    Urls
  47. implicit def intQueryString: EndpointsWithCustomErrors.QueryStringParam[Int]

    Ability to define Int query string parameters

    Ability to define Int query string parameters

    Definition Classes
    Urls
  48. implicit def intSegment: EndpointsWithCustomErrors.Segment[Int]

    Path segment codec for type Int

    Path segment codec for type Int

    Definition Classes
    Urls
  49. implicit def longQueryString: EndpointsWithCustomErrors.QueryStringParam[Long]

    Query string parameter containing a Long value

    Query string parameter containing a Long value

    Definition Classes
    Urls
  50. implicit def longSegment: EndpointsWithCustomErrors.Segment[Long]

    Path segment codec for type Long

    Path segment codec for type Long

    Definition Classes
    Urls
  51. def optQsWithDefault[A](name: String, default: A, docs: Documentation = None)(implicit value: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryString[EndpointsWithCustomErrors.WithDefault[A]]

    Builds a QueryString with one optional parameter, which has a default value.

    Builds a QueryString with one optional parameter, which has a default value.

    Examples:

    optQsWithDefault[Int]("page", 1) // optional `page` parameter, with default value 1
    A

    Type of the value carried by the parameter

    name

    Parameter’s name

    Definition Classes
    UrlsUrls
  52. implicit def optionalQueryStringParam[A](implicit param: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryStringParam[Option[A]]

    Make a query string parameter optional:

    Make a query string parameter optional:

    path / "articles" /? qs[Option[Int]]("page")
    • Client interpreters must omit optional query string parameters that are empty.
    • Server interpreters must accept incoming requests whose optional query string parameters are missing, and they must report a failure for incoming requests whose optional query string parameters are present, but malformed,
    • Documentation interpreters should mark the parameter as optional.
    Definition Classes
    UrlsUrls
  53. val path: EndpointsWithCustomErrors.Path[Unit]

    An empty path.

    An empty path.

    Useful to begin a path definition:

    path / "foo" / segment[Int] /? qs[String]("bar")
    Definition Classes
    Urls
  54. def qs[A](name: String, docs: Documentation = None)(implicit value: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryString[A]

    Builds a QueryString with one parameter.

    Builds a QueryString with one parameter.

    Examples:

    qs[Int]("page")            // mandatory `page` parameter
    qs[Option[String]]("lang") // optional `lang` parameter
    qs[List[Long]]("id")       // repeated `id` parameter
    A

    Type of the value carried by the parameter

    name

    Parameter’s name

    Definition Classes
    UrlsUrls
  55. def remainingSegments(name: String = "", docs: Documentation = None): EndpointsWithCustomErrors.Path[String]

    The remaining segments of the path.

    The remaining segments of the path. The String value carried by this Path is still URL-encoded.

    Definition Classes
    UrlsUrls
  56. implicit def repeatedQueryStringParam[A, CC[X] <: Iterable[X]](implicit param: EndpointsWithCustomErrors.QueryStringParam[A], factory: Factory[A, CC[A]]): EndpointsWithCustomErrors.QueryStringParam[CC[A]]

    Support query string parameters with multiple values:

    Support query string parameters with multiple values:

    path / "articles" /? qs[List[Long]]("id")
    • Server interpreters must accept incoming requests where such parameters are missing (in such a case, its value is an empty collection), and report a failure if at least one value is malformed.
    Definition Classes
    UrlsUrls
  57. def segment[A](name: String = "", docs: Documentation = None)(implicit A: EndpointsWithCustomErrors.Segment[A]): EndpointsWithCustomErrors.Path[A]

    A path segment carrying an A information

    A path segment carrying an A information

    Definition Classes
    UrlsUrls
  58. def staticPathSegment(segment: String): EndpointsWithCustomErrors.Path[Unit]

    A path segment whose value is the given segment

    A path segment whose value is the given segment

    Definition Classes
    UrlsUrls
  59. implicit def stringQueryString: EndpointsWithCustomErrors.QueryStringParam[String]

    Ability to define String query string parameters

    Ability to define String query string parameters

    Definition Classes
    UrlsUrls
  60. implicit def stringSegment: EndpointsWithCustomErrors.Segment[String]

    Path segment codec for type String

    Path segment codec for type String

    • Server interpreters should return an URL-decoded string value,
    • Client interpreters should take an URL-decoded string value.
    Definition Classes
    UrlsUrls
  61. implicit def uuidQueryString: EndpointsWithCustomErrors.QueryStringParam[UUID]

    Ability to define UUID query string parameters

    Ability to define UUID query string parameters

    Definition Classes
    Urls
  62. implicit def uuidSegment: EndpointsWithCustomErrors.Segment[UUID]

    Path segment codec for type UUID

    Path segment codec for type UUID

    Definition Classes
    Urls

Ungrouped

  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. implicit class PartialInvariantFunctorSyntax[A, F[_]] extends AnyRef
  3. abstract type Effect[A]
  4. type Params = Map[String, Seq[String]]
  5. trait Path[A] extends EndpointsWithCustomErrors.Url[A]
  6. trait QueryStringParam[A] extends AnyRef
  7. trait Segment[A] extends AnyRef
  8. trait Url[A] extends AnyRef
  1. def chainPaths[A, B](first: EndpointsWithCustomErrors.Path[A], second: EndpointsWithCustomErrors.Path[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.Path[Out]

    Chains the two paths

    Chains the two paths

    Definition Classes
    UrlsUrls
  2. def combineQueryStrings[A, B](first: EndpointsWithCustomErrors.QueryString[A], second: EndpointsWithCustomErrors.QueryString[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.QueryString[Out]

    Concatenates two QueryStrings

    Concatenates two QueryStrings

    Definition Classes
    UrlsUrls
  3. implicit def pathPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Path]

    Provides xmap and xmapPartial operations.

    Provides xmap and xmapPartial operations.

    Definition Classes
    UrlsUrls
    See also

    PartialInvariantFunctorSyntax and InvariantFunctorSyntax

  4. implicit def queryStringParamPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryStringParam]

    Provides xmap and xmapPartial operations.

    Provides xmap and xmapPartial operations.

    Definition Classes
    UrlsUrls
    See also

    PartialInvariantFunctorSyntax and InvariantFunctorSyntax

  5. implicit def queryStringPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryString]

    Provides xmap and xmapPartial operations.

    Provides xmap and xmapPartial operations.

    Definition Classes
    UrlsUrls
    See also

    PartialInvariantFunctorSyntax and InvariantFunctorSyntax

  6. implicit def segmentPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Segment]

    Provides xmap and xmapPartial operations.

    Provides xmap and xmapPartial operations.

    Definition Classes
    UrlsUrls
    See also

    PartialInvariantFunctorSyntax and InvariantFunctorSyntax

  7. implicit def urlPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Url]

    Provides xmap and xmapPartial operations

    Provides xmap and xmapPartial operations

    Definition Classes
    UrlsUrls
    See also

    PartialInvariantFunctorSyntax and InvariantFunctorSyntax

  8. def urlWithQueryString[A, B](path: EndpointsWithCustomErrors.Path[A], qs: EndpointsWithCustomErrors.QueryString[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.Url[Out]

    Builds an URL from the given path and query string

    Builds an URL from the given path and query string

    Definition Classes
    UrlsUrls
  9. val utf8Name: String