p

alloy

package alloy

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. alloy
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package common

Type Members

  1. sealed trait DataExample extends Product with Serializable
  2. type DataExamples = alloy.DataExamples.Type

    A trait for specifying what example data looks like.

    A trait for specifying what example data looks like. Differs from the smithy.api#examples trait in that it can be used for any shape, not just operations. Below is an explanation of the different example formats that are supported. 1. SMITHY - this means that the examples will be using the Document abstraction and will be specified in a protocol agnostic way 2. JSON - this means the examples will use the Document abstraction, but will not be validated by the smithy NodeValidationVisitor like the first type are. This type can be used to specify protocol specific examples 3. STRING - this is just a string example and anything can be provided inside of the string. This can be helpful for showing e.g. xml or another encoding that isn't JSON and therefore doesn't fit nicely with Node semantics

  3. final case class DateFormat() extends Product with Serializable

    This trait indicates that a String value contains a date without a time component.

    This trait indicates that a String value contains a date without a time component. Following the RFC-3339 (an extension of ISO 8601), the default for a date is the following: date-fullyear = 4DIGIT date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on ; month/year full-date = date-fullyear "-" date-month "-" date-mday

    See: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 e.g.: "2022-03-30" If a time component is required, you can use smithy.api#Timestamp

  4. type DefaultValue = alloy.DefaultValue.Type

    Use this trait to give a default value to a structure member.

    Use this trait to give a default value to a structure member. This is not the same as smithy.api#default which is more constrained. You can use defaultValue to specify a default that does not align with the target's shape constraints, where as Smithy's default trait prevents that. For example:

    smithy @length(min:5) string MyString structure MyStruct { @defaultValue("N/A") // that's valid s1: MyString s2: MyString = "N/A" // that's invalid }

  5. type Discriminated = alloy.Discriminated.Type

    Discriminated unions contain the information about which branch of a union is encoded inside of the object itself.

    Discriminated unions contain the information about which branch of a union is encoded inside of the object itself. The following union: structure One { a: Int } structure Two { b: String } union Test { one: One two: Two } would normally be encoded in JSON as: { "one": { "a": 123 } } when annotated with @discriminated("type"), it will instead be encoded as: { "a": 123, "type": "one" } This is more efficient than using an untagged encoding, but less efficient than using the default tagged union encoding. Therefore, it should only be used when necessary. Tagged union encodings should be used wherever possible.

  6. final case class Nullable() extends Product with Serializable

    Use this trait to mark some field as nullable.

    Use this trait to mark some field as nullable. This is to make a distinction between an optional field that is missing and one that's explicitly set to null.

  7. final case class OpenEnum() extends Product with Serializable

    Specifies that an enumeration is open meaning that it can accept "unknown" values that are not explicitly specified inside of the smithy enum shape definition.

  8. final case class SimpleRestJson() extends Product with Serializable

    A rest protocol that deals with JSON payloads only in HTTP requests and responses.

    A rest protocol that deals with JSON payloads only in HTTP requests and responses. These are encoded with the content type application/json. See Alloy documentation for more information.

  9. final case class StructurePattern(pattern: String, target: ShapeId) extends Product with Serializable
  10. final case class UncheckedExample(title: String, documentation: Option[String] = None, input: Option[Document] = None, output: Option[Document] = None) extends Product with Serializable
  11. type UncheckedExamples = alloy.UncheckedExamples.Type

    A version of @examples that is not tied to a validator

  12. final case class Untagged() extends Product with Serializable

    Implies a different encoding for unions where different alternatives are not tagged.

    Implies a different encoding for unions where different alternatives are not tagged. This union type should be avoided whenever possible for performance reasons. However, some third party APIs use it so it is important to be able to represent it. The following union: structure One { a: Int } structure Two { b: String } union Test { one: One two: Two } would normally be encoded in JSON as { "one": { "a": 123 } } When it is annotated with @untagged, it is instead encoded as: { "a": 123 }. Therefore the parser will need to try each different alternative in the union before it can determine which one is appropriate.

  13. final case class UrlFormFlattened() extends Product with Serializable

    Unwraps the values of a list, set, or map into the containing structure/union.

  14. type UrlFormName = alloy.UrlFormName.Type

    Changes the serialized key of a structure, union, or member.

  15. final case class UuidFormat() extends Product with Serializable

    UUID v4 compliant with [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122)

Value Members

  1. object DataExample extends Companion[DataExample] with Serializable
  2. object DataExamples extends Newtype[List[DataExample]]

    A trait for specifying what example data looks like.

    A trait for specifying what example data looks like. Differs from the smithy.api#examples trait in that it can be used for any shape, not just operations. Below is an explanation of the different example formats that are supported. 1. SMITHY - this means that the examples will be using the Document abstraction and will be specified in a protocol agnostic way 2. JSON - this means the examples will use the Document abstraction, but will not be validated by the smithy NodeValidationVisitor like the first type are. This type can be used to specify protocol specific examples 3. STRING - this is just a string example and anything can be provided inside of the string. This can be helpful for showing e.g. xml or another encoding that isn't JSON and therefore doesn't fit nicely with Node semantics

  3. object DateFormat extends Companion[DateFormat] with Serializable
  4. object DefaultValue extends Newtype[Document]

    Use this trait to give a default value to a structure member.

    Use this trait to give a default value to a structure member. This is not the same as smithy.api#default which is more constrained. You can use defaultValue to specify a default that does not align with the target's shape constraints, where as Smithy's default trait prevents that. For example:

    smithy @length(min:5) string MyString structure MyStruct { @defaultValue("N/A") // that's valid s1: MyString s2: MyString = "N/A" // that's invalid }

  5. object Discriminated extends Newtype[String]

    Discriminated unions contain the information about which branch of a union is encoded inside of the object itself.

    Discriminated unions contain the information about which branch of a union is encoded inside of the object itself. The following union: structure One { a: Int } structure Two { b: String } union Test { one: One two: Two } would normally be encoded in JSON as: { "one": { "a": 123 } } when annotated with @discriminated("type"), it will instead be encoded as: { "a": 123, "type": "one" } This is more efficient than using an untagged encoding, but less efficient than using the default tagged union encoding. Therefore, it should only be used when necessary. Tagged union encodings should be used wherever possible.

  6. object Nullable extends Companion[Nullable] with Serializable
  7. object OpenEnum extends Companion[OpenEnum] with Serializable
  8. object SimpleRestJson extends Companion[SimpleRestJson] with Serializable
  9. object StructurePattern extends Companion[StructurePattern] with Serializable
  10. object UncheckedExample extends Companion[UncheckedExample] with Serializable
  11. object UncheckedExamples extends Newtype[List[UncheckedExample]]

    A version of @examples that is not tied to a validator

  12. object Untagged extends Companion[Untagged] with Serializable
  13. object UrlFormFlattened extends Companion[UrlFormFlattened] with Serializable
  14. object UrlFormName extends Newtype[String]

    Changes the serialized key of a structure, union, or member.

  15. object UuidFormat extends Companion[UuidFormat] with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped