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

io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig.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.config.cluster.redis

/** [#next-free-field: 7]
  *
  * @param clusterRefreshRate
  *   Interval between successive topology refresh requests. If not set, this defaults to 5s.
  * @param clusterRefreshTimeout
  *   Timeout for topology refresh request. If not set, this defaults to 3s.
  * @param redirectRefreshInterval
  *   The minimum interval that must pass after triggering a topology refresh request before a new
  *   request can possibly be triggered again. Any errors received during one of these
  *   time intervals are ignored. If not set, this defaults to 5s.
  * @param redirectRefreshThreshold
  *   The number of redirection errors that must be received before
  *   triggering a topology refresh request. If not set, this defaults to 5.
  *   If this is set to 0, topology refresh after redirect is disabled.
  * @param failureRefreshThreshold
  *   The number of failures that must be received before triggering a topology refresh request.
  *   If not set, this defaults to 0, which disables the topology refresh due to failure.
  * @param hostDegradedRefreshThreshold
  *   The number of hosts became degraded or unhealthy before triggering a topology refresh request.
  *   If not set, this defaults to 0, which disables the topology refresh due to degraded or
  *   unhealthy host.
  */
@SerialVersionUID(0L)
final case class RedisClusterConfig(
    clusterRefreshRate: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
    clusterRefreshTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
    redirectRefreshInterval: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
    redirectRefreshThreshold: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    failureRefreshThreshold: _root_.scala.Int = 0,
    hostDegradedRefreshThreshold: _root_.scala.Int = 0,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RedisClusterConfig] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (clusterRefreshRate.isDefined) {
        val __value = clusterRefreshRate.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (clusterRefreshTimeout.isDefined) {
        val __value = clusterRefreshTimeout.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (redirectRefreshInterval.isDefined) {
        val __value = redirectRefreshInterval.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (redirectRefreshThreshold.isDefined) {
        val __value = io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toBase(redirectRefreshThreshold.get)
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      
      {
        val __value = failureRefreshThreshold
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(5, __value)
        }
      };
      
      {
        val __value = hostDegradedRefreshThreshold
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(6, __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 = {
      clusterRefreshRate.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      clusterRefreshTimeout.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      redirectRefreshInterval.foreach { __v =>
        val __m = __v
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      redirectRefreshThreshold.foreach { __v =>
        val __m = io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toBase(__v)
        _output__.writeTag(4, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = failureRefreshThreshold
        if (__v != 0) {
          _output__.writeUInt32(5, __v)
        }
      };
      {
        val __v = hostDegradedRefreshThreshold
        if (__v != 0) {
          _output__.writeUInt32(6, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def getClusterRefreshRate: com.google.protobuf.duration.Duration = clusterRefreshRate.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
    def clearClusterRefreshRate: RedisClusterConfig = copy(clusterRefreshRate = _root_.scala.None)
    def withClusterRefreshRate(__v: com.google.protobuf.duration.Duration): RedisClusterConfig = copy(clusterRefreshRate = Option(__v))
    def getClusterRefreshTimeout: com.google.protobuf.duration.Duration = clusterRefreshTimeout.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
    def clearClusterRefreshTimeout: RedisClusterConfig = copy(clusterRefreshTimeout = _root_.scala.None)
    def withClusterRefreshTimeout(__v: com.google.protobuf.duration.Duration): RedisClusterConfig = copy(clusterRefreshTimeout = Option(__v))
    def getRedirectRefreshInterval: com.google.protobuf.duration.Duration = redirectRefreshInterval.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
    def clearRedirectRefreshInterval: RedisClusterConfig = copy(redirectRefreshInterval = _root_.scala.None)
    def withRedirectRefreshInterval(__v: com.google.protobuf.duration.Duration): RedisClusterConfig = copy(redirectRefreshInterval = Option(__v))
    def getRedirectRefreshThreshold: _root_.scala.Int = redirectRefreshThreshold.getOrElse(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toCustom(com.google.protobuf.wrappers.UInt32Value.defaultInstance))
    def clearRedirectRefreshThreshold: RedisClusterConfig = copy(redirectRefreshThreshold = _root_.scala.None)
    def withRedirectRefreshThreshold(__v: _root_.scala.Int): RedisClusterConfig = copy(redirectRefreshThreshold = Option(__v))
    def withFailureRefreshThreshold(__v: _root_.scala.Int): RedisClusterConfig = copy(failureRefreshThreshold = __v)
    def withHostDegradedRefreshThreshold(__v: _root_.scala.Int): RedisClusterConfig = copy(hostDegradedRefreshThreshold = __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 => clusterRefreshRate.orNull
        case 2 => clusterRefreshTimeout.orNull
        case 3 => redirectRefreshInterval.orNull
        case 4 => redirectRefreshThreshold.map(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toBase(_)).orNull
        case 5 => {
          val __t = failureRefreshThreshold
          if (__t != 0) __t else null
        }
        case 6 => {
          val __t = hostDegradedRefreshThreshold
          if (__t != 0) __t else null
        }
      }
    }
    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 => clusterRefreshRate.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => clusterRefreshTimeout.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => redirectRefreshInterval.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => redirectRefreshThreshold.map(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toBase(_).toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 5 => _root_.scalapb.descriptors.PInt(failureRefreshThreshold)
        case 6 => _root_.scalapb.descriptors.PInt(hostDegradedRefreshThreshold)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig.type = io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig
    // @@protoc_insertion_point(GeneratedMessage[envoy.config.cluster.redis.RedisClusterConfig])
}

object RedisClusterConfig extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig = {
    var __clusterRefreshRate: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
    var __clusterRefreshTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
    var __redirectRefreshInterval: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
    var __redirectRefreshThreshold: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __failureRefreshThreshold: _root_.scala.Int = 0
    var __hostDegradedRefreshThreshold: _root_.scala.Int = 0
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __clusterRefreshRate = Option(__clusterRefreshRate.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __clusterRefreshTimeout = Option(__clusterRefreshTimeout.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 26 =>
          __redirectRefreshInterval = Option(__redirectRefreshInterval.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 34 =>
          __redirectRefreshThreshold = Option(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toCustom(__redirectRefreshThreshold.map(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toBase(_)).fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.wrappers.UInt32Value](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))))
        case 40 =>
          __failureRefreshThreshold = _input__.readUInt32()
        case 48 =>
          __hostDegradedRefreshThreshold = _input__.readUInt32()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig(
        clusterRefreshRate = __clusterRefreshRate,
        clusterRefreshTimeout = __clusterRefreshTimeout,
        redirectRefreshInterval = __redirectRefreshInterval,
        redirectRefreshThreshold = __redirectRefreshThreshold,
        failureRefreshThreshold = __failureRefreshThreshold,
        hostDegradedRefreshThreshold = __hostDegradedRefreshThreshold,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig] = _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.config.cluster.redis.RedisClusterConfig(
        clusterRefreshRate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
        clusterRefreshTimeout = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
        redirectRefreshInterval = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
        redirectRefreshThreshold = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.wrappers.UInt32Value]]).map(io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig._typemapper_redirectRefreshThreshold.toCustom(_)),
        failureRefreshThreshold = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        hostDegradedRefreshThreshold = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Int]).getOrElse(0)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = RedisClusterProto.javaDescriptor.getMessageTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = RedisClusterProto.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 = com.google.protobuf.duration.Duration
      case 2 => __out = com.google.protobuf.duration.Duration
      case 3 => __out = com.google.protobuf.duration.Duration
      case 4 => __out = com.google.protobuf.wrappers.UInt32Value
    }
    __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.config.cluster.redis.RedisClusterConfig(
    clusterRefreshRate = _root_.scala.None,
    clusterRefreshTimeout = _root_.scala.None,
    redirectRefreshInterval = _root_.scala.None,
    redirectRefreshThreshold = _root_.scala.None,
    failureRefreshThreshold = 0,
    hostDegradedRefreshThreshold = 0
  )
  implicit class RedisClusterConfigLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig](_l) {
    def clusterRefreshRate: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getClusterRefreshRate)((c_, f_) => c_.copy(clusterRefreshRate = Option(f_)))
    def optionalClusterRefreshRate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.clusterRefreshRate)((c_, f_) => c_.copy(clusterRefreshRate = f_))
    def clusterRefreshTimeout: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getClusterRefreshTimeout)((c_, f_) => c_.copy(clusterRefreshTimeout = Option(f_)))
    def optionalClusterRefreshTimeout: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.clusterRefreshTimeout)((c_, f_) => c_.copy(clusterRefreshTimeout = f_))
    def redirectRefreshInterval: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getRedirectRefreshInterval)((c_, f_) => c_.copy(redirectRefreshInterval = Option(f_)))
    def optionalRedirectRefreshInterval: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.redirectRefreshInterval)((c_, f_) => c_.copy(redirectRefreshInterval = f_))
    def redirectRefreshThreshold: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getRedirectRefreshThreshold)((c_, f_) => c_.copy(redirectRefreshThreshold = Option(f_)))
    def optionalRedirectRefreshThreshold: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.redirectRefreshThreshold)((c_, f_) => c_.copy(redirectRefreshThreshold = f_))
    def failureRefreshThreshold: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.failureRefreshThreshold)((c_, f_) => c_.copy(failureRefreshThreshold = f_))
    def hostDegradedRefreshThreshold: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.hostDegradedRefreshThreshold)((c_, f_) => c_.copy(hostDegradedRefreshThreshold = f_))
  }
  final val CLUSTER_REFRESH_RATE_FIELD_NUMBER = 1
  final val CLUSTER_REFRESH_TIMEOUT_FIELD_NUMBER = 2
  final val REDIRECT_REFRESH_INTERVAL_FIELD_NUMBER = 3
  final val REDIRECT_REFRESH_THRESHOLD_FIELD_NUMBER = 4
  final val FAILURE_REFRESH_THRESHOLD_FIELD_NUMBER = 5
  final val HOST_DEGRADED_REFRESH_THRESHOLD_FIELD_NUMBER = 6
  @transient
  private[redis] val _typemapper_redirectRefreshThreshold: _root_.scalapb.TypeMapper[com.google.protobuf.wrappers.UInt32Value, _root_.scala.Int] = implicitly[_root_.scalapb.TypeMapper[com.google.protobuf.wrappers.UInt32Value, _root_.scala.Int]]
  def of(
    clusterRefreshRate: _root_.scala.Option[com.google.protobuf.duration.Duration],
    clusterRefreshTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration],
    redirectRefreshInterval: _root_.scala.Option[com.google.protobuf.duration.Duration],
    redirectRefreshThreshold: _root_.scala.Option[_root_.scala.Int],
    failureRefreshThreshold: _root_.scala.Int,
    hostDegradedRefreshThreshold: _root_.scala.Int
  ): _root_.io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig = _root_.io.envoyproxy.envoy.config.cluster.redis.RedisClusterConfig(
    clusterRefreshRate,
    clusterRefreshTimeout,
    redirectRefreshInterval,
    redirectRefreshThreshold,
    failureRefreshThreshold,
    hostDegradedRefreshThreshold
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.cluster.redis.RedisClusterConfig])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy