alloy.proto.ProtoTimestampFormat.scala Maven / Gradle / Ivy
package alloy.proto
import smithy4s.Enumeration
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.EnumTag
import smithy4s.schema.Schema.enumeration
/** Specifies which type of timestamp representation should be used
* PROTOBUF indicates that the default encoding should be used
* EPOCH_MILLIS indicates that an int64 should be used instead of the
* default encoding.
*/
sealed abstract class ProtoTimestampFormat(_value: String, _name: String, _intValue: Int, _hints: Hints) extends Enumeration.Value {
override type EnumType = ProtoTimestampFormat
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] = ProtoTimestampFormat
@inline final def widen: ProtoTimestampFormat = this
}
object ProtoTimestampFormat extends Enumeration[ProtoTimestampFormat] with ShapeTag.Companion[ProtoTimestampFormat] {
val id: ShapeId = ShapeId("alloy.proto", "protoTimestampFormat")
val hints: Hints = Hints(
smithy.api.Documentation("Specifies which type of timestamp representation should be used\nPROTOBUF indicates that the default encoding should be used\nEPOCH_MILLIS indicates that an int64 should be used instead of the\ndefault encoding."),
smithy.api.Trait(selector = Some(":test(timestamp, member > timestamp)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
).lazily
case object PROTOBUF extends ProtoTimestampFormat("PROTOBUF", "PROTOBUF", 0, Hints.empty)
case object EPOCH_MILLIS extends ProtoTimestampFormat("EPOCH_MILLIS", "EPOCH_MILLIS", 1, Hints.empty)
val values: List[ProtoTimestampFormat] = List(
PROTOBUF,
EPOCH_MILLIS,
)
val tag: EnumTag[ProtoTimestampFormat] = EnumTag.ClosedStringEnum
implicit val schema: Schema[ProtoTimestampFormat] = enumeration(tag, values).withId(id).addHints(hints)
}