p

smithy4s

package smithy4s

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. smithy4s
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package capability
  2. package client
  3. package codecs
  4. package http
  5. package internals
  6. package kinds
  7. package optics
  8. package schema
  9. package server

Type Members

  1. trait Bijection[A, B] extends Function[A, B]

    A bijection is an association of two opposite functions A => B and B => A.

    A bijection is an association of two opposite functions A => B and B => A.

    A bijection MUST abide by the round-tripping property, namely, for all input A :

    bijection.from(bijection(input)) == input

  2. sealed trait Blob extends AnyRef
  3. final case class ConstraintError(hint: Hint, message: String) extends Throwable with NoStackTrace with Product with Serializable
  4. sealed trait Document extends Product with Serializable

    A json-like free-form structure serving as a model for the Document datatype in smithy.

  5. trait Endpoint[Op[_, _, _, _, _], I, E, O, SI, SO] extends Base[I, E, O, SI, SO]

    A representation of a smithy operation.

  6. trait Enumeration[E <: Value] extends Companion[E]
  7. trait Errorable[E] extends AnyRef
  8. trait HasId extends AnyRef
  9. type Hint = Binding
  10. sealed abstract class HintMask extends AnyRef
  11. trait Hints extends AnyRef

    A hint is an arbitrary piece of data that can be added to a schema, at the struct level, or at the field/member level.

    A hint is an arbitrary piece of data that can be added to a schema, at the struct level, or at the field/member level.

    You can think of it as an annotation that can communicate additional information to encoders/decoders (for instance, a change in a label, a regex pattern some string should abide by, a range, etc)

    This Hints interface is a container for hints.

    Under the hood, the hints are composed of two maps : one for member-level hints, one for target-level hints.

  12. final class Lazy[A] extends AnyRef
  13. abstract class Newtype[A] extends HasId
  14. sealed trait PartialData[A] extends AnyRef

    Data structure that can hold either the totality or a subset of a larger piece of data.

    Data structure that can hold either the totality or a subset of a larger piece of data.

    This can be used to reconcile bits of data that are coming from several locations, or to send a piece of data towards different locations.

    For instance :

    structure AB {
      @httpPayload
      @required
      a: String,
    
      @httpHeader("X-B")
      @required
      b: String
    }

    translates to this case class

    case class AB(a: String, b: String)

    .

    However, codec derivation (performed by the SchemaVisitor mechanism in Smithy4s), does not let us easily solve for problem such as http message decoding, because of the notion of priority : the http body of a message should not be decoded if the metadata is not fully decoded first.

    In order to solve for this, the PartialData type allows to momentarily store a subset of the fields of a case class so that it can be reconciled with other pieces of PartialData later on.

  15. trait Protocol[A] extends AnyRef
  16. trait Refinement[A, B] extends AnyRef

    A type-refinement, associated to a runtime-representation of a constraint.

    A type-refinement, associated to a runtime-representation of a constraint.

    Represents the fact that you can go from A to B provided the value of tye A abides by a given Constraint.

  17. trait RefinementProvider[C, A, B] extends AnyRef

    Given a constraint of type C, an RefinementProvider can produce a Refinement that allows to go from A to B.

    Given a constraint of type C, an RefinementProvider can produce a Refinement that allows to go from A to B.

    A RefinementProvider can be used as a typeclass.

  18. type Schema[A] = smithy4s.schema.Schema[A]
  19. trait Service[Alg[_[_, _, _, _, _]]] extends FunctorK5[Alg] with HasId

    Generic representation of a service, as a list of "endpoints" (mapping to smithy operations).

    Generic representation of a service, as a list of "endpoints" (mapping to smithy operations).

    This abstraction lets us retrieve all information necessary to the generic implementation of protocols, as well as transform implementations of finally-encoded interfaces into interpreters (polymorphic functions) that operate on initially-encoded GADTs.

  20. trait ServiceProduct[Prod[_[_, _, _, _, _]]] extends FunctorK5[Prod]

    Something that returns a product of endpoints.

    Something that returns a product of endpoints. Contains the same information as a service, with the difference that the algebra (the product type parameter) can be be an interface with methods without inputs.

    Prod

    the product type parameter. For code generation this is also generated as an interface with methods without inputs (one for each endpoint). This has suffix ProductGen.

  21. final case class ShapeId(namespace: String, name: String) extends HasId with Product with Serializable
  22. trait ShapeTag[A] extends HasId

    A tag that can be used as keys for higher-kinded maps

  23. sealed trait StreamingSchema[A] extends AnyRef
  24. trait Surjection[A, B] extends Function[A, Either[String, B]]

    A surjection of a partial function A => Either[String, B] and a total function B => A.

    A surjection of a partial function A => Either[String, B] and a total function B => A.

    A surjection MUST abide by the round-tripping property, namely, for all input A that passes the validation function

    surjection(input).map(surjection.from) == Right(input)

  25. case class Timestamp extends TimestampPlatform with Product with Serializable
  26. trait Transformation[Func, Input, Output] extends AnyRef

    Heterogenous function construct, allows to abstract over various kinds of functions whilst providing an homogenous user experience without the user having to manually lift functions from one kind to the other.

    Heterogenous function construct, allows to abstract over various kinds of functions whilst providing an homogenous user experience without the user having to manually lift functions from one kind to the other.

    // assuming Foo is a code-generated interface
    val fooOption: Foo[Option] = ???
    val toList = new smithy4s.PolyFunction[Option, List]{def apply[A](fa: Option[A]): List[A] = fa.toList}
    val fooList: Foo[List] = foo.transform(toList)

    It is possible to plug arbitrary transformations to mechanism, such as cats.arrow.FunctionK

  27. final case class UnsupportedProtocolError(service: HasId, protocolTag: HasId) extends Throwable with Product with Serializable
  28. type ~>[F[_], G[_]] = PolyFunction[F, G]

Value Members

  1. val Schema: smithy4s.schema.Schema.type
  2. def checkProtocol[Alg[_[_, _, _, _, _]]](service: Service[Alg], protocolTag: ShapeTag[_]): Either[UnsupportedProtocolError, Unit]
  3. object Bijection
  4. object Blob
  5. object Document extends Serializable
  6. object Endpoint
  7. object Enumeration
  8. object Errorable
  9. object HintMask
  10. object Hints
  11. object Lazy
  12. object Newtype
  13. object NumericCompat
  14. object PartialData
  15. object Refinement
  16. object RefinementProvider
  17. object Service
  18. object ServiceProduct
  19. object ShapeId extends Has[ShapeId] with Serializable
  20. object ShapeTag
  21. object StreamingSchema
  22. object Surjection
  23. object Timestamp extends TimestampCompanionPlatform with Serializable
  24. object Transformation

Inherited from AnyRef

Inherited from Any

Ungrouped