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

    A Blob represents an arbitrary piece of binary data that fits in memory.

    A Blob represents an arbitrary piece of binary data that fits in memory.

    Its underlying data structure enables several types of layouts, as well as efficient concatenation.

  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 AnyRef

    A representation of a smithy operation.

  6. trait Enumeration[E <: Value] extends Companion[E]
  7. trait HasId extends AnyRef
  8. type Hint = Binding
  9. sealed abstract class HintMask extends AnyRef
  10. 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. Member-level hints typically hold values corresponding to member traits, whereas target hints hold values corresponding to normal data shapes.

  11. final class Lazy[A] extends AnyRef
  12. abstract class Newtype[A] extends HasId
  13. 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.

  14. trait Protocol[A] extends AnyRef
  15. 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.

  16. 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.

  17. type Schema[A] = smithy4s.schema.Schema[A]
  18. 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.

  19. 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.

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

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

  22. trait Smithy4sThrowable extends Throwable
  23. 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)

  24. case class Timestamp extends TimestampPlatform with Product with Serializable
  25. 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

  26. final case class UnsupportedProtocolError(service: HasId, protocolTag: HasId) extends Throwable with Product with Serializable
  27. 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 HintMask
  9. object Hints
  10. object Lazy
  11. object Newtype
  12. object NumericCompat
  13. object PartialData
  14. object Refinement
  15. object RefinementProvider extends LowPriorityImplicits
  16. object Service
  17. object ServiceProduct
  18. object ShapeId extends Has[ShapeId] with Serializable
  19. object ShapeTag
  20. object Surjection
  21. object Timestamp extends TimestampCompanionPlatform with Serializable
  22. object Transformation

Inherited from AnyRef

Inherited from Any

Ungrouped