smithy4s

package smithy4s

Members list

Concise view

Type members

Classlikes

trait Bijection[A, B] extends 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

Attributes

Companion:
object
Graph
Supertypes
trait A => B
class Object
trait Matchable
class Any
Self type
Bijection[A, B]
object Bijection

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class ByteArray(val array: Array[Byte])

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object ByteArray

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final case class ConstraintError(hint: Hint, message: String) extends Throwable with NoStackTrace

Attributes

Graph
Supertypes
trait Product
trait Equals
class Throwable
trait Serializable
class Object
trait Matchable
class Any
sealed trait Document extends Product with Serializable

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

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

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
class DArray
class DBoolean
object DNull.type
class DNumber
class DObject
class DString
object Document

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Endpoint[Op[_, _, _, _, _], I, E, O, SI, SO]

A representation of a smithy operation.

A representation of a smithy operation.

Attributes

E:

the error ADT of the operation (Nothing if N/A)

I:

the input type of the operation (Unit if N/A)

O:

the output of the operation (Unit if N/A)

Op:

the GADT of all operations in a service

SI:

the Streamed input of the operaton (Nothing if N/A)

SO:

the Streamed output of the operaton (Nothing if N/A) This type carries references to the Schemas of the various types involved, allowing to compile corresponding codecs. Optionally, an endpoint can have an Errorable which allows for matching throwables against the errors the operation knows about (which form an ADT in the Scala representation) NB: SI an SO respectively are derived from the @streaming trait in smithy. If this trait is present in one on one of the members of Input/Output, the member is removed from the Scala representation, in order to avoid polluting datatypes that typically fit in memory with concerns of streaming (which can be encoded a great many ways, using a greatt many libraries)

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Endpoint[Op, I, E, O, SI, SO]
trait Enumeration[E <: Value] extends Companion[E]

Attributes

Companion:
object
Graph
Supertypes
trait Companion[E]
trait Has[E]
trait ShapeTag[E]
trait HasId
class Object
trait Matchable
class Any
Known subtypes
object Error.type
object TimestampFormat.type
object TraitChangeType.type
object AcceptorState.type
object PathComparator.type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Errorable[E]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
trait HasId

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Newtype[A]
object DataExamples.type
object DefaultValue.type
object Discriminated.type
object UncheckedExamples.type
object Auth.type
object AuthTraitReference.type
object Default.type
object Documentation.type
object Enum.type
object EnumValue.type
object Examples.type
object HttpError.type
object HttpHeader.type
object HttpPrefixHeaders.type
object HttpQuery.type
object JsonName.type
object LocalMixinTrait.type
object MediaType.type
object NonEmptyString.type
object NonEmptyStringList.type
object NonEmptyStringMap.type
object Pattern.type
object PrimitiveShort.type
object References.type
object ResourceIdentifier.type
object Since.type
object Suppress.type
object Tags.type
object Title.type
object TraitDiffRules.type
object TraitShapeId.type
object TraitShapeIdList.type
object XmlName.type
object Acceptors.type
object NonEmptyString.type
object NonEmptyStringList.type
object Waitable.type
object WaiterDelay.type
object WaiterName.type
object HttpMediaType.type
trait Service[Alg]
trait Mixin[Alg, Op]
trait Reflective[Op]
class ShapeId
trait ShapeTag[A]
trait Companion[A]
object DataExample.type
object DateFormat.type
object Nullable.type
object SimpleRestJson.type
object StructurePattern.type
object UncheckedExample.type
object Untagged.type
object UuidFormat.type
object CountryCodeFormat.type
object EmailFormat.type
object HexColorCodeFormat.type
object LanguageCodeFormat.type
object LanguageTagFormat.type
object AddedDefault.type
object AuthDefinition.type
object Box.type
object ClientOptional.type
object Cors.type
object Deprecated.type
object Endpoint.type
object EnumDefinition.type
object Error.type
object EventHeader.type
object EventPayload.type
object Example.type
object ExampleError.type
object HostLabel.type
object Http.type
object HttpApiKeyAuth.type
object HttpBasicAuth.type
object HttpBearerAuth.type
object HttpDigestAuth.type
object HttpLabel.type
object HttpPayload.type
object HttpQueryParams.type
object HttpResponseCode.type
object IdRef.type
object IdempotencyToken.type
object Idempotent.type
object Input.type
object Internal.type
object Length.type
object Mixin.type
object NestedProperties.type
object NoReplace.type
object NotProperty.type
object OptionalAuth.type
object Output.type
object Paginated.type
object Private.type
object Property.type
object ProtocolDefinition.type
object Range.type
object Readonly.type
object Recommended.type
object Reference.type
object RequestCompression.type
object Required.type
object RequiresLength.type
object Retryable.type
object Sensitive.type
object Sparse.type
object Streaming.type
object TimestampFormat.type
object Trait.type
object TraitChangeType.type
object TraitDiffRule.type
object UniqueItems.type
object Unit.type
object UnitType.type
object Unstable.type
object XmlAttribute.type
object XmlFlattened.type
object XmlNamespace.type
object Acceptor.type
object AcceptorState.type
object Matcher.type
object PathComparator.type
object PathMatcher.type
object Waiter.type
trait Enumeration[E]
object IntEnum.type
object HttpBinding.type
object InputOutput.type
sealed abstract class HintMask

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object HintMask

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Hints

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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Hints

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Hints.type
final case class IntEnum()

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object IntEnum extends Companion[IntEnum]

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
trait Has[IntEnum]
trait HasId
class Object
trait Matchable
class Any
Self type
IntEnum.type
final class Lazy[A](make: () => A)

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Lazy

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Lazy.type
abstract opaque class Newtype[A] extends HasId

Attributes

Companion:
object
Graph
Supertypes
trait HasId
class Object
trait Matchable
class Any
Known subtypes
object DataExamples.type
object DefaultValue.type
object Discriminated.type
object UncheckedExamples.type
object Auth.type
object AuthTraitReference.type
object Default.type
object Documentation.type
object Enum.type
object EnumValue.type
object Examples.type
object HttpError.type
object HttpHeader.type
object HttpPrefixHeaders.type
object HttpQuery.type
object JsonName.type
object LocalMixinTrait.type
object MediaType.type
object NonEmptyString.type
object NonEmptyStringList.type
object NonEmptyStringMap.type
object Pattern.type
object PrimitiveShort.type
object References.type
object ResourceIdentifier.type
object Since.type
object Suppress.type
object Tags.type
object Title.type
object TraitDiffRules.type
object TraitShapeId.type
object TraitShapeIdList.type
object XmlName.type
object Acceptors.type
object NonEmptyString.type
object NonEmptyStringList.type
object Waitable.type
object WaiterDelay.type
object WaiterName.type
object HttpMediaType.type
Self type
object Newtype

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Newtype.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class PayloadPath(segments: List[Segment])

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Protocol[A]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
trait Refinement[A, B]

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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Refinement

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait RefinementProvider[C, A, B]

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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
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.

Attributes

Alg:

a finally-encoded interface (commonly called algebra) that works against an abstract "effect" that takes 5 type parameters: Input, Error, Output, StreamedInput, StreamedOutput

Op:

an initially encoded version of the finally-encoded interface. Typically, a GADT that acts as a reification of the operations. Passing the reified versions around makes it drastically easier to implement logic generically, without involving metaprogramming.

Companion:
object
Graph
Supertypes
trait HasId
trait FunctorK5[Alg]
class Object
trait Matchable
class Any
Known subtypes
trait Mixin[Alg, Op]
trait Reflective[Op]
object Service

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Service.type
final case class ShapeId(namespace: String, name: String) extends HasId

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait HasId
class Object
trait Matchable
class Any
object ShapeId extends Has[ShapeId]

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
trait Has[ShapeId]
class Object
trait Matchable
class Any
Self type
ShapeId.type
trait ShapeTag[A] extends HasId

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

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

Attributes

Companion:
object
Graph
Supertypes
trait HasId
class Object
trait Matchable
class Any
Known subtypes
trait Companion[A]
object DataExample.type
object DateFormat.type
object Nullable.type
object SimpleRestJson.type
object StructurePattern.type
object UncheckedExample.type
object Untagged.type
object UuidFormat.type
object CountryCodeFormat.type
object EmailFormat.type
object HexColorCodeFormat.type
object LanguageCodeFormat.type
object LanguageTagFormat.type
object AddedDefault.type
object AuthDefinition.type
object Box.type
object ClientOptional.type
object Cors.type
object Deprecated.type
object Endpoint.type
object EnumDefinition.type
object Error.type
object EventHeader.type
object EventPayload.type
object Example.type
object ExampleError.type
object HostLabel.type
object Http.type
object HttpApiKeyAuth.type
object HttpBasicAuth.type
object HttpBearerAuth.type
object HttpDigestAuth.type
object HttpLabel.type
object HttpPayload.type
object HttpQueryParams.type
object HttpResponseCode.type
object IdRef.type
object IdempotencyToken.type
object Idempotent.type
object Input.type
object Internal.type
object Length.type
object Mixin.type
object NestedProperties.type
object NoReplace.type
object NotProperty.type
object OptionalAuth.type
object Output.type
object Paginated.type
object Private.type
object Property.type
object ProtocolDefinition.type
object Range.type
object Readonly.type
object Recommended.type
object Reference.type
object RequestCompression.type
object Required.type
object RequiresLength.type
object Retryable.type
object Sensitive.type
object Sparse.type
object Streaming.type
object TimestampFormat.type
object Trait.type
object TraitChangeType.type
object TraitDiffRule.type
object UniqueItems.type
object Unit.type
object UnitType.type
object Unstable.type
object XmlAttribute.type
object XmlFlattened.type
object XmlNamespace.type
object Acceptor.type
object AcceptorState.type
object Matcher.type
object PathComparator.type
object PathMatcher.type
object Waiter.type
trait Enumeration[E]
object IntEnum.type
object HttpBinding.type
object InputOutput.type
object ShapeTag

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait StreamingSchema[A]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NoStream.type
class Streamed[A]

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Surjection[A, B] extends 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)

Attributes

Companion:
object
Graph
Supertypes
trait A => Either[String, B]
class Object
trait Matchable
class Any
Self type
object Surjection

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class Timestamp

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Timestamp

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Transformation[Func, Input, Output]

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

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final case class UnsupportedProtocolError(service: HasId, protocolTag: HasId) extends Throwable

Attributes

Graph
Supertypes
trait Product
trait Equals
class Throwable
trait Serializable
class Object
trait Matchable
class Any

Types

type Hint = Binding
type Schema[A] = Schema[A]
type ~>[F[_], G[_]] = PolyFunction[F, G]

Value members

Concrete methods

def checkProtocol[Alg[_[_, _, _, _, _]]](service: Service[Alg], protocolTag: ShapeTag[_]): Either[UnsupportedProtocolError, Unit]

Concrete fields

val Schema: Schema.type
val errorTypeHeader: String