io.envoyproxy.envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of envoy-scala-control-plane_2.13 Show documentation
Show all versions of envoy-scala-control-plane_2.13 Show documentation
ScalaPB generated bindings for Envoy
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package io.envoyproxy.envoy.extensions.common.ratelimit.v3
/** Defines the version of the standard to use for X-RateLimit headers.
*/
sealed abstract class XRateLimitHeadersRFCVersion(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
type EnumType = XRateLimitHeadersRFCVersion
def isOff: _root_.scala.Boolean = false
def isDraftVersion03: _root_.scala.Boolean = false
def companion: _root_.scalapb.GeneratedEnumCompanion[XRateLimitHeadersRFCVersion] = io.envoyproxy.envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion
final def asRecognized: _root_.scala.Option[io.envoyproxy.envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[io.envoyproxy.envoy.extensions.common.ratelimit.v3.XRateLimitHeadersRFCVersion.Recognized])
}
object XRateLimitHeadersRFCVersion extends _root_.scalapb.GeneratedEnumCompanion[XRateLimitHeadersRFCVersion] {
sealed trait Recognized extends XRateLimitHeadersRFCVersion
implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[XRateLimitHeadersRFCVersion] = this
/** X-RateLimit headers disabled.
*/
@SerialVersionUID(0L)
case object OFF extends XRateLimitHeadersRFCVersion(0) with XRateLimitHeadersRFCVersion.Recognized {
val index = 0
val name = "OFF"
override def isOff: _root_.scala.Boolean = true
}
/** Use `draft RFC Version 03 <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_ where 3 headers will be added:
*
* * ``X-RateLimit-Limit`` - indicates the request-quota associated to the
* client in the current time-window followed by the description of the
* quota policy. The value is returned by the maximum tokens of the token bucket.
* * ``X-RateLimit-Remaining`` - indicates the remaining requests in the
* current time-window. The value is returned by the remaining tokens in the token bucket.
* * ``X-RateLimit-Reset`` - indicates the number of seconds until reset of
* the current time-window. The value is returned by the remaining fill interval of the token bucket.
*/
@SerialVersionUID(0L)
case object DRAFT_VERSION_03 extends XRateLimitHeadersRFCVersion(1) with XRateLimitHeadersRFCVersion.Recognized {
val index = 1
val name = "DRAFT_VERSION_03"
override def isDraftVersion03: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends XRateLimitHeadersRFCVersion(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
lazy val values = scala.collection.immutable.Seq(OFF, DRAFT_VERSION_03)
def fromValue(__value: _root_.scala.Int): XRateLimitHeadersRFCVersion = __value match {
case 0 => OFF
case 1 => DRAFT_VERSION_03
case __other => Unrecognized(__other)
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = RatelimitProto.javaDescriptor.getEnumTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = RatelimitProto.scalaDescriptor.enums(0)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy