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

alloy.proto.Range.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.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.int
import smithy4s.schema.Schema.struct

final case class Range(start: Int, end: Int)

object Range extends ShapeTag.Companion[Range] {
  val id: ShapeId = ShapeId("alloy.proto", "Range")

  val hints: Hints = Hints.empty

  // constructor using the original order from the spec
  private def make(start: Int, end: Int): Range = Range(start, end)

  implicit val schema: Schema[Range] = struct(
    int.required[Range]("start", _.start),
    int.required[Range]("end", _.end),
  )(make).withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy