smithy4s

package smithy4s

Type members

Classlikes

class ByteArray(val array: Array[Byte])
Companion:
object
object ByteArray
Companion:
class
final case class ConstraintError(hint: Hint, message: String) extends Throwable with NoStackTrace
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.

Companion:
object
object Document
Companion:
class
trait Endpoint[Op[_, _, _, _, _], I, E, O, SI, SO]

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 greatt many libraries)

trait Enumeration[E <: Value] extends Companion[E]
Companion:
object
Companion:
class
trait Errorable[E]
trait HasId
sealed abstract class HintMask
Companion:
object
object HintMask
Companion:
class
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.

Companion:
object
object Hints
Companion:
class
object Kind5
final class Lazy[A](make: () => A)
Companion:
object
object Lazy
Companion:
class
abstract class Newtype[A] extends HasId
case class PayloadPath(segments: List[Segment])
Companion:
object
Companion:
class
trait PolyFunction[F[_], G[_]]

Natural transformation, turning a polymorphic type into another, whilst keeping the type parameter intact.

Natural transformation, turning a polymorphic type into another, whilst keeping the type parameter intact.

trait Protocol[A]
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.

Companion:
object
object Refinement
Companion:
class
trait Service[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]] extends Transformable[Alg] with Provider[Alg, Op]

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 (natural transformations) 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.

Companion:
object
object Service
Companion:
class
final case class ShapeId(namespace: String, name: String) extends HasId
Companion:
object
object ShapeId extends Has[ShapeId]
Companion:
class
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

Companion:
object
object ShapeTag
Companion:
class
sealed trait StreamingSchema[A]
Companion:
object
Companion:
class
case class Timestamp
Companion:
object
object Timestamp
Companion:
class
trait Transformable[Alg[_[_, _, _, _, _]]]

Allows to transform the effect an algebra works against.

Allows to transform the effect an algebra works against.

trait Transformation[F[_, _, _, _, _], G[_, _, _, _, _]]

Natural transformation allowing to change the outer type that final interfaces work against.

Natural transformation allowing to change the outer type that final interfaces work against.

Companion:
object
Companion:
class
final case class UnsupportedProtocolError(service: HasId, protocolTag: HasId) extends Throwable
trait Validator[C, A, B]

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

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

A Validator can be used as a typeclass.

Companion:
object
object Validator
Companion:
class

Types

type Existential[+F[_]]
type GenLift[F[_]] = { type λ = [I, E, O, SI, SO] =>> F[O]; }
type Hint = Binding
type Schema[A] = Schema[A]
type Schematic[F[_]] = Schematic[F]
type Wrapped[F[_], G[_], A] = F[G[A]]
type ~>[F[_], G[_]] = PolyFunction[F, G]

Inherited types

type Interpreter[Op[_, _, _, _, _], F[_]] = Transformation[Op, [I, E, O, SI, SO] =>> F[O]]
Inherited from:
TypeAliases
type Monadic[Alg[_[_, _, _, _, _]], F[_]] = Alg[[I, E, O, SI, SO] =>> F[O]]
Inherited from:
TypeAliases

Value members

Concrete methods

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

Concrete fields

val Schema: Schema.type
val errorTypeHeader: String