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

io.envoyproxy.envoy.service.tap.v2alpha.TapConfig.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: PROTO3

package io.envoyproxy.envoy.service.tap.v2alpha

/** Tap configuration.
  * [#comment:TODO(mattklein123): Rate limiting]
  *
  * @param matchConfig
  *   The match configuration. If the configuration matches the data source being tapped, a tap will
  *   occur, with the result written to the configured output.
  * @param outputConfig
  *   The tap output configuration. If a match configuration matches a data source being tapped,
  *   a tap will occur and the data will be written to the configured output.
  * @param tapEnabled
  *   [#not-implemented-hide:] Specify if Tap matching is enabled. The % of requests&92;connections for
  *   which the tap matching is enabled. When not enabled, the request&92;connection will not be
  *   recorded.
  *  
  *   .. note::
  *  
  *     This field defaults to 100/:ref:`HUNDRED
  *     <envoy_api_enum_type.FractionalPercent.DenominatorType>`.
  */
@SerialVersionUID(0L)
final case class TapConfig(
    matchConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate] = _root_.scala.None,
    outputConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig] = _root_.scala.None,
    tapEnabled: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent] = _root_.scala.None,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[TapConfig] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (matchConfig.isDefined) {
        val __value = matchConfig.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (outputConfig.isDefined) {
        val __value = outputConfig.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (tapEnabled.isDefined) {
        val __value = tapEnabled.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 = {
      matchConfig.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      outputConfig.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      tapEnabled.foreach { __v =>
        val __m = __v
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def getMatchConfig: io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate = matchConfig.getOrElse(io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate.defaultInstance)
    def clearMatchConfig: TapConfig = copy(matchConfig = _root_.scala.None)
    def withMatchConfig(__v: io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate): TapConfig = copy(matchConfig = Option(__v))
    def getOutputConfig: io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig = outputConfig.getOrElse(io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig.defaultInstance)
    def clearOutputConfig: TapConfig = copy(outputConfig = _root_.scala.None)
    def withOutputConfig(__v: io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig): TapConfig = copy(outputConfig = Option(__v))
    def getTapEnabled: io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent = tapEnabled.getOrElse(io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent.defaultInstance)
    def clearTapEnabled: TapConfig = copy(tapEnabled = _root_.scala.None)
    def withTapEnabled(__v: io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent): TapConfig = copy(tapEnabled = 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 => matchConfig.orNull
        case 2 => outputConfig.orNull
        case 3 => tapEnabled.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 => matchConfig.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => outputConfig.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => tapEnabled.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.envoy.service.tap.v2alpha.TapConfig.type = io.envoyproxy.envoy.service.tap.v2alpha.TapConfig
    // @@protoc_insertion_point(GeneratedMessage[envoy.service.tap.v2alpha.TapConfig])
}

object TapConfig extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.tap.v2alpha.TapConfig] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.tap.v2alpha.TapConfig] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.tap.v2alpha.TapConfig = {
    var __matchConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate] = _root_.scala.None
    var __outputConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig] = _root_.scala.None
    var __tapEnabled: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent] = _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 10 =>
          __matchConfig = Option(__matchConfig.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __outputConfig = Option(__outputConfig.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 26 =>
          __tapEnabled = Option(__tapEnabled.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.envoy.service.tap.v2alpha.TapConfig(
        matchConfig = __matchConfig,
        outputConfig = __outputConfig,
        tapEnabled = __tapEnabled,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.tap.v2alpha.TapConfig] = _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.tap.v2alpha.TapConfig(
        matchConfig = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate]]),
        outputConfig = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig]]),
        tapEnabled = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent]])
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = CommonProto.javaDescriptor.getMessageTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = CommonProto.scalaDescriptor.messages(0)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 1 => __out = io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate
      case 2 => __out = io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig
      case 3 => __out = io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent
    }
    __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.envoy.service.tap.v2alpha.TapConfig(
    matchConfig = _root_.scala.None,
    outputConfig = _root_.scala.None,
    tapEnabled = _root_.scala.None
  )
  implicit class TapConfigLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.tap.v2alpha.TapConfig]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.tap.v2alpha.TapConfig](_l) {
    def matchConfig: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate] = field(_.getMatchConfig)((c_, f_) => c_.copy(matchConfig = Option(f_)))
    def optionalMatchConfig: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate]] = field(_.matchConfig)((c_, f_) => c_.copy(matchConfig = f_))
    def outputConfig: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig] = field(_.getOutputConfig)((c_, f_) => c_.copy(outputConfig = Option(f_)))
    def optionalOutputConfig: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig]] = field(_.outputConfig)((c_, f_) => c_.copy(outputConfig = f_))
    def tapEnabled: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent] = field(_.getTapEnabled)((c_, f_) => c_.copy(tapEnabled = Option(f_)))
    def optionalTapEnabled: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent]] = field(_.tapEnabled)((c_, f_) => c_.copy(tapEnabled = f_))
  }
  final val MATCH_CONFIG_FIELD_NUMBER = 1
  final val OUTPUT_CONFIG_FIELD_NUMBER = 2
  final val TAP_ENABLED_FIELD_NUMBER = 3
  def of(
    matchConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.MatchPredicate],
    outputConfig: _root_.scala.Option[io.envoyproxy.envoy.service.tap.v2alpha.OutputConfig],
    tapEnabled: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.RuntimeFractionalPercent]
  ): _root_.io.envoyproxy.envoy.service.tap.v2alpha.TapConfig = _root_.io.envoyproxy.envoy.service.tap.v2alpha.TapConfig(
    matchConfig,
    outputConfig,
    tapEnabled
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.tap.v2alpha.TapConfig])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy