alloy.DateFormat.scala Maven / Gradle / Ivy
package alloy
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.constant
/** 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
*/
final case class DateFormat()
object DateFormat extends ShapeTag.Companion[DateFormat] {
val id: ShapeId = ShapeId("alloy", "dateFormat")
val hints: Hints = Hints(
smithy.api.Documentation("This trait indicates that a String value contains a date without\na time component. Following the RFC-3339 (an extension of ISO 8601),\nthe default for a date is the following:\ndate-fullyear = 4DIGIT\ndate-month = 2DIGIT ; 01-12\ndate-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on\n ; month/year\nfull-date = date-fullyear \"-\" date-month \"-\" date-mday\n\nSee: https://www.rfc-editor.org/rfc/rfc3339#section-5.6\ne.g.: \"2022-03-30\"\nIf a time component is required, you can use smithy.api#Timestamp"),
smithy.api.Trait(selector = Some(":test(string, member > string)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
).lazily
implicit val schema: Schema[DateFormat] = constant(DateFormat()).withId(id).addHints(hints)
}