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

io.envoyproxy.pgv.validate.UInt32Rules.scala Maven / Gradle / Ivy

There is a newer version: 1.23.0-dev-f04150-1
Show newest version
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2

package io.envoyproxy.pgv.validate

/** UInt32Rules describes the constraints applied to `uint32` values
  *
  * @param const
  *   Const specifies that this field must be exactly the specified value
  * @param lt
  *   Lt specifies that this field must be less than the specified value,
  *   exclusive
  * @param lte
  *   Lte specifies that this field must be less than or equal to the
  *   specified value, inclusive
  * @param gt
  *   Gt specifies that this field must be greater than the specified value,
  *   exclusive. If the value of Gt is larger than a specified Lt or Lte, the
  *   range is reversed.
  * @param gte
  *   Gte specifies that this field must be greater than or equal to the
  *   specified value, inclusive. If the value of Gte is larger than a
  *   specified Lt or Lte, the range is reversed.
  * @param in
  *   In specifies that this field must be equal to one of the specified
  *   values
  * @param notIn
  *   NotIn specifies that this field cannot be equal to one of the specified
  *   values
  * @param ignoreEmpty
  *   IgnoreEmpty specifies that the validation rules of this field should be
  *   evaluated only if the field is not empty
  */
@SerialVersionUID(0L)
final case class UInt32Rules(
    const: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    lt: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    lte: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    gt: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    gte: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    in: _root_.scala.Seq[_root_.scala.Int] = _root_.scala.Seq.empty,
    notIn: _root_.scala.Seq[_root_.scala.Int] = _root_.scala.Seq.empty,
    ignoreEmpty: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[UInt32Rules] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (const.isDefined) {
        val __value = const.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(1, __value)
      };
      if (lt.isDefined) {
        val __value = lt.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(2, __value)
      };
      if (lte.isDefined) {
        val __value = lte.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(3, __value)
      };
      if (gt.isDefined) {
        val __value = gt.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(4, __value)
      };
      if (gte.isDefined) {
        val __value = gte.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(5, __value)
      };
      in.foreach { __item =>
        val __value = __item
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(6, __value)
      }
      notIn.foreach { __item =>
        val __value = __item
        __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(7, __value)
      }
      if (ignoreEmpty.isDefined) {
        val __value = ignoreEmpty.get
        __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(8, __value)
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      const.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(1, __m)
      };
      lt.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(2, __m)
      };
      lte.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(3, __m)
      };
      gt.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(4, __m)
      };
      gte.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(5, __m)
      };
      in.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(6, __m)
      };
      notIn.foreach { __v =>
        val __m = __v
        _output__.writeUInt32(7, __m)
      };
      ignoreEmpty.foreach { __v =>
        val __m = __v
        _output__.writeBool(8, __m)
      };
      unknownFields.writeTo(_output__)
    }
    def getConst: _root_.scala.Int = const.getOrElse(0)
    def clearConst: UInt32Rules = copy(const = _root_.scala.None)
    def withConst(__v: _root_.scala.Int): UInt32Rules = copy(const = Option(__v))
    def getLt: _root_.scala.Int = lt.getOrElse(0)
    def clearLt: UInt32Rules = copy(lt = _root_.scala.None)
    def withLt(__v: _root_.scala.Int): UInt32Rules = copy(lt = Option(__v))
    def getLte: _root_.scala.Int = lte.getOrElse(0)
    def clearLte: UInt32Rules = copy(lte = _root_.scala.None)
    def withLte(__v: _root_.scala.Int): UInt32Rules = copy(lte = Option(__v))
    def getGt: _root_.scala.Int = gt.getOrElse(0)
    def clearGt: UInt32Rules = copy(gt = _root_.scala.None)
    def withGt(__v: _root_.scala.Int): UInt32Rules = copy(gt = Option(__v))
    def getGte: _root_.scala.Int = gte.getOrElse(0)
    def clearGte: UInt32Rules = copy(gte = _root_.scala.None)
    def withGte(__v: _root_.scala.Int): UInt32Rules = copy(gte = Option(__v))
    def clearIn = copy(in = _root_.scala.Seq.empty)
    def addIn(__vs: _root_.scala.Int *): UInt32Rules = addAllIn(__vs)
    def addAllIn(__vs: Iterable[_root_.scala.Int]): UInt32Rules = copy(in = in ++ __vs)
    def withIn(__v: _root_.scala.Seq[_root_.scala.Int]): UInt32Rules = copy(in = __v)
    def clearNotIn = copy(notIn = _root_.scala.Seq.empty)
    def addNotIn(__vs: _root_.scala.Int *): UInt32Rules = addAllNotIn(__vs)
    def addAllNotIn(__vs: Iterable[_root_.scala.Int]): UInt32Rules = copy(notIn = notIn ++ __vs)
    def withNotIn(__v: _root_.scala.Seq[_root_.scala.Int]): UInt32Rules = copy(notIn = __v)
    def getIgnoreEmpty: _root_.scala.Boolean = ignoreEmpty.getOrElse(false)
    def clearIgnoreEmpty: UInt32Rules = copy(ignoreEmpty = _root_.scala.None)
    def withIgnoreEmpty(__v: _root_.scala.Boolean): UInt32Rules = copy(ignoreEmpty = Option(__v))
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => const.orNull
        case 2 => lt.orNull
        case 3 => lte.orNull
        case 4 => gt.orNull
        case 5 => gte.orNull
        case 6 => in
        case 7 => notIn
        case 8 => ignoreEmpty.orNull
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => const.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => lt.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => lte.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => gt.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 5 => gte.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 6 => _root_.scalapb.descriptors.PRepeated(in.iterator.map(_root_.scalapb.descriptors.PInt(_)).toVector)
        case 7 => _root_.scalapb.descriptors.PRepeated(notIn.iterator.map(_root_.scalapb.descriptors.PInt(_)).toVector)
        case 8 => ignoreEmpty.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.pgv.validate.UInt32Rules.type = io.envoyproxy.pgv.validate.UInt32Rules
    // @@protoc_insertion_point(GeneratedMessage[validate.UInt32Rules])
}

object UInt32Rules extends scalapb.GeneratedMessageCompanion[io.envoyproxy.pgv.validate.UInt32Rules] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.pgv.validate.UInt32Rules] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.pgv.validate.UInt32Rules = {
    var __const: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __lt: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __lte: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __gt: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __gte: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    val __in: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int]
    val __notIn: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int]
    var __ignoreEmpty: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __const = Option(_input__.readUInt32())
        case 16 =>
          __lt = Option(_input__.readUInt32())
        case 24 =>
          __lte = Option(_input__.readUInt32())
        case 32 =>
          __gt = Option(_input__.readUInt32())
        case 40 =>
          __gte = Option(_input__.readUInt32())
        case 48 =>
          __in += _input__.readUInt32()
        case 50 => {
          val length = _input__.readRawVarint32()
          val oldLimit = _input__.pushLimit(length)
          while (_input__.getBytesUntilLimit > 0) {
            __in += _input__.readUInt32()
          }
          _input__.popLimit(oldLimit)
        }
        case 56 =>
          __notIn += _input__.readUInt32()
        case 58 => {
          val length = _input__.readRawVarint32()
          val oldLimit = _input__.pushLimit(length)
          while (_input__.getBytesUntilLimit > 0) {
            __notIn += _input__.readUInt32()
          }
          _input__.popLimit(oldLimit)
        }
        case 64 =>
          __ignoreEmpty = Option(_input__.readBool())
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.pgv.validate.UInt32Rules(
        const = __const,
        lt = __lt,
        lte = __lte,
        gt = __gt,
        gte = __gte,
        in = __in.result(),
        notIn = __notIn.result(),
        ignoreEmpty = __ignoreEmpty,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.pgv.validate.UInt32Rules] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      io.envoyproxy.pgv.validate.UInt32Rules(
        const = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]),
        lt = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]),
        lte = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]),
        gt = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]),
        gte = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]),
        in = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Seq[_root_.scala.Int]]).getOrElse(_root_.scala.Seq.empty),
        notIn = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Seq[_root_.scala.Int]]).getOrElse(_root_.scala.Seq.empty),
        ignoreEmpty = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]])
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ValidateProto.javaDescriptor.getMessageTypes().get(5)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ValidateProto.scalaDescriptor.messages(5)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = io.envoyproxy.pgv.validate.UInt32Rules(
    const = _root_.scala.None,
    lt = _root_.scala.None,
    lte = _root_.scala.None,
    gt = _root_.scala.None,
    gte = _root_.scala.None,
    in = _root_.scala.Seq.empty,
    notIn = _root_.scala.Seq.empty,
    ignoreEmpty = _root_.scala.None
  )
  implicit class UInt32RulesLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.pgv.validate.UInt32Rules]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.pgv.validate.UInt32Rules](_l) {
    def const: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getConst)((c_, f_) => c_.copy(const = Option(f_)))
    def optionalConst: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.const)((c_, f_) => c_.copy(const = f_))
    def lt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getLt)((c_, f_) => c_.copy(lt = Option(f_)))
    def optionalLt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.lt)((c_, f_) => c_.copy(lt = f_))
    def lte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getLte)((c_, f_) => c_.copy(lte = Option(f_)))
    def optionalLte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.lte)((c_, f_) => c_.copy(lte = f_))
    def gt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getGt)((c_, f_) => c_.copy(gt = Option(f_)))
    def optionalGt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.gt)((c_, f_) => c_.copy(gt = f_))
    def gte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getGte)((c_, f_) => c_.copy(gte = Option(f_)))
    def optionalGte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.gte)((c_, f_) => c_.copy(gte = f_))
    def in: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Int]] = field(_.in)((c_, f_) => c_.copy(in = f_))
    def notIn: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Int]] = field(_.notIn)((c_, f_) => c_.copy(notIn = f_))
    def ignoreEmpty: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getIgnoreEmpty)((c_, f_) => c_.copy(ignoreEmpty = Option(f_)))
    def optionalIgnoreEmpty: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Boolean]] = field(_.ignoreEmpty)((c_, f_) => c_.copy(ignoreEmpty = f_))
  }
  final val CONST_FIELD_NUMBER = 1
  final val LT_FIELD_NUMBER = 2
  final val LTE_FIELD_NUMBER = 3
  final val GT_FIELD_NUMBER = 4
  final val GTE_FIELD_NUMBER = 5
  final val IN_FIELD_NUMBER = 6
  final val NOT_IN_FIELD_NUMBER = 7
  final val IGNORE_EMPTY_FIELD_NUMBER = 8
  def of(
    const: _root_.scala.Option[_root_.scala.Int],
    lt: _root_.scala.Option[_root_.scala.Int],
    lte: _root_.scala.Option[_root_.scala.Int],
    gt: _root_.scala.Option[_root_.scala.Int],
    gte: _root_.scala.Option[_root_.scala.Int],
    in: _root_.scala.Seq[_root_.scala.Int],
    notIn: _root_.scala.Seq[_root_.scala.Int],
    ignoreEmpty: _root_.scala.Option[_root_.scala.Boolean]
  ): _root_.io.envoyproxy.pgv.validate.UInt32Rules = _root_.io.envoyproxy.pgv.validate.UInt32Rules(
    const,
    lt,
    lte,
    gt,
    gte,
    in,
    notIn,
    ignoreEmpty
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[validate.UInt32Rules])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy