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

alloy.common.CountryCodeFormat.scala Maven / Gradle / Ivy

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

import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.constant

/** ISO 3166-1 Alpha-2 country code
  * Full list in https://www.iso.org/obp/ui/#search/code/
  * example: "AF", "US"
  */
final case class CountryCodeFormat()

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

  val hints: Hints = Hints(
    smithy.api.Documentation("ISO 3166-1 Alpha-2 country code\nFull list in https://www.iso.org/obp/ui/#search/code/\nexample: \"AF\", \"US\""),
    smithy.api.Trait(selector = Some(":test(string, member > string)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
  ).lazily


  implicit val schema: Schema[CountryCodeFormat] = constant(CountryCodeFormat()).withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy