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
-
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
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 great many libraries)
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object Error.typeobject HttpApiKeyLocations.typeobject StructurallyExclusive.typeobject TimestampFormat.typeobject TraitChangeSeverity.typeobject TraitChangeType.typeobject AcceptorState.typeobject PathComparator.typeShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Enumeration.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Newtype[A]object HttpMediaType.typeobject Auth.typeobject AuthTraitReference.typeobject Default.typeobject Documentation.typeobject Enum.typeobject EnumConstantBodyName.typeobject EnumValue.typeobject Examples.typeobject ExternalDocumentation.typeobject HttpError.typeobject HttpHeader.typeobject HttpPrefixHeaders.typeobject HttpQuery.typeobject JsonName.typeobject LocalMixinTrait.typeobject LocalMixinTraitList.typeobject MediaType.typeobject NonEmptyString.typeobject NonEmptyStringList.typeobject NonEmptyStringMap.typeobject Pattern.typeobject PrimitiveShort.typeobject References.typeobject RequestCompressionEncodingsList.typeobject ResourceIdentifier.typeobject Since.typeobject Suppress.typeobject Tags.typeobject Title.typeobject TraitDiffRules.typeobject TraitShapeId.typeobject TraitShapeIdList.typeobject XmlName.typeobject Acceptors.typeobject NonEmptyString.typeobject NonEmptyStringList.typeobject Waitable.typeobject WaiterDelay.typeobject WaiterName.typeobject DataExamples.typeobject DefaultValue.typeobject Discriminated.typeobject UncheckedExamples.typeobject UrlFormName.typetrait Service[Alg]trait Reflective[Op]class ShapeIdtrait ShapeTag[A]trait Companion[A]object HttpBinding.typeobject DiscriminatedUnionMember.typeobject InputOutput.typetrait Enumeration[E]object Error.typeobject HttpApiKeyLocations.typeobject StructurallyExclusive.typeobject TimestampFormat.typeobject TraitChangeSeverity.typeobject TraitChangeType.typeobject AcceptorState.typeobject PathComparator.typeobject AddedDefault.typeobject AuthDefinition.typeobject Box.typeobject ClientOptional.typeobject Cors.typeobject Deprecated.typeobject Endpoint.typeobject EnumDefinition.typeobject EventHeader.typeobject EventPayload.typeobject Example.typeobject ExampleError.typeobject HostLabel.typeobject Http.typeobject HttpApiKeyAuth.typeobject HttpBasicAuth.typeobject HttpBearerAuth.typeobject HttpChecksumRequired.typeobject HttpDigestAuth.typeobject HttpLabel.typeobject HttpPayload.typeobject HttpQueryParams.typeobject HttpResponseCode.typeobject IdRef.typeobject IdempotencyToken.typeobject Idempotent.typeobject Input.typeobject Internal.typeobject Length.typeobject Mixin.typeobject NestedProperties.typeobject NoReplace.typeobject NotProperty.typeobject OptionalAuth.typeobject Output.typeobject Paginated.typeobject Private.typeobject Property.typeobject ProtocolDefinition.typeobject Range.typeobject Readonly.typeobject Recommended.typeobject Reference.typeobject RequestCompression.typeobject Required.typeobject RequiresLength.typeobject Retryable.typeobject Sensitive.typeobject Sparse.typeobject Streaming.typeobject Trait.typeobject TraitDiffRule.typeobject UniqueItems.typeobject Unit.typeobject UnitType.typeobject Unstable.typeobject XmlAttribute.typeobject XmlFlattened.typeobject XmlNamespace.typeobject Acceptor.typeobject Matcher.typeobject PathMatcher.typeobject Waiter.typeobject CountryCodeFormat.typeobject EmailFormat.typeobject HexColorCodeFormat.typeobject LanguageCodeFormat.typeobject LanguageTagFormat.typeobject DataExample.typeobject DateFormat.typeobject Nullable.typeobject OpenEnum.typeobject SimpleRestJson.typeobject StructurePattern.typeobject UncheckedExample.typeobject Untagged.typeobject UrlFormFlattened.typeobject UuidFormat.typeShow 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.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object HttpMediaType.typeobject Auth.typeobject AuthTraitReference.typeobject Default.typeobject Documentation.typeobject Enum.typeobject EnumConstantBodyName.typeobject EnumValue.typeobject Examples.typeobject ExternalDocumentation.typeobject HttpError.typeobject HttpHeader.typeobject HttpPrefixHeaders.typeobject HttpQuery.typeobject JsonName.typeobject LocalMixinTrait.typeobject LocalMixinTraitList.typeobject MediaType.typeobject NonEmptyString.typeobject NonEmptyStringList.typeobject NonEmptyStringMap.typeobject Pattern.typeobject PrimitiveShort.typeobject References.typeobject RequestCompressionEncodingsList.typeobject ResourceIdentifier.typeobject Since.typeobject Suppress.typeobject Tags.typeobject Title.typeobject TraitDiffRules.typeobject TraitShapeId.typeobject TraitShapeIdList.typeobject XmlName.typeobject Acceptors.typeobject NonEmptyString.typeobject NonEmptyStringList.typeobject Waitable.typeobject WaiterDelay.typeobject WaiterName.typeobject DataExamples.typeobject DefaultValue.typeobject Discriminated.typeobject UncheckedExamples.typeobject UrlFormName.typeShow all
- Self type
-
Newtype[A]
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 HttpBinding.typeobject DiscriminatedUnionMember.typeobject InputOutput.typetrait Enumeration[E]object Error.typeobject HttpApiKeyLocations.typeobject StructurallyExclusive.typeobject TimestampFormat.typeobject TraitChangeSeverity.typeobject TraitChangeType.typeobject AcceptorState.typeobject PathComparator.typeobject AddedDefault.typeobject AuthDefinition.typeobject Box.typeobject ClientOptional.typeobject Cors.typeobject Deprecated.typeobject Endpoint.typeobject EnumDefinition.typeobject EventHeader.typeobject EventPayload.typeobject Example.typeobject ExampleError.typeobject HostLabel.typeobject Http.typeobject HttpApiKeyAuth.typeobject HttpBasicAuth.typeobject HttpBearerAuth.typeobject HttpChecksumRequired.typeobject HttpDigestAuth.typeobject HttpLabel.typeobject HttpPayload.typeobject HttpQueryParams.typeobject HttpResponseCode.typeobject IdRef.typeobject IdempotencyToken.typeobject Idempotent.typeobject Input.typeobject Internal.typeobject Length.typeobject Mixin.typeobject NestedProperties.typeobject NoReplace.typeobject NotProperty.typeobject OptionalAuth.typeobject Output.typeobject Paginated.typeobject Private.typeobject Property.typeobject ProtocolDefinition.typeobject Range.typeobject Readonly.typeobject Recommended.typeobject Reference.typeobject RequestCompression.typeobject Required.typeobject RequiresLength.typeobject Retryable.typeobject Sensitive.typeobject Sparse.typeobject Streaming.typeobject Trait.typeobject TraitDiffRule.typeobject UniqueItems.typeobject Unit.typeobject UnitType.typeobject Unstable.typeobject XmlAttribute.typeobject XmlFlattened.typeobject XmlNamespace.typeobject Acceptor.typeobject Matcher.typeobject PathMatcher.typeobject Waiter.typeobject CountryCodeFormat.typeobject EmailFormat.typeobject HexColorCodeFormat.typeobject LanguageCodeFormat.typeobject LanguageTagFormat.typeobject DataExample.typeobject DateFormat.typeobject Nullable.typeobject OpenEnum.typeobject SimpleRestJson.typeobject StructurePattern.typeobject UncheckedExample.typeobject Untagged.typeobject UrlFormFlattened.typeobject UuidFormat.typeShow all
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
StreamingSchema.type
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