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

smithy.api.StructurallyExclusive.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0-41-91762fb
Show newest version
package smithy.api

import smithy4s.Enumeration
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.EnumTag
import smithy4s.schema.Schema.enumeration

/** @param MEMBER
  *   Only a single member of a shape can be marked with the trait.
  * @param TARGET
  *   Only a single member of a shape can target a shape marked with
  *   this trait.
  */
sealed abstract class StructurallyExclusive(_value: String, _name: String, _intValue: Int, _hints: Hints) extends Enumeration.Value {
  override type EnumType = StructurallyExclusive
  override val value: String = _value
  override val name: String = _name
  override val intValue: Int = _intValue
  override val hints: Hints = _hints
  override def enumeration: Enumeration[EnumType] = StructurallyExclusive
  @inline final def widen: StructurallyExclusive = this
}
object StructurallyExclusive extends Enumeration[StructurallyExclusive] with ShapeTag.Companion[StructurallyExclusive] {
  val id: ShapeId = ShapeId("smithy.api", "StructurallyExclusive")

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

  /** Only a single member of a shape can be marked with the trait. */
  case object MEMBER extends StructurallyExclusive("member", "MEMBER", 0, Hints.empty) {
    override val hints: Hints = Hints(smithy.api.Documentation("Only a single member of a shape can be marked with the trait.")).lazily
  }
  /** Only a single member of a shape can target a shape marked with
    * this trait.
    */
  case object TARGET extends StructurallyExclusive("target", "TARGET", 1, Hints.empty) {
    override val hints: Hints = Hints(smithy.api.Documentation("Only a single member of a shape can target a shape marked with\nthis trait.")).lazily
  }

  val values: List[StructurallyExclusive] = List(
    MEMBER,
    TARGET,
  )
  val tag: EnumTag[StructurallyExclusive] = EnumTag.ClosedStringEnum
  implicit val schema: Schema[StructurallyExclusive] = enumeration(tag, values).withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy