io.envoyproxy.pgv.validate.TimestampRules.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of envoy-scala-control-plane_2.13 Show documentation
Show all versions of envoy-scala-control-plane_2.13 Show documentation
ScalaPB generated bindings for Envoy
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package io.envoyproxy.pgv.validate
/** TimestampRules describe the constraints applied exclusively to the
* `google.protobuf.Timestamp` well-known type
*
* @param required
* Required specifies that this field must be set
* @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 the specified value,
* inclusive
* @param gt
* Gt specifies that this field must be greater than the specified value,
* exclusive
* @param gte
* Gte specifies that this field must be greater than the specified value,
* inclusive
* @param ltNow
* LtNow specifies that this must be less than the current time. LtNow
* can only be used with the Within rule.
* @param gtNow
* GtNow specifies that this must be greater than the current time. GtNow
* can only be used with the Within rule.
* @param within
* Within specifies that this field must be within this duration of the
* current time. This constraint can be used alone or with the LtNow and
* GtNow rules.
*/
@SerialVersionUID(0L)
final case class TimestampRules(
required: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None,
const: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
lt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
lte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
gt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
gte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
ltNow: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None,
gtNow: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None,
within: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[TimestampRules] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
if (required.isDefined) {
val __value = required.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(1, __value)
};
if (const.isDefined) {
val __value = const.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (lt.isDefined) {
val __value = lt.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (lte.isDefined) {
val __value = lte.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (gt.isDefined) {
val __value = gt.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (gte.isDefined) {
val __value = gte.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (ltNow.isDefined) {
val __value = ltNow.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(7, __value)
};
if (gtNow.isDefined) {
val __value = gtNow.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(8, __value)
};
if (within.isDefined) {
val __value = within.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
__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 = {
required.foreach { __v =>
val __m = __v
_output__.writeBool(1, __m)
};
const.foreach { __v =>
val __m = __v
_output__.writeTag(2, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
lt.foreach { __v =>
val __m = __v
_output__.writeTag(3, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
lte.foreach { __v =>
val __m = __v
_output__.writeTag(4, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
gt.foreach { __v =>
val __m = __v
_output__.writeTag(5, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
gte.foreach { __v =>
val __m = __v
_output__.writeTag(6, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
ltNow.foreach { __v =>
val __m = __v
_output__.writeBool(7, __m)
};
gtNow.foreach { __v =>
val __m = __v
_output__.writeBool(8, __m)
};
within.foreach { __v =>
val __m = __v
_output__.writeTag(9, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def getRequired: _root_.scala.Boolean = required.getOrElse(false)
def clearRequired: TimestampRules = copy(required = _root_.scala.None)
def withRequired(__v: _root_.scala.Boolean): TimestampRules = copy(required = Option(__v))
def getConst: com.google.protobuf.timestamp.Timestamp = const.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearConst: TimestampRules = copy(const = _root_.scala.None)
def withConst(__v: com.google.protobuf.timestamp.Timestamp): TimestampRules = copy(const = Option(__v))
def getLt: com.google.protobuf.timestamp.Timestamp = lt.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearLt: TimestampRules = copy(lt = _root_.scala.None)
def withLt(__v: com.google.protobuf.timestamp.Timestamp): TimestampRules = copy(lt = Option(__v))
def getLte: com.google.protobuf.timestamp.Timestamp = lte.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearLte: TimestampRules = copy(lte = _root_.scala.None)
def withLte(__v: com.google.protobuf.timestamp.Timestamp): TimestampRules = copy(lte = Option(__v))
def getGt: com.google.protobuf.timestamp.Timestamp = gt.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearGt: TimestampRules = copy(gt = _root_.scala.None)
def withGt(__v: com.google.protobuf.timestamp.Timestamp): TimestampRules = copy(gt = Option(__v))
def getGte: com.google.protobuf.timestamp.Timestamp = gte.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
def clearGte: TimestampRules = copy(gte = _root_.scala.None)
def withGte(__v: com.google.protobuf.timestamp.Timestamp): TimestampRules = copy(gte = Option(__v))
def getLtNow: _root_.scala.Boolean = ltNow.getOrElse(false)
def clearLtNow: TimestampRules = copy(ltNow = _root_.scala.None)
def withLtNow(__v: _root_.scala.Boolean): TimestampRules = copy(ltNow = Option(__v))
def getGtNow: _root_.scala.Boolean = gtNow.getOrElse(false)
def clearGtNow: TimestampRules = copy(gtNow = _root_.scala.None)
def withGtNow(__v: _root_.scala.Boolean): TimestampRules = copy(gtNow = Option(__v))
def getWithin: com.google.protobuf.duration.Duration = within.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
def clearWithin: TimestampRules = copy(within = _root_.scala.None)
def withWithin(__v: com.google.protobuf.duration.Duration): TimestampRules = copy(within = 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 => required.orNull
case 2 => const.orNull
case 3 => lt.orNull
case 4 => lte.orNull
case 5 => gt.orNull
case 6 => gte.orNull
case 7 => ltNow.orNull
case 8 => gtNow.orNull
case 9 => within.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 => required.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 2 => const.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 3 => lt.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 4 => lte.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 5 => gt.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 6 => gte.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 7 => ltNow.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 8 => gtNow.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 9 => within.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: io.envoyproxy.pgv.validate.TimestampRules.type = io.envoyproxy.pgv.validate.TimestampRules
// @@protoc_insertion_point(GeneratedMessage[validate.TimestampRules])
}
object TimestampRules extends scalapb.GeneratedMessageCompanion[io.envoyproxy.pgv.validate.TimestampRules] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.pgv.validate.TimestampRules] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.pgv.validate.TimestampRules = {
var __required: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
var __const: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
var __lt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
var __lte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
var __gt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
var __gte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
var __ltNow: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
var __gtNow: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
var __within: _root_.scala.Option[com.google.protobuf.duration.Duration] = _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 =>
__required = Option(_input__.readBool())
case 18 =>
__const = Option(__const.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 26 =>
__lt = Option(__lt.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 34 =>
__lte = Option(__lte.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 42 =>
__gt = Option(__gt.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 50 =>
__gte = Option(__gte.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 56 =>
__ltNow = Option(_input__.readBool())
case 64 =>
__gtNow = Option(_input__.readBool())
case 74 =>
__within = Option(__within.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
io.envoyproxy.pgv.validate.TimestampRules(
required = __required,
const = __const,
lt = __lt,
lte = __lte,
gt = __gt,
gte = __gte,
ltNow = __ltNow,
gtNow = __gtNow,
within = __within,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.pgv.validate.TimestampRules] = _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.TimestampRules(
required = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]),
const = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
lt = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
lte = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
gt = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
gte = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
ltNow = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]),
gtNow = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]),
within = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]])
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ValidateProto.javaDescriptor.getMessageTypes().get(22)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ValidateProto.scalaDescriptor.messages(22)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 2 => __out = com.google.protobuf.timestamp.Timestamp
case 3 => __out = com.google.protobuf.timestamp.Timestamp
case 4 => __out = com.google.protobuf.timestamp.Timestamp
case 5 => __out = com.google.protobuf.timestamp.Timestamp
case 6 => __out = com.google.protobuf.timestamp.Timestamp
case 9 => __out = com.google.protobuf.duration.Duration
}
__out
}
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.TimestampRules(
required = _root_.scala.None,
const = _root_.scala.None,
lt = _root_.scala.None,
lte = _root_.scala.None,
gt = _root_.scala.None,
gte = _root_.scala.None,
ltNow = _root_.scala.None,
gtNow = _root_.scala.None,
within = _root_.scala.None
)
implicit class TimestampRulesLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.pgv.validate.TimestampRules]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.pgv.validate.TimestampRules](_l) {
def required: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getRequired)((c_, f_) => c_.copy(required = Option(f_)))
def optionalRequired: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Boolean]] = field(_.required)((c_, f_) => c_.copy(required = f_))
def const: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getConst)((c_, f_) => c_.copy(const = Option(f_)))
def optionalConst: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.const)((c_, f_) => c_.copy(const = f_))
def lt: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getLt)((c_, f_) => c_.copy(lt = Option(f_)))
def optionalLt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.lt)((c_, f_) => c_.copy(lt = f_))
def lte: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getLte)((c_, f_) => c_.copy(lte = Option(f_)))
def optionalLte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.lte)((c_, f_) => c_.copy(lte = f_))
def gt: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getGt)((c_, f_) => c_.copy(gt = Option(f_)))
def optionalGt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.gt)((c_, f_) => c_.copy(gt = f_))
def gte: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getGte)((c_, f_) => c_.copy(gte = Option(f_)))
def optionalGte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.gte)((c_, f_) => c_.copy(gte = f_))
def ltNow: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getLtNow)((c_, f_) => c_.copy(ltNow = Option(f_)))
def optionalLtNow: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Boolean]] = field(_.ltNow)((c_, f_) => c_.copy(ltNow = f_))
def gtNow: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getGtNow)((c_, f_) => c_.copy(gtNow = Option(f_)))
def optionalGtNow: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Boolean]] = field(_.gtNow)((c_, f_) => c_.copy(gtNow = f_))
def within: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getWithin)((c_, f_) => c_.copy(within = Option(f_)))
def optionalWithin: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.within)((c_, f_) => c_.copy(within = f_))
}
final val REQUIRED_FIELD_NUMBER = 1
final val CONST_FIELD_NUMBER = 2
final val LT_FIELD_NUMBER = 3
final val LTE_FIELD_NUMBER = 4
final val GT_FIELD_NUMBER = 5
final val GTE_FIELD_NUMBER = 6
final val LT_NOW_FIELD_NUMBER = 7
final val GT_NOW_FIELD_NUMBER = 8
final val WITHIN_FIELD_NUMBER = 9
def of(
required: _root_.scala.Option[_root_.scala.Boolean],
const: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
lt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
lte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
gt: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
gte: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
ltNow: _root_.scala.Option[_root_.scala.Boolean],
gtNow: _root_.scala.Option[_root_.scala.Boolean],
within: _root_.scala.Option[com.google.protobuf.duration.Duration]
): _root_.io.envoyproxy.pgv.validate.TimestampRules = _root_.io.envoyproxy.pgv.validate.TimestampRules(
required,
const,
lt,
lte,
gt,
gte,
ltNow,
gtNow,
within
)
// @@protoc_insertion_point(GeneratedMessageCompanion[validate.TimestampRules])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy