#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateLimitConfig {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub domain: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub descriptors: ::prost::alloc::vec::Vec<RateLimitDescriptor>,
}
impl ::prost::Name for RateLimitConfig {
const NAME: &'static str = "RateLimitConfig";
const PACKAGE: &'static str = "ratelimit.config.ratelimit.v3";
fn full_name() -> ::prost::alloc::string::String {
"ratelimit.config.ratelimit.v3.RateLimitConfig".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitConfig".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateLimitDescriptor {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub rate_limit: ::core::option::Option<RateLimitPolicy>,
#[prost(message, repeated, tag = "4")]
pub descriptors: ::prost::alloc::vec::Vec<RateLimitDescriptor>,
#[prost(bool, tag = "5")]
pub shadow_mode: bool,
#[prost(bool, tag = "6")]
pub detailed_metric: bool,
#[prost(bool, tag = "7")]
pub quota_mode: bool,
}
impl ::prost::Name for RateLimitDescriptor {
const NAME: &'static str = "RateLimitDescriptor";
const PACKAGE: &'static str = "ratelimit.config.ratelimit.v3";
fn full_name() -> ::prost::alloc::string::String {
"ratelimit.config.ratelimit.v3.RateLimitDescriptor".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitDescriptor".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateLimitPolicy {
#[prost(enumeration = "RateLimitUnit", tag = "1")]
pub unit: i32,
#[prost(uint32, tag = "2")]
pub requests_per_unit: u32,
#[prost(bool, tag = "3")]
pub unlimited: bool,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub replaces: ::prost::alloc::vec::Vec<RateLimitReplace>,
}
impl ::prost::Name for RateLimitPolicy {
const NAME: &'static str = "RateLimitPolicy";
const PACKAGE: &'static str = "ratelimit.config.ratelimit.v3";
fn full_name() -> ::prost::alloc::string::String {
"ratelimit.config.ratelimit.v3.RateLimitPolicy".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitPolicy".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RateLimitReplace {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
impl ::prost::Name for RateLimitReplace {
const NAME: &'static str = "RateLimitReplace";
const PACKAGE: &'static str = "ratelimit.config.ratelimit.v3";
fn full_name() -> ::prost::alloc::string::String {
"ratelimit.config.ratelimit.v3.RateLimitReplace".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/ratelimit.config.ratelimit.v3.RateLimitReplace".into()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RateLimitUnit {
Unknown = 0,
Second = 1,
Minute = 2,
Hour = 3,
Day = 4,
Week = 7,
Month = 5,
Year = 6,
}
impl RateLimitUnit {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Second => "SECOND",
Self::Minute => "MINUTE",
Self::Hour => "HOUR",
Self::Day => "DAY",
Self::Week => "WEEK",
Self::Month => "MONTH",
Self::Year => "YEAR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SECOND" => Some(Self::Second),
"MINUTE" => Some(Self::Minute),
"HOUR" => Some(Self::Hour),
"DAY" => Some(Self::Day),
"WEEK" => Some(Self::Week),
"MONTH" => Some(Self::Month),
"YEAR" => Some(Self::Year),
_ => None,
}
}
}