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

io.envoyproxy.envoy.config.route.v3.RetryPolicy.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.route.v3

/** HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.
  * [#next-free-field: 14]
  *
  * @param retryOn
  *   Specifies the conditions under which retry takes place. These are the same
  *   conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and
  *   :ref:`config_http_filters_router_x-envoy-retry-grpc-on`.
  * @param numRetries
  *   Specifies the allowed number of retries. This parameter is optional and
  *   defaults to 1. These are the same conditions documented for
  *   :ref:`config_http_filters_router_x-envoy-max-retries`.
  * @param perTryTimeout
  *   Specifies a non-zero upstream timeout per retry attempt (including the initial attempt). This
  *   parameter is optional. The same conditions documented for
  *   :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
  *  
  *   .. note::
  *  
  *     If left unspecified, Envoy will use the global
  *     :ref:`route timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` for the request.
  *     Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
  *     retry policy, a request that times out will not be retried as the total timeout budget
  *     would have been exhausted.
  * @param perTryIdleTimeout
  *   Specifies an upstream idle timeout per retry attempt (including the initial attempt). This
  *   parameter is optional and if absent there is no per try idle timeout. The semantics of the per
  *   try idle timeout are similar to the
  *   :ref:`route idle timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` and
  *   :ref:`stream idle timeout
  *   <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
  *   both enforced by the HTTP connection manager. The difference is that this idle timeout
  *   is enforced by the router for each individual attempt and thus after all previous filters have
  *   run, as opposed to *before* all previous filters run for the other idle timeouts. This timeout
  *   is useful in cases in which total request timeout is bounded by a number of retries and a
  *   :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`, but
  *   there is a desire to ensure each try is making incremental progress. Note also that similar
  *   to :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
  *   this idle timeout does not start until after both the entire request has been received by the
  *   router *and* a connection pool connection has been obtained. Unlike
  *   :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
  *   the idle timer continues once the response starts streaming back to the downstream client.
  *   This ensures that response data continues to make progress without using one of the HTTP
  *   connection manager idle timeouts.
  * @param retryPriority
  *   Specifies an implementation of a RetryPriority which is used to determine the
  *   distribution of load across priorities used for retries. Refer to
  *   :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
  * @param retryHostPredicate
  *   Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
  *   for retries. If any of the predicates reject the host, host selection will be reattempted.
  *   Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
  *   details.
  * @param retryOptionsPredicates
  *   Retry options predicates that will be applied prior to retrying a request. These predicates
  *   allow customizing request behavior between retries.
  *   [#comment: add [#extension-category: envoy.retry_options_predicates] when there are built-in extensions]
  * @param hostSelectionRetryMaxAttempts
  *   The maximum number of times host selection will be reattempted before giving up, at which
  *   point the host that was last selected will be routed to. If unspecified, this will default to
  *   retrying once.
  * @param retriableStatusCodes
  *   HTTP status codes that should trigger a retry in addition to those specified by retry_on.
  * @param retryBackOff
  *   Specifies parameters that control exponential retry back off. This parameter is optional, in which case the
  *   default base interval is 25 milliseconds or, if set, the current value of the
  *   `upstream.base_retry_backoff_ms` runtime parameter. The default maximum interval is 10 times
  *   the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
  *   describes Envoy's back-off algorithm.
  * @param rateLimitedRetryBackOff
  *   Specifies parameters that control a retry back-off strategy that is used
  *   when the request is rate limited by the upstream server. The server may
  *   return a response header like ``Retry-After`` or ``X-RateLimit-Reset`` to
  *   provide feedback to the client on how long to wait before retrying. If
  *   configured, this back-off strategy will be used instead of the
  *   default exponential back off strategy (configured using `retry_back_off`)
  *   whenever a response includes the matching headers.
  * @param retriableHeaders
  *   HTTP response headers that trigger a retry if present in the response. A retry will be
  *   triggered if any of the header matches match the upstream response headers.
  *   The field is only consulted if 'retriable-headers' retry policy is active.
  * @param retriableRequestHeaders
  *   HTTP headers which must be present in the request for retries to be attempted.
  */
@SerialVersionUID(0L)
final case class RetryPolicy(
    retryOn: _root_.scala.Predef.String = "",
    numRetries: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None,
    perTryTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
    perTryIdleTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
    retryPriority: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] = _root_.scala.None,
    retryHostPredicate: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate] = _root_.scala.Seq.empty,
    retryOptionsPredicates: _root_.scala.Seq[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig] = _root_.scala.Seq.empty,
    hostSelectionRetryMaxAttempts: _root_.scala.Long = 0L,
    retriableStatusCodes: _root_.scala.Seq[_root_.scala.Int] = _root_.scala.Seq.empty,
    retryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] = _root_.scala.None,
    rateLimitedRetryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] = _root_.scala.None,
    retriableHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher] = _root_.scala.Seq.empty,
    retriableRequestHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher] = _root_.scala.Seq.empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RetryPolicy] {
    private[this] def retriableStatusCodesSerializedSize = {
      if (__retriableStatusCodesSerializedSizeField == 0) __retriableStatusCodesSerializedSizeField = {
        var __s: _root_.scala.Int = 0
        retriableStatusCodes.foreach(__i => __s += _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__i))
        __s
      }
      __retriableStatusCodesSerializedSizeField
    }
    @transient private[this] var __retriableStatusCodesSerializedSizeField: _root_.scala.Int = 0
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = retryOn
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
        }
      };
      if (numRetries.isDefined) {
        val __value = io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toBase(numRetries.get)
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (perTryTimeout.isDefined) {
        val __value = perTryTimeout.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (perTryIdleTimeout.isDefined) {
        val __value = perTryIdleTimeout.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (retryPriority.isDefined) {
        val __value = retryPriority.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      retryHostPredicate.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      retryOptionsPredicates.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      
      {
        val __value = hostSelectionRetryMaxAttempts
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(6, __value)
        }
      };
      if (retriableStatusCodes.nonEmpty) {
        val __localsize = retriableStatusCodesSerializedSize
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__localsize) + __localsize
      }
      if (retryBackOff.isDefined) {
        val __value = retryBackOff.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (rateLimitedRetryBackOff.isDefined) {
        val __value = rateLimitedRetryBackOff.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      retriableHeaders.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      retriableRequestHeaders.foreach { __item =>
        val __value = __item
        __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 = retryOn
        if (!__v.isEmpty) {
          _output__.writeString(1, __v)
        }
      };
      numRetries.foreach { __v =>
        val __m = io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toBase(__v)
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      perTryTimeout.foreach { __v =>
        val __m = __v
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      retryPriority.foreach { __v =>
        val __m = __v
        _output__.writeTag(4, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      retryHostPredicate.foreach { __v =>
        val __m = __v
        _output__.writeTag(5, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = hostSelectionRetryMaxAttempts
        if (__v != 0L) {
          _output__.writeInt64(6, __v)
        }
      };
      if (retriableStatusCodes.nonEmpty) {
        _output__.writeTag(7, 2)
        _output__.writeUInt32NoTag(retriableStatusCodesSerializedSize)
        retriableStatusCodes.foreach(_output__.writeUInt32NoTag)
      };
      retryBackOff.foreach { __v =>
        val __m = __v
        _output__.writeTag(8, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      retriableHeaders.foreach { __v =>
        val __m = __v
        _output__.writeTag(9, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      retriableRequestHeaders.foreach { __v =>
        val __m = __v
        _output__.writeTag(10, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      rateLimitedRetryBackOff.foreach { __v =>
        val __m = __v
        _output__.writeTag(11, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      retryOptionsPredicates.foreach { __v =>
        val __m = __v
        _output__.writeTag(12, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      perTryIdleTimeout.foreach { __v =>
        val __m = __v
        _output__.writeTag(13, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def withRetryOn(__v: _root_.scala.Predef.String): RetryPolicy = copy(retryOn = __v)
    def getNumRetries: _root_.scala.Int = numRetries.getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toCustom(com.google.protobuf.wrappers.UInt32Value.defaultInstance))
    def clearNumRetries: RetryPolicy = copy(numRetries = _root_.scala.None)
    def withNumRetries(__v: _root_.scala.Int): RetryPolicy = copy(numRetries = Option(__v))
    def getPerTryTimeout: com.google.protobuf.duration.Duration = perTryTimeout.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
    def clearPerTryTimeout: RetryPolicy = copy(perTryTimeout = _root_.scala.None)
    def withPerTryTimeout(__v: com.google.protobuf.duration.Duration): RetryPolicy = copy(perTryTimeout = Option(__v))
    def getPerTryIdleTimeout: com.google.protobuf.duration.Duration = perTryIdleTimeout.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
    def clearPerTryIdleTimeout: RetryPolicy = copy(perTryIdleTimeout = _root_.scala.None)
    def withPerTryIdleTimeout(__v: com.google.protobuf.duration.Duration): RetryPolicy = copy(perTryIdleTimeout = Option(__v))
    def getRetryPriority: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority = retryPriority.getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.defaultInstance)
    def clearRetryPriority: RetryPolicy = copy(retryPriority = _root_.scala.None)
    def withRetryPriority(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority): RetryPolicy = copy(retryPriority = Option(__v))
    def clearRetryHostPredicate = copy(retryHostPredicate = _root_.scala.Seq.empty)
    def addRetryHostPredicate(__vs: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate *): RetryPolicy = addAllRetryHostPredicate(__vs)
    def addAllRetryHostPredicate(__vs: Iterable[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]): RetryPolicy = copy(retryHostPredicate = retryHostPredicate ++ __vs)
    def withRetryHostPredicate(__v: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]): RetryPolicy = copy(retryHostPredicate = __v)
    def clearRetryOptionsPredicates = copy(retryOptionsPredicates = _root_.scala.Seq.empty)
    def addRetryOptionsPredicates(__vs: io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig *): RetryPolicy = addAllRetryOptionsPredicates(__vs)
    def addAllRetryOptionsPredicates(__vs: Iterable[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig]): RetryPolicy = copy(retryOptionsPredicates = retryOptionsPredicates ++ __vs)
    def withRetryOptionsPredicates(__v: _root_.scala.Seq[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig]): RetryPolicy = copy(retryOptionsPredicates = __v)
    def withHostSelectionRetryMaxAttempts(__v: _root_.scala.Long): RetryPolicy = copy(hostSelectionRetryMaxAttempts = __v)
    def clearRetriableStatusCodes = copy(retriableStatusCodes = _root_.scala.Seq.empty)
    def addRetriableStatusCodes(__vs: _root_.scala.Int *): RetryPolicy = addAllRetriableStatusCodes(__vs)
    def addAllRetriableStatusCodes(__vs: Iterable[_root_.scala.Int]): RetryPolicy = copy(retriableStatusCodes = retriableStatusCodes ++ __vs)
    def withRetriableStatusCodes(__v: _root_.scala.Seq[_root_.scala.Int]): RetryPolicy = copy(retriableStatusCodes = __v)
    def getRetryBackOff: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff = retryBackOff.getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff.defaultInstance)
    def clearRetryBackOff: RetryPolicy = copy(retryBackOff = _root_.scala.None)
    def withRetryBackOff(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff): RetryPolicy = copy(retryBackOff = Option(__v))
    def getRateLimitedRetryBackOff: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff = rateLimitedRetryBackOff.getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff.defaultInstance)
    def clearRateLimitedRetryBackOff: RetryPolicy = copy(rateLimitedRetryBackOff = _root_.scala.None)
    def withRateLimitedRetryBackOff(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff): RetryPolicy = copy(rateLimitedRetryBackOff = Option(__v))
    def clearRetriableHeaders = copy(retriableHeaders = _root_.scala.Seq.empty)
    def addRetriableHeaders(__vs: io.envoyproxy.envoy.config.route.v3.HeaderMatcher *): RetryPolicy = addAllRetriableHeaders(__vs)
    def addAllRetriableHeaders(__vs: Iterable[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]): RetryPolicy = copy(retriableHeaders = retriableHeaders ++ __vs)
    def withRetriableHeaders(__v: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]): RetryPolicy = copy(retriableHeaders = __v)
    def clearRetriableRequestHeaders = copy(retriableRequestHeaders = _root_.scala.Seq.empty)
    def addRetriableRequestHeaders(__vs: io.envoyproxy.envoy.config.route.v3.HeaderMatcher *): RetryPolicy = addAllRetriableRequestHeaders(__vs)
    def addAllRetriableRequestHeaders(__vs: Iterable[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]): RetryPolicy = copy(retriableRequestHeaders = retriableRequestHeaders ++ __vs)
    def withRetriableRequestHeaders(__v: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]): RetryPolicy = copy(retriableRequestHeaders = __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 = retryOn
          if (__t != "") __t else null
        }
        case 2 => numRetries.map(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toBase(_)).orNull
        case 3 => perTryTimeout.orNull
        case 13 => perTryIdleTimeout.orNull
        case 4 => retryPriority.orNull
        case 5 => retryHostPredicate
        case 12 => retryOptionsPredicates
        case 6 => {
          val __t = hostSelectionRetryMaxAttempts
          if (__t != 0L) __t else null
        }
        case 7 => retriableStatusCodes
        case 8 => retryBackOff.orNull
        case 11 => rateLimitedRetryBackOff.orNull
        case 9 => retriableHeaders
        case 10 => retriableRequestHeaders
      }
    }
    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.PString(retryOn)
        case 2 => numRetries.map(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toBase(_).toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => perTryTimeout.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 13 => perTryIdleTimeout.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => retryPriority.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 5 => _root_.scalapb.descriptors.PRepeated(retryHostPredicate.iterator.map(_.toPMessage).toVector)
        case 12 => _root_.scalapb.descriptors.PRepeated(retryOptionsPredicates.iterator.map(_.toPMessage).toVector)
        case 6 => _root_.scalapb.descriptors.PLong(hostSelectionRetryMaxAttempts)
        case 7 => _root_.scalapb.descriptors.PRepeated(retriableStatusCodes.iterator.map(_root_.scalapb.descriptors.PInt(_)).toVector)
        case 8 => retryBackOff.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 11 => rateLimitedRetryBackOff.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 9 => _root_.scalapb.descriptors.PRepeated(retriableHeaders.iterator.map(_.toPMessage).toVector)
        case 10 => _root_.scalapb.descriptors.PRepeated(retriableRequestHeaders.iterator.map(_.toPMessage).toVector)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy
    // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy])
}

object RetryPolicy extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy = {
    var __retryOn: _root_.scala.Predef.String = ""
    var __numRetries: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None
    var __perTryTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
    var __perTryIdleTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
    var __retryPriority: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] = _root_.scala.None
    val __retryHostPredicate: _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate] = new _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]
    val __retryOptionsPredicates: _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig] = new _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig]
    var __hostSelectionRetryMaxAttempts: _root_.scala.Long = 0L
    val __retriableStatusCodes: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int]
    var __retryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] = _root_.scala.None
    var __rateLimitedRetryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] = _root_.scala.None
    val __retriableHeaders: _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.HeaderMatcher] = new _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]
    val __retriableRequestHeaders: _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.HeaderMatcher] = new _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __retryOn = _input__.readStringRequireUtf8()
        case 18 =>
          __numRetries = Option(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toCustom(__numRetries.map(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toBase(_)).fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.wrappers.UInt32Value](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))))
        case 26 =>
          __perTryTimeout = Option(__perTryTimeout.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 106 =>
          __perTryIdleTimeout = Option(__perTryIdleTimeout.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 34 =>
          __retryPriority = Option(__retryPriority.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 42 =>
          __retryHostPredicate += _root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate](_input__)
        case 98 =>
          __retryOptionsPredicates += _root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig](_input__)
        case 48 =>
          __hostSelectionRetryMaxAttempts = _input__.readInt64()
        case 56 =>
          __retriableStatusCodes += _input__.readUInt32()
        case 58 => {
          val length = _input__.readRawVarint32()
          val oldLimit = _input__.pushLimit(length)
          while (_input__.getBytesUntilLimit > 0) {
            __retriableStatusCodes += _input__.readUInt32()
          }
          _input__.popLimit(oldLimit)
        }
        case 66 =>
          __retryBackOff = Option(__retryBackOff.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 90 =>
          __rateLimitedRetryBackOff = Option(__rateLimitedRetryBackOff.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 74 =>
          __retriableHeaders += _root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.HeaderMatcher](_input__)
        case 82 =>
          __retriableRequestHeaders += _root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.HeaderMatcher](_input__)
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.envoy.config.route.v3.RetryPolicy(
        retryOn = __retryOn,
        numRetries = __numRetries,
        perTryTimeout = __perTryTimeout,
        perTryIdleTimeout = __perTryIdleTimeout,
        retryPriority = __retryPriority,
        retryHostPredicate = __retryHostPredicate.result(),
        retryOptionsPredicates = __retryOptionsPredicates.result(),
        hostSelectionRetryMaxAttempts = __hostSelectionRetryMaxAttempts,
        retriableStatusCodes = __retriableStatusCodes.result(),
        retryBackOff = __retryBackOff,
        rateLimitedRetryBackOff = __rateLimitedRetryBackOff,
        retriableHeaders = __retriableHeaders.result(),
        retriableRequestHeaders = __retriableRequestHeaders.result(),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy] = _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.route.v3.RetryPolicy(
        retryOn = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        numRetries = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.wrappers.UInt32Value]]).map(io.envoyproxy.envoy.config.route.v3.RetryPolicy._typemapper_numRetries.toCustom(_)),
        perTryTimeout = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
        perTryIdleTimeout = __fieldsMap.get(scalaDescriptor.findFieldByNumber(13).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
        retryPriority = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority]]),
        retryHostPredicate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]]).getOrElse(_root_.scala.Seq.empty),
        retryOptionsPredicates = __fieldsMap.get(scalaDescriptor.findFieldByNumber(12).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig]]).getOrElse(_root_.scala.Seq.empty),
        hostSelectionRetryMaxAttempts = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        retriableStatusCodes = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Seq[_root_.scala.Int]]).getOrElse(_root_.scala.Seq.empty),
        retryBackOff = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff]]),
        rateLimitedRetryBackOff = __fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff]]),
        retriableHeaders = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]]).getOrElse(_root_.scala.Seq.empty),
        retriableRequestHeaders = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]]).getOrElse(_root_.scala.Seq.empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = RouteComponentsProto.javaDescriptor.getMessageTypes().get(8)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = RouteComponentsProto.scalaDescriptor.messages(8)
  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.wrappers.UInt32Value
      case 3 => __out = com.google.protobuf.duration.Duration
      case 13 => __out = com.google.protobuf.duration.Duration
      case 4 => __out = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority
      case 5 => __out = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate
      case 12 => __out = io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig
      case 8 => __out = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff
      case 11 => __out = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
      case 9 => __out = io.envoyproxy.envoy.config.route.v3.HeaderMatcher
      case 10 => __out = io.envoyproxy.envoy.config.route.v3.HeaderMatcher
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
    Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
      _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority,
      _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate,
      _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff,
      _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader,
      _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
    )
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = io.envoyproxy.envoy.config.route.v3.RetryPolicy(
    retryOn = "",
    numRetries = _root_.scala.None,
    perTryTimeout = _root_.scala.None,
    perTryIdleTimeout = _root_.scala.None,
    retryPriority = _root_.scala.None,
    retryHostPredicate = _root_.scala.Seq.empty,
    retryOptionsPredicates = _root_.scala.Seq.empty,
    hostSelectionRetryMaxAttempts = 0L,
    retriableStatusCodes = _root_.scala.Seq.empty,
    retryBackOff = _root_.scala.None,
    rateLimitedRetryBackOff = _root_.scala.None,
    retriableHeaders = _root_.scala.Seq.empty,
    retriableRequestHeaders = _root_.scala.Seq.empty
  )
  sealed abstract class ResetHeaderFormat(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
    type EnumType = ResetHeaderFormat
    def isSeconds: _root_.scala.Boolean = false
    def isUnixTimestamp: _root_.scala.Boolean = false
    def companion: _root_.scalapb.GeneratedEnumCompanion[ResetHeaderFormat] = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat
    final def asRecognized: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.Recognized])
  }
  
  object ResetHeaderFormat extends _root_.scalapb.GeneratedEnumCompanion[ResetHeaderFormat] {
    sealed trait Recognized extends ResetHeaderFormat
    implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[ResetHeaderFormat] = this
    
    @SerialVersionUID(0L)
    case object SECONDS extends ResetHeaderFormat(0) with ResetHeaderFormat.Recognized {
      val index = 0
      val name = "SECONDS"
      override def isSeconds: _root_.scala.Boolean = true
    }
    
    @SerialVersionUID(0L)
    case object UNIX_TIMESTAMP extends ResetHeaderFormat(1) with ResetHeaderFormat.Recognized {
      val index = 1
      val name = "UNIX_TIMESTAMP"
      override def isUnixTimestamp: _root_.scala.Boolean = true
    }
    
    @SerialVersionUID(0L)
    final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends ResetHeaderFormat(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
    lazy val values = scala.collection.immutable.Seq(SECONDS, UNIX_TIMESTAMP)
    def fromValue(__value: _root_.scala.Int): ResetHeaderFormat = __value match {
      case 0 => SECONDS
      case 1 => UNIX_TIMESTAMP
      case __other => Unrecognized(__other)
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getEnumTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.enums(0)
  }
  @SerialVersionUID(0L)
  final case class RetryPriority(
      name: _root_.scala.Predef.String = "",
      configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.Empty,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RetryPriority] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = name
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
          }
        };
        if (configType.typedConfig.isDefined) {
          val __value = configType.typedConfig.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 = name
          if (!__v.isEmpty) {
            _output__.writeString(1, __v)
          }
        };
        configType.typedConfig.foreach { __v =>
          val __m = __v
          _output__.writeTag(3, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def withName(__v: _root_.scala.Predef.String): RetryPriority = copy(name = __v)
      def getTypedConfig: com.google.protobuf.any.Any = configType.typedConfig.getOrElse(com.google.protobuf.any.Any.defaultInstance)
      def withTypedConfig(__v: com.google.protobuf.any.Any): RetryPriority = copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.TypedConfig(__v))
      def clearConfigType: RetryPriority = copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.Empty)
      def withConfigType(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType): RetryPriority = copy(configType = __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 = name
            if (__t != "") __t else null
          }
          case 3 => configType.typedConfig.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.PString(name)
          case 3 => configType.typedConfig.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority
      // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy.RetryPriority])
  }
  
  object RetryPriority extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority = {
      var __name: _root_.scala.Predef.String = ""
      var __configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.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 =>
            __name = _input__.readStringRequireUtf8()
          case 26 =>
            __configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.TypedConfig(__configType.typedConfig.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.any.Any](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority(
          name = __name,
          configType = __configType,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] = _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.route.v3.RetryPolicy.RetryPriority(
          name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          configType = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.any.Any]]).map(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.TypedConfig(_))
              .getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.Empty)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getNestedTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.nestedMessages(0)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
      (__number: @_root_.scala.unchecked) match {
        case 3 => __out = com.google.protobuf.any.Any
      }
      __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.route.v3.RetryPolicy.RetryPriority(
      name = "",
      configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.Empty
    )
    sealed trait ConfigType extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isTypedConfig: _root_.scala.Boolean = false
      def typedConfig: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None
    }
    object ConfigType {
      @SerialVersionUID(0L)
      case object Empty extends io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType {
        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 TypedConfig(value: com.google.protobuf.any.Any) extends io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType {
        type ValueType = com.google.protobuf.any.Any
        override def isTypedConfig: _root_.scala.Boolean = true
        override def typedConfig: _root_.scala.Option[com.google.protobuf.any.Any] = Some(value)
        override def number: _root_.scala.Int = 3
      }
    }
    implicit class RetryPriorityLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority](_l) {
      def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_))
      def typedConfig: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.any.Any] = field(_.getTypedConfig)((c_, f_) => c_.copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType.TypedConfig(f_)))
      def configType: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType] = field(_.configType)((c_, f_) => c_.copy(configType = f_))
    }
    final val NAME_FIELD_NUMBER = 1
    final val TYPED_CONFIG_FIELD_NUMBER = 3
    def of(
      name: _root_.scala.Predef.String,
      configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority.ConfigType
    ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority(
      name,
      configType
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy.RetryPriority])
  }
  
  @SerialVersionUID(0L)
  final case class RetryHostPredicate(
      name: _root_.scala.Predef.String = "",
      configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.Empty,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RetryHostPredicate] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = name
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
          }
        };
        if (configType.typedConfig.isDefined) {
          val __value = configType.typedConfig.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 = name
          if (!__v.isEmpty) {
            _output__.writeString(1, __v)
          }
        };
        configType.typedConfig.foreach { __v =>
          val __m = __v
          _output__.writeTag(3, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def withName(__v: _root_.scala.Predef.String): RetryHostPredicate = copy(name = __v)
      def getTypedConfig: com.google.protobuf.any.Any = configType.typedConfig.getOrElse(com.google.protobuf.any.Any.defaultInstance)
      def withTypedConfig(__v: com.google.protobuf.any.Any): RetryHostPredicate = copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.TypedConfig(__v))
      def clearConfigType: RetryHostPredicate = copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.Empty)
      def withConfigType(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType): RetryHostPredicate = copy(configType = __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 = name
            if (__t != "") __t else null
          }
          case 3 => configType.typedConfig.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.PString(name)
          case 3 => configType.typedConfig.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate
      // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy.RetryHostPredicate])
  }
  
  object RetryHostPredicate extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate = {
      var __name: _root_.scala.Predef.String = ""
      var __configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.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 =>
            __name = _input__.readStringRequireUtf8()
          case 26 =>
            __configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.TypedConfig(__configType.typedConfig.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.any.Any](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate(
          name = __name,
          configType = __configType,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate] = _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.route.v3.RetryPolicy.RetryHostPredicate(
          name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          configType = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.any.Any]]).map(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.TypedConfig(_))
              .getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.Empty)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getNestedTypes().get(1)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.nestedMessages(1)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
      (__number: @_root_.scala.unchecked) match {
        case 3 => __out = com.google.protobuf.any.Any
      }
      __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.route.v3.RetryPolicy.RetryHostPredicate(
      name = "",
      configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.Empty
    )
    sealed trait ConfigType extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isTypedConfig: _root_.scala.Boolean = false
      def typedConfig: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None
    }
    object ConfigType {
      @SerialVersionUID(0L)
      case object Empty extends io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType {
        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 TypedConfig(value: com.google.protobuf.any.Any) extends io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType {
        type ValueType = com.google.protobuf.any.Any
        override def isTypedConfig: _root_.scala.Boolean = true
        override def typedConfig: _root_.scala.Option[com.google.protobuf.any.Any] = Some(value)
        override def number: _root_.scala.Int = 3
      }
    }
    implicit class RetryHostPredicateLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate](_l) {
      def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_))
      def typedConfig: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.any.Any] = field(_.getTypedConfig)((c_, f_) => c_.copy(configType = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType.TypedConfig(f_)))
      def configType: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType] = field(_.configType)((c_, f_) => c_.copy(configType = f_))
    }
    final val NAME_FIELD_NUMBER = 1
    final val TYPED_CONFIG_FIELD_NUMBER = 3
    def of(
      name: _root_.scala.Predef.String,
      configType: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate.ConfigType
    ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate(
      name,
      configType
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy.RetryHostPredicate])
  }
  
  /** @param baseInterval
    *   Specifies the base interval between retries. This parameter is required and must be greater
    *   than zero. Values less than 1 ms are rounded up to 1 ms.
    *   See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion of Envoy's
    *   back-off algorithm.
    * @param maxInterval
    *   Specifies the maximum interval between retries. This parameter is optional, but must be
    *   greater than or equal to the `base_interval` if set. The default is 10 times the
    *   `base_interval`. See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion
    *   of Envoy's back-off algorithm.
    */
  @SerialVersionUID(0L)
  final case class RetryBackOff(
      baseInterval: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None,
      maxInterval: _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[RetryBackOff] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        if (baseInterval.isDefined) {
          val __value = baseInterval.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (maxInterval.isDefined) {
          val __value = maxInterval.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 = {
        baseInterval.foreach { __v =>
          val __m = __v
          _output__.writeTag(1, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        maxInterval.foreach { __v =>
          val __m = __v
          _output__.writeTag(2, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def getBaseInterval: com.google.protobuf.duration.Duration = baseInterval.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
      def clearBaseInterval: RetryBackOff = copy(baseInterval = _root_.scala.None)
      def withBaseInterval(__v: com.google.protobuf.duration.Duration): RetryBackOff = copy(baseInterval = Option(__v))
      def getMaxInterval: com.google.protobuf.duration.Duration = maxInterval.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
      def clearMaxInterval: RetryBackOff = copy(maxInterval = _root_.scala.None)
      def withMaxInterval(__v: com.google.protobuf.duration.Duration): RetryBackOff = copy(maxInterval = 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 => baseInterval.orNull
          case 2 => maxInterval.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 => baseInterval.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 2 => maxInterval.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff
      // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy.RetryBackOff])
  }
  
  object RetryBackOff extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff = {
      var __baseInterval: _root_.scala.Option[com.google.protobuf.duration.Duration] = _root_.scala.None
      var __maxInterval: _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 10 =>
            __baseInterval = Option(__baseInterval.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.duration.Duration](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 18 =>
            __maxInterval = Option(__maxInterval.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.envoy.config.route.v3.RetryPolicy.RetryBackOff(
          baseInterval = __baseInterval,
          maxInterval = __maxInterval,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] = _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.route.v3.RetryPolicy.RetryBackOff(
          baseInterval = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.duration.Duration]]),
          maxInterval = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).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 = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getNestedTypes().get(2)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.nestedMessages(2)
    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
      }
      __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.route.v3.RetryPolicy.RetryBackOff(
      baseInterval = _root_.scala.None,
      maxInterval = _root_.scala.None
    )
    implicit class RetryBackOffLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff](_l) {
      def baseInterval: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getBaseInterval)((c_, f_) => c_.copy(baseInterval = Option(f_)))
      def optionalBaseInterval: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.baseInterval)((c_, f_) => c_.copy(baseInterval = f_))
      def maxInterval: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getMaxInterval)((c_, f_) => c_.copy(maxInterval = Option(f_)))
      def optionalMaxInterval: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.maxInterval)((c_, f_) => c_.copy(maxInterval = f_))
    }
    final val BASE_INTERVAL_FIELD_NUMBER = 1
    final val MAX_INTERVAL_FIELD_NUMBER = 2
    def of(
      baseInterval: _root_.scala.Option[com.google.protobuf.duration.Duration],
      maxInterval: _root_.scala.Option[com.google.protobuf.duration.Duration]
    ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff(
      baseInterval,
      maxInterval
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy.RetryBackOff])
  }
  
  /** @param name
    *   The name of the reset header.
    *  
    *   .. note::
    *  
    *     If the header appears multiple times only the first value is used.
    * @param format
    *   The format of the reset header.
    */
  @SerialVersionUID(0L)
  final case class ResetHeader(
      name: _root_.scala.Predef.String = "",
      format: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.SECONDS,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ResetHeader] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = name
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
          }
        };
        
        {
          val __value = format.value
          if (__value != 0) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(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 = {
        {
          val __v = name
          if (!__v.isEmpty) {
            _output__.writeString(1, __v)
          }
        };
        {
          val __v = format.value
          if (__v != 0) {
            _output__.writeEnum(2, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def withName(__v: _root_.scala.Predef.String): ResetHeader = copy(name = __v)
      def withFormat(__v: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat): ResetHeader = copy(format = __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 = name
            if (__t != "") __t else null
          }
          case 2 => {
            val __t = format.javaValueDescriptor
            if (__t.getNumber() != 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 => _root_.scalapb.descriptors.PString(name)
          case 2 => _root_.scalapb.descriptors.PEnum(format.scalaValueDescriptor)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader
      // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy.ResetHeader])
  }
  
  object ResetHeader extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader = {
      var __name: _root_.scala.Predef.String = ""
      var __format: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.SECONDS
      var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
      var _done__ = false
      while (!_done__) {
        val _tag__ = _input__.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 10 =>
            __name = _input__.readStringRequireUtf8()
          case 16 =>
            __format = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.fromValue(_input__.readEnum())
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader(
          name = __name,
          format = __format,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader] = _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.route.v3.RetryPolicy.ResetHeader(
          name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          format = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.SECONDS.scalaValueDescriptor).number)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getNestedTypes().get(3)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.nestedMessages(3)
    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[_] = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 2 => io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat
      }
    }
    lazy val defaultInstance = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader(
      name = "",
      format = io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat.SECONDS
    )
    implicit class ResetHeaderLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader](_l) {
      def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_))
      def format: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat] = field(_.format)((c_, f_) => c_.copy(format = f_))
    }
    final val NAME_FIELD_NUMBER = 1
    final val FORMAT_FIELD_NUMBER = 2
    def of(
      name: _root_.scala.Predef.String,
      format: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeaderFormat
    ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader(
      name,
      format
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy.ResetHeader])
  }
  
  /** A retry back-off strategy that applies when the upstream server rate limits
    * the request.
    *
    * Given this configuration:
    *
    * .. code-block:: yaml
    *
    *   rate_limited_retry_back_off:
    *     reset_headers:
    *     - name: Retry-After
    *       format: SECONDS
    *     - name: X-RateLimit-Reset
    *       format: UNIX_TIMESTAMP
    *     max_interval: "300s"
    *
    * The following algorithm will apply:
    *
    *  1. If the response contains the header ``Retry-After`` its value must be on
    *     the form ``120`` (an integer that represents the number of seconds to
    *     wait before retrying). If so, this value is used as the back-off interval.
    *  2. Otherwise, if the response contains the header ``X-RateLimit-Reset`` its
    *     value must be on the form ``1595320702`` (an integer that represents the
    *     point in time at which to retry, as a Unix timestamp in seconds). If so,
    *     the current time is subtracted from this value and the result is used as
    *     the back-off interval.
    *  3. Otherwise, Envoy will use the default
    *     :ref:`exponential back-off <envoy_v3_api_field_config.route.v3.RetryPolicy.retry_back_off>`
    *     strategy.
    *
    * No matter which format is used, if the resulting back-off interval exceeds
    * ``max_interval`` it is discarded and the next header in ``reset_headers``
    * is tried. If a request timeout is configured for the route it will further
    * limit how long the request will be allowed to run.
    *
    * To prevent many clients retrying at the same point in time jitter is added
    * to the back-off interval, so the resulting interval is decided by taking:
    * ``random(interval, interval * 1.5)``.
    *
    * .. attention::
    *
    *   Configuring ``rate_limited_retry_back_off`` will not by itself cause a request
    *   to be retried. You will still need to configure the right retry policy to match
    *   the responses from the upstream server.
    *
    * @param resetHeaders
    *   Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``)
    *   to match against the response. Headers are tried in order, and matched case
    *   insensitive. The first header to be parsed successfully is used. If no headers
    *   match the default exponential back-off is used instead.
    * @param maxInterval
    *   Specifies the maximum back off interval that Envoy will allow. If a reset
    *   header contains an interval longer than this then it will be discarded and
    *   the next header will be tried. Defaults to 300 seconds.
    */
  @SerialVersionUID(0L)
  final case class RateLimitedRetryBackOff(
      resetHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader] = _root_.scala.Seq.empty,
      maxInterval: _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[RateLimitedRetryBackOff] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        resetHeaders.foreach { __item =>
          val __value = __item
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        }
        if (maxInterval.isDefined) {
          val __value = maxInterval.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 = {
        resetHeaders.foreach { __v =>
          val __m = __v
          _output__.writeTag(1, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        maxInterval.foreach { __v =>
          val __m = __v
          _output__.writeTag(2, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def clearResetHeaders = copy(resetHeaders = _root_.scala.Seq.empty)
      def addResetHeaders(__vs: io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader *): RateLimitedRetryBackOff = addAllResetHeaders(__vs)
      def addAllResetHeaders(__vs: Iterable[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]): RateLimitedRetryBackOff = copy(resetHeaders = resetHeaders ++ __vs)
      def withResetHeaders(__v: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]): RateLimitedRetryBackOff = copy(resetHeaders = __v)
      def getMaxInterval: com.google.protobuf.duration.Duration = maxInterval.getOrElse(com.google.protobuf.duration.Duration.defaultInstance)
      def clearMaxInterval: RateLimitedRetryBackOff = copy(maxInterval = _root_.scala.None)
      def withMaxInterval(__v: com.google.protobuf.duration.Duration): RateLimitedRetryBackOff = copy(maxInterval = 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 => resetHeaders
          case 2 => maxInterval.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.PRepeated(resetHeaders.iterator.map(_.toPMessage).toVector)
          case 2 => maxInterval.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff.type = io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff
      // @@protoc_insertion_point(GeneratedMessage[envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff])
  }
  
  object RateLimitedRetryBackOff extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff = {
      val __resetHeaders: _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader] = new _root_.scala.collection.immutable.VectorBuilder[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]
      var __maxInterval: _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 10 =>
            __resetHeaders += _root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader](_input__)
          case 18 =>
            __maxInterval = Option(__maxInterval.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.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff(
          resetHeaders = __resetHeaders.result(),
          maxInterval = __maxInterval,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] = _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.route.v3.RetryPolicy.RateLimitedRetryBackOff(
          resetHeaders = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]]).getOrElse(_root_.scala.Seq.empty),
          maxInterval = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).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 = io.envoyproxy.envoy.config.route.v3.RetryPolicy.javaDescriptor.getNestedTypes().get(4)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.config.route.v3.RetryPolicy.scalaDescriptor.nestedMessages(4)
    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.config.route.v3.RetryPolicy.ResetHeader
        case 2 => __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.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff(
      resetHeaders = _root_.scala.Seq.empty,
      maxInterval = _root_.scala.None
    )
    implicit class RateLimitedRetryBackOffLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff](_l) {
      def resetHeaders: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader]] = field(_.resetHeaders)((c_, f_) => c_.copy(resetHeaders = f_))
      def maxInterval: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getMaxInterval)((c_, f_) => c_.copy(maxInterval = Option(f_)))
      def optionalMaxInterval: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.maxInterval)((c_, f_) => c_.copy(maxInterval = f_))
    }
    final val RESET_HEADERS_FIELD_NUMBER = 1
    final val MAX_INTERVAL_FIELD_NUMBER = 2
    def of(
      resetHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.ResetHeader],
      maxInterval: _root_.scala.Option[com.google.protobuf.duration.Duration]
    ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff(
      resetHeaders,
      maxInterval
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff])
  }
  
  implicit class RetryPolicyLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy](_l) {
    def retryOn: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.retryOn)((c_, f_) => c_.copy(retryOn = f_))
    def numRetries: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getNumRetries)((c_, f_) => c_.copy(numRetries = Option(f_)))
    def optionalNumRetries: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Int]] = field(_.numRetries)((c_, f_) => c_.copy(numRetries = f_))
    def perTryTimeout: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getPerTryTimeout)((c_, f_) => c_.copy(perTryTimeout = Option(f_)))
    def optionalPerTryTimeout: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.perTryTimeout)((c_, f_) => c_.copy(perTryTimeout = f_))
    def perTryIdleTimeout: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.duration.Duration] = field(_.getPerTryIdleTimeout)((c_, f_) => c_.copy(perTryIdleTimeout = Option(f_)))
    def optionalPerTryIdleTimeout: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.duration.Duration]] = field(_.perTryIdleTimeout)((c_, f_) => c_.copy(perTryIdleTimeout = f_))
    def retryPriority: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority] = field(_.getRetryPriority)((c_, f_) => c_.copy(retryPriority = Option(f_)))
    def optionalRetryPriority: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority]] = field(_.retryPriority)((c_, f_) => c_.copy(retryPriority = f_))
    def retryHostPredicate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate]] = field(_.retryHostPredicate)((c_, f_) => c_.copy(retryHostPredicate = f_))
    def retryOptionsPredicates: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig]] = field(_.retryOptionsPredicates)((c_, f_) => c_.copy(retryOptionsPredicates = f_))
    def hostSelectionRetryMaxAttempts: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.hostSelectionRetryMaxAttempts)((c_, f_) => c_.copy(hostSelectionRetryMaxAttempts = f_))
    def retriableStatusCodes: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Int]] = field(_.retriableStatusCodes)((c_, f_) => c_.copy(retriableStatusCodes = f_))
    def retryBackOff: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff] = field(_.getRetryBackOff)((c_, f_) => c_.copy(retryBackOff = Option(f_)))
    def optionalRetryBackOff: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff]] = field(_.retryBackOff)((c_, f_) => c_.copy(retryBackOff = f_))
    def rateLimitedRetryBackOff: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff] = field(_.getRateLimitedRetryBackOff)((c_, f_) => c_.copy(rateLimitedRetryBackOff = Option(f_)))
    def optionalRateLimitedRetryBackOff: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff]] = field(_.rateLimitedRetryBackOff)((c_, f_) => c_.copy(rateLimitedRetryBackOff = f_))
    def retriableHeaders: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]] = field(_.retriableHeaders)((c_, f_) => c_.copy(retriableHeaders = f_))
    def retriableRequestHeaders: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]] = field(_.retriableRequestHeaders)((c_, f_) => c_.copy(retriableRequestHeaders = f_))
  }
  final val RETRY_ON_FIELD_NUMBER = 1
  final val NUM_RETRIES_FIELD_NUMBER = 2
  final val PER_TRY_TIMEOUT_FIELD_NUMBER = 3
  final val PER_TRY_IDLE_TIMEOUT_FIELD_NUMBER = 13
  final val RETRY_PRIORITY_FIELD_NUMBER = 4
  final val RETRY_HOST_PREDICATE_FIELD_NUMBER = 5
  final val RETRY_OPTIONS_PREDICATES_FIELD_NUMBER = 12
  final val HOST_SELECTION_RETRY_MAX_ATTEMPTS_FIELD_NUMBER = 6
  final val RETRIABLE_STATUS_CODES_FIELD_NUMBER = 7
  final val RETRY_BACK_OFF_FIELD_NUMBER = 8
  final val RATE_LIMITED_RETRY_BACK_OFF_FIELD_NUMBER = 11
  final val RETRIABLE_HEADERS_FIELD_NUMBER = 9
  final val RETRIABLE_REQUEST_HEADERS_FIELD_NUMBER = 10
  @transient
  private[v3] val _typemapper_numRetries: _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(
    retryOn: _root_.scala.Predef.String,
    numRetries: _root_.scala.Option[_root_.scala.Int],
    perTryTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration],
    perTryIdleTimeout: _root_.scala.Option[com.google.protobuf.duration.Duration],
    retryPriority: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryPriority],
    retryHostPredicate: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryHostPredicate],
    retryOptionsPredicates: _root_.scala.Seq[io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig],
    hostSelectionRetryMaxAttempts: _root_.scala.Long,
    retriableStatusCodes: _root_.scala.Seq[_root_.scala.Int],
    retryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RetryBackOff],
    rateLimitedRetryBackOff: _root_.scala.Option[io.envoyproxy.envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff],
    retriableHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher],
    retriableRequestHeaders: _root_.scala.Seq[io.envoyproxy.envoy.config.route.v3.HeaderMatcher]
  ): _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy = _root_.io.envoyproxy.envoy.config.route.v3.RetryPolicy(
    retryOn,
    numRetries,
    perTryTimeout,
    perTryIdleTimeout,
    retryPriority,
    retryHostPredicate,
    retryOptionsPredicates,
    hostSelectionRetryMaxAttempts,
    retriableStatusCodes,
    retryBackOff,
    rateLimitedRetryBackOff,
    retriableHeaders,
    retriableRequestHeaders
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.config.route.v3.RetryPolicy])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy