smithy.api.EnumConstantBodyName.scala Maven / Gradle / Ivy
package smithy.api
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.string
/** The optional name or label of the enum constant value.
*
* This property is used in code generation to provide a label for
* each enum value. No two enums can have the same 'name' value.
*/
object EnumConstantBodyName extends Newtype[String] {
val id: ShapeId = ShapeId("smithy.api", "EnumConstantBodyName")
val hints: Hints = Hints(
smithy.api.Documentation("The optional name or label of the enum constant value.\n\nThis property is used in code generation to provide a label for\neach enum value. No two enums can have the same \'name\' value."),
smithy.api.Private(),
).lazily
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints).validated(smithy.api.Pattern(s"^[a-zA-Z_]+[a-zA-Z_0-9]*$$"))
implicit val schema: Schema[EnumConstantBodyName] = bijection(underlyingSchema, asBijection)
}