smithy4s
Members list
Packages
Type members
Classlikes
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
- Supertypes
-
trait A => Bclass Objecttrait Matchableclass Any
- Self type
-
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.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
-
trait Producttrait Equalstrait NoStackTraceclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
A representation of a smithy operation.
A representation of a smithy operation.
Type parameters
- 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
ErrorSchema
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 great many libraries)
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Composable handler that allows to implement a specific endpoint in isolation.
Composable handler that allows to implement a specific endpoint in isolation.
Handlers are composable and can be reconciled into the service the operations belong to.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ErrorAwareHandler[F]class Handler[F]
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
EndpointHandler.type
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object Errorobject HttpApiKeyLocationsobject Severityobject StructurallyExclusiveobject TimestampFormatobject TraitChangeTypeobject AcceptorStateobject PathComparatorobject ProtoNumTypeobject ProtoTimestampFormatShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Enumeration.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Newtype[A]object HttpMediaTypeobject Authobject AuthTraitReferenceobject Defaultobject Documentationobject Enumobject EnumConstantBodyNameobject EnumValueobject Examplesobject ExternalDocumentationobject HttpErrorobject HttpHeaderobject HttpPrefixHeadersobject HttpQueryobject JsonNameobject LocalMixinTraitobject LocalMixinTraitListobject MediaTypeobject NonEmptyStringobject NonEmptyStringListobject NonEmptyStringMapobject Patternobject PrimitiveShortobject Referencesobject ResourceIdentifierobject Sinceobject Suppressobject Tagsobject Titleobject TraitDiffRulesobject TraitShapeIdobject TraitShapeIdListobject TraitValidatorsobject XmlNameobject Acceptorsobject NonEmptyStringobject NonEmptyStringListobject Waitableobject WaiterDelayobject WaiterNameobject ProtoIndexobject ProtoReservedFieldsobject DataExamplesobject DefaultValueobject Discriminatedobject UncheckedExamplesobject UrlFormNametrait Service[Alg]trait Reflective[Op]class ShapeIdtrait ShapeTag[A]trait Companion[A]object HttpBindingobject DiscriminatedUnionMemberobject InputOutputtrait Companion[E]trait Enumeration[E]object Errorobject HttpApiKeyLocationsobject Severityobject StructurallyExclusiveobject TimestampFormatobject TraitChangeTypeobject AcceptorStateobject PathComparatorobject ProtoNumTypeobject ProtoTimestampFormatobject AddedDefaultobject AuthDefinitionobject Boxobject ClientOptionalobject Corsobject Deprecatedobject Endpointobject EnumDefinitionobject EventHeaderobject EventPayloadobject Exampleobject ExampleErrorobject HostLabelobject Httpobject HttpApiKeyAuthobject HttpBasicAuthobject HttpBearerAuthobject HttpChecksumRequiredobject HttpDigestAuthobject HttpLabelobject HttpPayloadobject HttpQueryParamsobject HttpResponseCodeobject IdRefobject IdempotencyTokenobject Idempotentobject Inputobject Internalobject Lengthobject Mixinobject NestedPropertiesobject NoReplaceobject NotPropertyobject OptionalAuthobject Outputobject Paginatedobject Privateobject Propertyobject ProtocolDefinitionobject Rangeobject Readonlyobject Recommendedobject Referenceobject RequestCompressionobject Requiredobject RequiresLengthobject Retryableobject Sensitiveobject Sparseobject Streamingobject Traitobject TraitDiffRuleobject TraitValidatorobject UniqueItemsobject Unitobject UnitTypeobject Unstableobject XmlAttributeobject XmlFlattenedobject XmlNamespaceobject Acceptorobject Matcherobject PathMatcherobject Waiterobject CountryCodeFormatobject EmailFormatobject HexColorCodeFormatobject LanguageCodeFormatobject LanguageTagFormatobject Grpcobject ProtoCompactUUIDobject ProtoEnabledobject ProtoInlinedOneOfobject ProtoWrappedobject Rangeobject ReservedFieldsDefinitionobject DataExampleobject DateFormatobject Nullableobject OpenEnumobject SimpleRestJsonobject StructurePatternobject UncheckedExampleobject Untaggedobject UrlFormFlattenedobject UuidFormatShow all
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
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.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JsConverters.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object HttpMediaTypeobject Authobject AuthTraitReferenceobject Defaultobject Documentationobject Enumobject EnumConstantBodyNameobject EnumValueobject Examplesobject ExternalDocumentationobject HttpErrorobject HttpHeaderobject HttpPrefixHeadersobject HttpQueryobject JsonNameobject LocalMixinTraitobject LocalMixinTraitListobject MediaTypeobject NonEmptyStringobject NonEmptyStringListobject NonEmptyStringMapobject Patternobject PrimitiveShortobject Referencesobject ResourceIdentifierobject Sinceobject Suppressobject Tagsobject Titleobject TraitDiffRulesobject TraitShapeIdobject TraitShapeIdListobject TraitValidatorsobject XmlNameobject Acceptorsobject NonEmptyStringobject NonEmptyStringListobject Waitableobject WaiterDelayobject WaiterNameobject ProtoIndexobject ProtoReservedFieldsobject DataExamplesobject DefaultValueobject Discriminatedobject UncheckedExamplesobject UrlFormNameShow all
- Self type
-
Newtype[A]
ADT isomorphic to Option
, but representing types that were passed explicitly as null rather than ones that were absent.
ADT isomorphic to Option
, but representing types that were passed explicitly as null rather than ones that were absent.
The goal of this datatype is to offer the ability to distinguish, during serialisation, between the absence of a field and the nullity of a field.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
NumericCompat.type
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.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
PartialData.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
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
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Refinement.type
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
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RefinementProvider.type
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.
Type parameters
- 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.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
trait Reflective[Op]
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.
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.
Type parameters
- 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
.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ServiceProduct.type
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
- Supertypes
- Known subtypes
-
trait Companion[A]object HttpBindingobject DiscriminatedUnionMemberobject InputOutputtrait Companion[E]trait Enumeration[E]object Errorobject HttpApiKeyLocationsobject Severityobject StructurallyExclusiveobject TimestampFormatobject TraitChangeTypeobject AcceptorStateobject PathComparatorobject ProtoNumTypeobject ProtoTimestampFormatobject AddedDefaultobject AuthDefinitionobject Boxobject ClientOptionalobject Corsobject Deprecatedobject Endpointobject EnumDefinitionobject EventHeaderobject EventPayloadobject Exampleobject ExampleErrorobject HostLabelobject Httpobject HttpApiKeyAuthobject HttpBasicAuthobject HttpBearerAuthobject HttpChecksumRequiredobject HttpDigestAuthobject HttpLabelobject HttpPayloadobject HttpQueryParamsobject HttpResponseCodeobject IdRefobject IdempotencyTokenobject Idempotentobject Inputobject Internalobject Lengthobject Mixinobject NestedPropertiesobject NoReplaceobject NotPropertyobject OptionalAuthobject Outputobject Paginatedobject Privateobject Propertyobject ProtocolDefinitionobject Rangeobject Readonlyobject Recommendedobject Referenceobject RequestCompressionobject Requiredobject RequiresLengthobject Retryableobject Sensitiveobject Sparseobject Streamingobject Traitobject TraitDiffRuleobject TraitValidatorobject UniqueItemsobject Unitobject UnitTypeobject Unstableobject XmlAttributeobject XmlFlattenedobject XmlNamespaceobject Acceptorobject Matcherobject PathMatcherobject Waiterobject CountryCodeFormatobject EmailFormatobject HexColorCodeFormatobject LanguageCodeFormatobject LanguageTagFormatobject Grpcobject ProtoCompactUUIDobject ProtoEnabledobject ProtoInlinedOneOfobject ProtoWrappedobject Rangeobject ReservedFieldsDefinitionobject DataExampleobject DateFormatobject Nullableobject OpenEnumobject SimpleRestJsonobject StructurePatternobject UncheckedExampleobject Untaggedobject UrlFormFlattenedobject UuidFormatShow all
Attributes
- Supertypes
-
class Throwabletrait Serializableclass Objecttrait Matchableclass Any
- Self type
-
Product
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
- Supertypes
-
trait A => Either[String, B]class Objecttrait Matchableclass Any
- Self type
-
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Surjection.type
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
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
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Transformation.type
Attributes
- Supertypes
-
trait Producttrait Equalsclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all