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

io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.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.data.cluster.v2alpha

/** [#next-free-field: 12]
  *
  * @param type
  *   In case of eject represents type of ejection that took place.
  * @param timestamp
  *   Timestamp for event.
  * @param secsSinceLastAction
  *   The time in seconds since the last action (either an ejection or unejection) took place.
  * @param clusterName
  *   The :ref:`cluster <envoy_api_msg_Cluster>` that owns the ejected host.
  * @param upstreamUrl
  *   The URL of the ejected host. E.g., ``tcp://1.2.3.4:80``.
  * @param action
  *   The action that took place.
  * @param numEjections
  *   If ``action`` is ``eject``, specifies the number of times the host has been ejected (local to
  *   that Envoy and gets reset if the host gets removed from the upstream cluster for any reason and
  *   then re-added).
  * @param enforced
  *   If ``action`` is ``eject``, specifies if the ejection was enforced. ``true`` means the host was
  *   ejected. ``false`` means the event was logged but the host was not actually ejected.
  */
@SerialVersionUID(0L)
final case class OutlierDetectionEvent(
    `type`: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.CONSECUTIVE_5XX,
    timestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
    secsSinceLastAction: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None,
    clusterName: _root_.scala.Predef.String = "",
    upstreamUrl: _root_.scala.Predef.String = "",
    action: io.envoyproxy.envoy.data.cluster.v2alpha.Action = io.envoyproxy.envoy.data.cluster.v2alpha.Action.EJECT,
    numEjections: _root_.scala.Int = 0,
    enforced: _root_.scala.Boolean = false,
    event: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.Empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[OutlierDetectionEvent] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = `type`.value
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value)
        }
      };
      if (timestamp.isDefined) {
        val __value = timestamp.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (secsSinceLastAction.isDefined) {
        val __value = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toBase(secsSinceLastAction.get)
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      
      {
        val __value = clusterName
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value)
        }
      };
      
      {
        val __value = upstreamUrl
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value)
        }
      };
      
      {
        val __value = action.value
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(6, __value)
        }
      };
      
      {
        val __value = numEjections
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(7, __value)
        }
      };
      
      {
        val __value = enforced
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(8, __value)
        }
      };
      if (event.ejectSuccessRateEvent.isDefined) {
        val __value = event.ejectSuccessRateEvent.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (event.ejectConsecutiveEvent.isDefined) {
        val __value = event.ejectConsecutiveEvent.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (event.ejectFailurePercentageEvent.isDefined) {
        val __value = event.ejectFailurePercentageEvent.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 = {
      {
        val __v = `type`.value
        if (__v != 0) {
          _output__.writeEnum(1, __v)
        }
      };
      timestamp.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      secsSinceLastAction.foreach { __v =>
        val __m = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toBase(__v)
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = clusterName
        if (!__v.isEmpty) {
          _output__.writeString(4, __v)
        }
      };
      {
        val __v = upstreamUrl
        if (!__v.isEmpty) {
          _output__.writeString(5, __v)
        }
      };
      {
        val __v = action.value
        if (__v != 0) {
          _output__.writeEnum(6, __v)
        }
      };
      {
        val __v = numEjections
        if (__v != 0) {
          _output__.writeUInt32(7, __v)
        }
      };
      {
        val __v = enforced
        if (__v != false) {
          _output__.writeBool(8, __v)
        }
      };
      event.ejectSuccessRateEvent.foreach { __v =>
        val __m = __v
        _output__.writeTag(9, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      event.ejectConsecutiveEvent.foreach { __v =>
        val __m = __v
        _output__.writeTag(10, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      event.ejectFailurePercentageEvent.foreach { __v =>
        val __m = __v
        _output__.writeTag(11, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def withType(__v: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType): OutlierDetectionEvent = copy(`type` = __v)
    def getTimestamp: com.google.protobuf.timestamp.Timestamp = timestamp.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
    def clearTimestamp: OutlierDetectionEvent = copy(timestamp = _root_.scala.None)
    def withTimestamp(__v: com.google.protobuf.timestamp.Timestamp): OutlierDetectionEvent = copy(timestamp = Option(__v))
    def getSecsSinceLastAction: _root_.scala.Long = secsSinceLastAction.getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toCustom(com.google.protobuf.wrappers.UInt64Value.defaultInstance))
    def clearSecsSinceLastAction: OutlierDetectionEvent = copy(secsSinceLastAction = _root_.scala.None)
    def withSecsSinceLastAction(__v: _root_.scala.Long): OutlierDetectionEvent = copy(secsSinceLastAction = Option(__v))
    def withClusterName(__v: _root_.scala.Predef.String): OutlierDetectionEvent = copy(clusterName = __v)
    def withUpstreamUrl(__v: _root_.scala.Predef.String): OutlierDetectionEvent = copy(upstreamUrl = __v)
    def withAction(__v: io.envoyproxy.envoy.data.cluster.v2alpha.Action): OutlierDetectionEvent = copy(action = __v)
    def withNumEjections(__v: _root_.scala.Int): OutlierDetectionEvent = copy(numEjections = __v)
    def withEnforced(__v: _root_.scala.Boolean): OutlierDetectionEvent = copy(enforced = __v)
    def getEjectSuccessRateEvent: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate = event.ejectSuccessRateEvent.getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate.defaultInstance)
    def withEjectSuccessRateEvent(__v: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate): OutlierDetectionEvent = copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectSuccessRateEvent(__v))
    def getEjectConsecutiveEvent: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive = event.ejectConsecutiveEvent.getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive.defaultInstance)
    def withEjectConsecutiveEvent(__v: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive): OutlierDetectionEvent = copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectConsecutiveEvent(__v))
    def getEjectFailurePercentageEvent: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage = event.ejectFailurePercentageEvent.getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage.defaultInstance)
    def withEjectFailurePercentageEvent(__v: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage): OutlierDetectionEvent = copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectFailurePercentageEvent(__v))
    def clearEvent: OutlierDetectionEvent = copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.Empty)
    def withEvent(__v: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event): OutlierDetectionEvent = copy(event = __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 => {
          val __t = `type`.javaValueDescriptor
          if (__t.getNumber() != 0) __t else null
        }
        case 2 => timestamp.orNull
        case 3 => secsSinceLastAction.map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toBase(_)).orNull
        case 4 => {
          val __t = clusterName
          if (__t != "") __t else null
        }
        case 5 => {
          val __t = upstreamUrl
          if (__t != "") __t else null
        }
        case 6 => {
          val __t = action.javaValueDescriptor
          if (__t.getNumber() != 0) __t else null
        }
        case 7 => {
          val __t = numEjections
          if (__t != 0) __t else null
        }
        case 8 => {
          val __t = enforced
          if (__t != false) __t else null
        }
        case 9 => event.ejectSuccessRateEvent.orNull
        case 10 => event.ejectConsecutiveEvent.orNull
        case 11 => event.ejectFailurePercentageEvent.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 => _root_.scalapb.descriptors.PEnum(`type`.scalaValueDescriptor)
        case 2 => timestamp.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => secsSinceLastAction.map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toBase(_).toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => _root_.scalapb.descriptors.PString(clusterName)
        case 5 => _root_.scalapb.descriptors.PString(upstreamUrl)
        case 6 => _root_.scalapb.descriptors.PEnum(action.scalaValueDescriptor)
        case 7 => _root_.scalapb.descriptors.PInt(numEjections)
        case 8 => _root_.scalapb.descriptors.PBoolean(enforced)
        case 9 => event.ejectSuccessRateEvent.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 10 => event.ejectConsecutiveEvent.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 11 => event.ejectFailurePercentageEvent.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.type = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent
    // @@protoc_insertion_point(GeneratedMessage[envoy.data.cluster.v2alpha.OutlierDetectionEvent])
}

object OutlierDetectionEvent extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent = {
    var __type: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.CONSECUTIVE_5XX
    var __timestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
    var __secsSinceLastAction: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
    var __clusterName: _root_.scala.Predef.String = ""
    var __upstreamUrl: _root_.scala.Predef.String = ""
    var __action: io.envoyproxy.envoy.data.cluster.v2alpha.Action = io.envoyproxy.envoy.data.cluster.v2alpha.Action.EJECT
    var __numEjections: _root_.scala.Int = 0
    var __enforced: _root_.scala.Boolean = false
    var __event: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.Empty
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __type = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.fromValue(_input__.readEnum())
        case 18 =>
          __timestamp = Option(__timestamp.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 26 =>
          __secsSinceLastAction = Option(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toCustom(__secsSinceLastAction.map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toBase(_)).fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.wrappers.UInt64Value](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))))
        case 34 =>
          __clusterName = _input__.readStringRequireUtf8()
        case 42 =>
          __upstreamUrl = _input__.readStringRequireUtf8()
        case 48 =>
          __action = io.envoyproxy.envoy.data.cluster.v2alpha.Action.fromValue(_input__.readEnum())
        case 56 =>
          __numEjections = _input__.readUInt32()
        case 64 =>
          __enforced = _input__.readBool()
        case 74 =>
          __event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectSuccessRateEvent(__event.ejectSuccessRateEvent.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 82 =>
          __event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectConsecutiveEvent(__event.ejectConsecutiveEvent.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 90 =>
          __event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectFailurePercentageEvent(__event.ejectFailurePercentageEvent.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent(
        `type` = __type,
        timestamp = __timestamp,
        secsSinceLastAction = __secsSinceLastAction,
        clusterName = __clusterName,
        upstreamUrl = __upstreamUrl,
        action = __action,
        numEjections = __numEjections,
        enforced = __enforced,
        event = __event,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent] = _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.data.cluster.v2alpha.OutlierDetectionEvent(
        `type` = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.CONSECUTIVE_5XX.scalaValueDescriptor).number),
        timestamp = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
        secsSinceLastAction = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.wrappers.UInt64Value]]).map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent._typemapper_secsSinceLastAction.toCustom(_)),
        clusterName = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        upstreamUrl = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        action = io.envoyproxy.envoy.data.cluster.v2alpha.Action.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.Action.EJECT.scalaValueDescriptor).number),
        numEjections = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        enforced = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        event = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate]]).map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectSuccessRateEvent(_))
            .orElse[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event](__fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive]]).map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectConsecutiveEvent(_)))
            .orElse[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event](__fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage]]).map(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectFailurePercentageEvent(_)))
            .getOrElse(io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.Empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = OutlierDetectionEventProto.javaDescriptor.getMessageTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = OutlierDetectionEventProto.scalaDescriptor.messages(0)
  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.wrappers.UInt64Value
      case 9 => __out = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate
      case 10 => __out = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive
      case 11 => __out = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
    (__fieldNumber: @_root_.scala.unchecked) match {
      case 1 => io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType
      case 6 => io.envoyproxy.envoy.data.cluster.v2alpha.Action
    }
  }
  lazy val defaultInstance = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent(
    `type` = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType.CONSECUTIVE_5XX,
    timestamp = _root_.scala.None,
    secsSinceLastAction = _root_.scala.None,
    clusterName = "",
    upstreamUrl = "",
    action = io.envoyproxy.envoy.data.cluster.v2alpha.Action.EJECT,
    numEjections = 0,
    enforced = false,
    event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.Empty
  )
  sealed trait Event extends _root_.scalapb.GeneratedOneof {
    def isEmpty: _root_.scala.Boolean = false
    def isDefined: _root_.scala.Boolean = true
    def isEjectSuccessRateEvent: _root_.scala.Boolean = false
    def isEjectConsecutiveEvent: _root_.scala.Boolean = false
    def isEjectFailurePercentageEvent: _root_.scala.Boolean = false
    def ejectSuccessRateEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate] = _root_.scala.None
    def ejectConsecutiveEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive] = _root_.scala.None
    def ejectFailurePercentageEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage] = _root_.scala.None
  }
  object Event {
    @SerialVersionUID(0L)
    case object Empty extends io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event {
      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 EjectSuccessRateEvent(value: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate) extends io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event {
      type ValueType = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate
      override def isEjectSuccessRateEvent: _root_.scala.Boolean = true
      override def ejectSuccessRateEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate] = Some(value)
      override def number: _root_.scala.Int = 9
    }
    @SerialVersionUID(0L)
    final case class EjectConsecutiveEvent(value: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive) extends io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event {
      type ValueType = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive
      override def isEjectConsecutiveEvent: _root_.scala.Boolean = true
      override def ejectConsecutiveEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive] = Some(value)
      override def number: _root_.scala.Int = 10
    }
    @SerialVersionUID(0L)
    final case class EjectFailurePercentageEvent(value: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage) extends io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event {
      type ValueType = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage
      override def isEjectFailurePercentageEvent: _root_.scala.Boolean = true
      override def ejectFailurePercentageEvent: _root_.scala.Option[io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage] = Some(value)
      override def number: _root_.scala.Int = 11
    }
  }
  implicit class OutlierDetectionEventLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent](_l) {
    def `type`: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType] = field(_.`type`)((c_, f_) => c_.copy(`type` = f_))
    def timestamp: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getTimestamp)((c_, f_) => c_.copy(timestamp = Option(f_)))
    def optionalTimestamp: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.timestamp)((c_, f_) => c_.copy(timestamp = f_))
    def secsSinceLastAction: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.getSecsSinceLastAction)((c_, f_) => c_.copy(secsSinceLastAction = Option(f_)))
    def optionalSecsSinceLastAction: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Long]] = field(_.secsSinceLastAction)((c_, f_) => c_.copy(secsSinceLastAction = f_))
    def clusterName: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.clusterName)((c_, f_) => c_.copy(clusterName = f_))
    def upstreamUrl: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.upstreamUrl)((c_, f_) => c_.copy(upstreamUrl = f_))
    def action: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.Action] = field(_.action)((c_, f_) => c_.copy(action = f_))
    def numEjections: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.numEjections)((c_, f_) => c_.copy(numEjections = f_))
    def enforced: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.enforced)((c_, f_) => c_.copy(enforced = f_))
    def ejectSuccessRateEvent: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectSuccessRate] = field(_.getEjectSuccessRateEvent)((c_, f_) => c_.copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectSuccessRateEvent(f_)))
    def ejectConsecutiveEvent: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectConsecutive] = field(_.getEjectConsecutiveEvent)((c_, f_) => c_.copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectConsecutiveEvent(f_)))
    def ejectFailurePercentageEvent: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectFailurePercentage] = field(_.getEjectFailurePercentageEvent)((c_, f_) => c_.copy(event = io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event.EjectFailurePercentageEvent(f_)))
    def event: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event] = field(_.event)((c_, f_) => c_.copy(event = f_))
  }
  final val TYPE_FIELD_NUMBER = 1
  final val TIMESTAMP_FIELD_NUMBER = 2
  final val SECS_SINCE_LAST_ACTION_FIELD_NUMBER = 3
  final val CLUSTER_NAME_FIELD_NUMBER = 4
  final val UPSTREAM_URL_FIELD_NUMBER = 5
  final val ACTION_FIELD_NUMBER = 6
  final val NUM_EJECTIONS_FIELD_NUMBER = 7
  final val ENFORCED_FIELD_NUMBER = 8
  final val EJECT_SUCCESS_RATE_EVENT_FIELD_NUMBER = 9
  final val EJECT_CONSECUTIVE_EVENT_FIELD_NUMBER = 10
  final val EJECT_FAILURE_PERCENTAGE_EVENT_FIELD_NUMBER = 11
  @transient
  private[v2alpha] val _typemapper_secsSinceLastAction: _root_.scalapb.TypeMapper[com.google.protobuf.wrappers.UInt64Value, _root_.scala.Long] = implicitly[_root_.scalapb.TypeMapper[com.google.protobuf.wrappers.UInt64Value, _root_.scala.Long]]
  def of(
    `type`: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierEjectionType,
    timestamp: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
    secsSinceLastAction: _root_.scala.Option[_root_.scala.Long],
    clusterName: _root_.scala.Predef.String,
    upstreamUrl: _root_.scala.Predef.String,
    action: io.envoyproxy.envoy.data.cluster.v2alpha.Action,
    numEjections: _root_.scala.Int,
    enforced: _root_.scala.Boolean,
    event: io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent.Event
  ): _root_.io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent = _root_.io.envoyproxy.envoy.data.cluster.v2alpha.OutlierDetectionEvent(
    `type`,
    timestamp,
    secsSinceLastAction,
    clusterName,
    upstreamUrl,
    action,
    numEjections,
    enforced,
    event
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.data.cluster.v2alpha.OutlierDetectionEvent])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy