EnumerationSchema

smithy4s.schema.Schema.EnumerationSchema
final case class EnumerationSchema[E](shapeId: ShapeId, hints: Hints, tag: EnumTag[E], values: List[EnumValue[E]], total: E => EnumValue[E]) extends Schema[E]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Schema[E]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

final def addHints(hints: Hints): Schema[E]

Attributes

Inherited from:
Schema
final def addHints(hints: Hint*): Schema[E]

Attributes

Inherited from:
Schema
final def addMemberHints(hints: Hints): Schema[E]

Attributes

Inherited from:
Schema
final def addMemberHints(hints: Hint*): Schema[E]

Attributes

Inherited from:
Schema
final def biject[B](to: E => B)(from: B => E): Schema[B]

Attributes

Inherited from:
Schema
final def biject[B](bijection: Bijection[E, B]): Schema[B]

Attributes

Inherited from:
Schema
final def compile[F[_]](fk: PolyFunction[Schema, F]): F[E]

Attributes

Inherited from:
Schema
final def error(unlift: E => Throwable)(lift: PartialFunction[Throwable, E]): ErrorSchema[E]

Turns this schema into an error schema.

Turns this schema into an error schema.

Attributes

Inherited from:
Schema
final def field[Struct]: PartiallyAppliedField[Struct, E]

Attributes

Inherited from:
Schema
final def findPayload(find: (Field[_, _]) => Boolean): SchemaPartition[E]

Finds the first field that matches the criteria used, and applies a bijection between the schema it holds and partial data, which ensures for the field's schema to be used as "top level" when decoding "payloads".

Finds the first field that matches the criteria used, and applies a bijection between the schema it holds and partial data, which ensures for the field's schema to be used as "top level" when decoding "payloads".

NB : a "payload" is typically a whole set of data, without a typical field-based splitting into subparts. This can be, for instance, an http body.

Attributes

Inherited from:
Schema
final def getDefault: Option[Document]

Attributes

Inherited from:
Schema
final def getDefaultValue: Option[E]

Attributes

Inherited from:
Schema
final def isOption: Boolean

Attributes

Inherited from:
Schema
final def isPrimitive[P](prim: Primitive[P]): Boolean

Finds whether a schema (or the underlying schema in the case of bijections/surjections, etc) is a primitive of a certain type.

Finds whether a schema (or the underlying schema in the case of bijections/surjections, etc) is a primitive of a certain type.

Attributes

Inherited from:
Schema
final def isUnit: Boolean

Checks whether a schema is Unit or an empty structure

Checks whether a schema is Unit or an empty structure

Attributes

Inherited from:
Schema
final def nullable: Schema[Nullable[E]]

Attributes

Inherited from:
Schema
final def oneOf[Union]: PartiallyAppliedOneOf[Union, E]

Attributes

Inherited from:
Schema
final def option: Schema[Option[E]]

Attributes

Inherited from:
Schema
final def optional[Struct]: PartiallyAppliedOptional[Struct, E]

Attributes

Inherited from:
Schema
final def partition(filter: (Field[_, _]) => Boolean): SchemaPartition[E]

When applied on a structure schema, creates a schema that, when compiled into a codec, will only encode/decode a subset of the data, based on the hints of each field.

When applied on a structure schema, creates a schema that, when compiled into a codec, will only encode/decode a subset of the data, based on the hints of each field.

This can be used to only encode some fields of the data into the http body

Returns a SchemaPartition that indicates whether :

  • no field match the condition
  • some fields match the condition
  • all fields match the condition

Attributes

Inherited from:
Schema
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def refined[B]: PartiallyAppliedRefinement[E, B]

Attributes

Inherited from:
Schema
final def required[Struct]: PartiallyAppliedRequired[Struct, E]

Attributes

Inherited from:
Schema
final def transformHintsLocally(f: Hints => Hints): Schema[E]

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema
final def validated[C](c: C)(implicit constraint: Simple[C, E]): Schema[E]

Attributes

Inherited from:
Schema
final def withId(namespace: String, name: String): Schema[E]

Attributes

Inherited from:
Schema
final def withId(newId: ShapeId): Schema[E]

Attributes

Inherited from:
Schema