smithy4s

package smithy4s

Type members

Classlikes

Companion
object
Companion
class
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 Params
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] extends Companion[E]
trait Errorable[E]
trait HasId
trait Hints

A hing is an arbitrary piece of data that can be added to a schema, at the struct level, or at the field/member level.

A hing 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
abstract
class Newtype[A] extends HasId
case
class PayloadPath(segments: List[Segment])
Companion
object
Companion
class
trait Schematic[F[_]] extends Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F] with Schematic[F]
object SchematicRepr extends Schematic[Repr] with SchematicRepr
trait Service[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]] extends Transformable[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 (natural transformations) that operate on initially-encoded GADTs.

Type Params
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.

object Static
sealed
Companion
object
Companion
class
trait StubSchematic[F[_]] extends Schematic[F] with StubSchematic[F]
abstract

Platform-agnostic UTC timestamp representation.

Platform-agnostic UTC timestamp representation.

The schematic.TimePlatformCompat trait provides a "nowUTC" method to get the current time.

Companion
object
object Timestamp extends TimePlatformCompat

The smithy4s.TimePlatformCompat contains all the platform-specific code that has to do with retrieving time from the system, and is provided for the hree platforms (jvm/js/native.)

The smithy4s.TimePlatformCompat contains all the platform-specific code that has to do with retrieving time from the system, and is provided for the hree platforms (jvm/js/native.)

Companion
class

Trait that is meant to be implemented in platform-specific ways, abstracing over logic that has to do with retrieving time from the system.

Trait that is meant to be implemented in platform-specific ways, abstracing over logic that has to do with retrieving time from the system.

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
case
class UnknownErrorResponse(code: Int, headers: Map[String, String], body: String) extends Throwable
final case
class UnsupportedProtocolError(service: HasId, protocolKey: HasId) extends Throwable
object errorUnion

Types

type GenLift[F[_]] = { type λ = [I, E, O, SI, SO] =>> F[O]; }
type Hint = Binding[_]
type Id[A] = A
type Interpreter[Op[_, _, _, _, _], F[_]] = Transformation[Op, <none>]
type Schema[A] = Schema[[F[_]] =>> Schematic[F], A]
type Static[A] = Static[A]
type StaticSchema[A] = Static[Schema[A]]
type UnionSchema[A] = Schema[UnionSchematic, A]
type UnionSchematic[F[_]] = Schematic[F]

Value members

Concrete methods

def checkProtocol[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]](service: Service[Alg, Op], protocolKey: Key[_]): Either[UnsupportedProtocolError, Unit]
def greedySegment(s: String): String
def segment(s: Any): String

Concrete fields

val errorTypeHeader: String