io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.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: PROTO3
package io.envoyproxy.envoy.service.ext_proc.v3
/** Replace the entire message body chunk received in the corresponding
* HttpBody message with this new body, or clear the body.
*/
@SerialVersionUID(0L)
final case class BodyMutation(
mutation: io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Empty,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[BodyMutation] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
if (mutation.body.isDefined) {
val __value = mutation.body.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value)
};
if (mutation.clearBody.isDefined) {
val __value = mutation.clearBody.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(2, __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 = {
mutation.body.foreach { __v =>
val __m = __v
_output__.writeBytes(1, __m)
};
mutation.clearBody.foreach { __v =>
val __m = __v
_output__.writeBool(2, __m)
};
unknownFields.writeTo(_output__)
}
def getBody: _root_.com.google.protobuf.ByteString = mutation.body.getOrElse(_root_.com.google.protobuf.ByteString.EMPTY)
def withBody(__v: _root_.com.google.protobuf.ByteString): BodyMutation = copy(mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Body(__v))
def getClearBody: _root_.scala.Boolean = mutation.clearBody.getOrElse(false)
def withClearBody(__v: _root_.scala.Boolean): BodyMutation = copy(mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.ClearBody(__v))
def clearMutation: BodyMutation = copy(mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Empty)
def withMutation(__v: io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation): BodyMutation = copy(mutation = __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 => mutation.body.orNull
case 2 => mutation.clearBody.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 => mutation.body.map(_root_.scalapb.descriptors.PByteString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 2 => mutation.clearBody.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.envoy.service.ext_proc.v3.BodyMutation.type = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation
// @@protoc_insertion_point(GeneratedMessage[envoy.service.ext_proc.v3.BodyMutation])
}
object BodyMutation extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation = {
var __mutation: io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Empty
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 10 =>
__mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Body(_input__.readBytes())
case 16 =>
__mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.ClearBody(_input__.readBool())
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation(
mutation = __mutation,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation] = _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.envoy.service.ext_proc.v3.BodyMutation(
mutation = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.com.google.protobuf.ByteString]]).map(io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Body(_))
.orElse[io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]).map(io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.ClearBody(_)))
.getOrElse(io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ExternalProcessorProto.javaDescriptor.getMessageTypes().get(12)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ExternalProcessorProto.scalaDescriptor.messages(12)
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.envoy.service.ext_proc.v3.BodyMutation(
mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Empty
)
sealed trait Mutation extends _root_.scalapb.GeneratedOneof {
def isEmpty: _root_.scala.Boolean = false
def isDefined: _root_.scala.Boolean = true
def isBody: _root_.scala.Boolean = false
def isClearBody: _root_.scala.Boolean = false
def body: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = _root_.scala.None
def clearBody: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None
}
object Mutation {
@SerialVersionUID(0L)
case object Empty extends io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation {
type ValueType = _root_.scala.Nothing
override def isEmpty: _root_.scala.Boolean = true
override def isDefined: _root_.scala.Boolean = false
override def number: _root_.scala.Int = 0
override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
}
@SerialVersionUID(0L)
final case class Body(value: _root_.com.google.protobuf.ByteString) extends io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation {
type ValueType = _root_.com.google.protobuf.ByteString
override def isBody: _root_.scala.Boolean = true
override def body: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = Some(value)
override def number: _root_.scala.Int = 1
}
@SerialVersionUID(0L)
final case class ClearBody(value: _root_.scala.Boolean) extends io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation {
type ValueType = _root_.scala.Boolean
override def isClearBody: _root_.scala.Boolean = true
override def clearBody: _root_.scala.Option[_root_.scala.Boolean] = Some(value)
override def number: _root_.scala.Int = 2
}
}
implicit class BodyMutationLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation](_l) {
def body: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.getBody)((c_, f_) => c_.copy(mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.Body(f_)))
def clearBody: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getClearBody)((c_, f_) => c_.copy(mutation = io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation.ClearBody(f_)))
def mutation: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation] = field(_.mutation)((c_, f_) => c_.copy(mutation = f_))
}
final val BODY_FIELD_NUMBER = 1
final val CLEAR_BODY_FIELD_NUMBER = 2
def of(
mutation: io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation.Mutation
): _root_.io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation = _root_.io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation(
mutation
)
// @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.ext_proc.v3.BodyMutation])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy