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

alloy.proto.ProtoReservedFields.scala Maven / Gradle / Ivy

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

import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.list
import smithy4s.schema.Schema.recursive

/** Marks certain field indexes as unusable by the smithy
  * specification. For example, if a range is provided of
  * 1 to 10 then the proto indexes for any fields in that
  * structure must fall outside of that range. Ranges
  * are inclusive.
  */
object ProtoReservedFields extends Newtype[List[ReservedFieldsDefinition]] {
  val id: ShapeId = ShapeId("alloy.proto", "protoReservedFields")
  val hints: Hints = Hints(
    smithy.api.Documentation("Marks certain field indexes as unusable by the smithy\nspecification. For example, if a range is provided of\n1 to 10 then the proto indexes for any fields in that\nstructure must fall outside of that range. Ranges\nare inclusive."),
    smithy.api.Trait(selector = Some("structure"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
  ).lazily
  val underlyingSchema: Schema[List[ReservedFieldsDefinition]] = list(ReservedFieldsDefinition.schema).withId(id).addHints(hints)
  implicit val schema: Schema[ProtoReservedFields] = recursive(bijection(underlyingSchema, asBijection))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy