All Downloads are FREE. Search and download functionalities are using the official Maven repository.

alloy.UncheckedExample.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0-41-91762fb
Show newest version
package alloy

import smithy4s.Document
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.document
import smithy4s.schema.Schema.string
import smithy4s.schema.Schema.struct

final case class UncheckedExample(title: String, documentation: Option[String] = None, input: Option[Document] = None, output: Option[Document] = None)

object UncheckedExample extends ShapeTag.Companion[UncheckedExample] {
  val id: ShapeId = ShapeId("alloy", "UncheckedExample")

  val hints: Hints = Hints(
    smithy.api.Private(),
  ).lazily

  // constructor using the original order from the spec
  private def make(title: String, documentation: Option[String], input: Option[Document], output: Option[Document]): UncheckedExample = UncheckedExample(title, documentation, input, output)

  implicit val schema: Schema[UncheckedExample] = struct(
    string.required[UncheckedExample]("title", _.title),
    string.optional[UncheckedExample]("documentation", _.documentation),
    document.optional[UncheckedExample]("input", _.input),
    document.optional[UncheckedExample]("output", _.output),
  )(make).withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy