#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate bytes;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Authentication {
pub rules: std::vec::Vec<crate::model::AuthenticationRule>,
pub providers: std::vec::Vec<crate::model::AuthProvider>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Authentication {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuthenticationRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuthProvider>,
{
use std::iter::Iterator;
self.providers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Authentication {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Authentication"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthenticationRule {
pub selector: std::string::String,
pub oauth: std::option::Option<crate::model::OAuthRequirements>,
pub allow_without_credential: bool,
pub requirements: std::vec::Vec<crate::model::AuthRequirement>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthenticationRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_oauth<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OAuthRequirements>,
{
self.oauth = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_oauth<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OAuthRequirements>,
{
self.oauth = v.map(|x| x.into());
self
}
pub fn set_allow_without_credential<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_without_credential = v.into();
self
}
pub fn set_requirements<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuthRequirement>,
{
use std::iter::Iterator;
self.requirements = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AuthenticationRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.AuthenticationRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JwtLocation {
pub value_prefix: std::string::String,
pub r#in: std::option::Option<crate::model::jwt_location::In>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JwtLocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value_prefix = v.into();
self
}
pub fn set_in<T: std::convert::Into<std::option::Option<crate::model::jwt_location::In>>>(
mut self,
v: T,
) -> Self {
self.r#in = v.into();
self
}
pub fn header(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.r#in.as_ref().and_then(|v| match v {
crate::model::jwt_location::In::Header(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_header<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#in = std::option::Option::Some(crate::model::jwt_location::In::Header(v.into()));
self
}
pub fn query(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.r#in.as_ref().and_then(|v| match v {
crate::model::jwt_location::In::Query(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#in = std::option::Option::Some(crate::model::jwt_location::In::Query(v.into()));
self
}
pub fn cookie(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.r#in.as_ref().and_then(|v| match v {
crate::model::jwt_location::In::Cookie(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cookie<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#in = std::option::Option::Some(crate::model::jwt_location::In::Cookie(v.into()));
self
}
}
impl wkt::message::Message for JwtLocation {
fn typename() -> &'static str {
"type.googleapis.com/google.api.JwtLocation"
}
}
pub mod jwt_location {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum In {
Header(std::string::String),
Query(std::string::String),
Cookie(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthProvider {
pub id: std::string::String,
pub issuer: std::string::String,
pub jwks_uri: std::string::String,
pub audiences: std::string::String,
pub authorization_url: std::string::String,
pub jwt_locations: std::vec::Vec<crate::model::JwtLocation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthProvider {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issuer = v.into();
self
}
pub fn set_jwks_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.jwks_uri = v.into();
self
}
pub fn set_audiences<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audiences = v.into();
self
}
pub fn set_authorization_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.authorization_url = v.into();
self
}
pub fn set_jwt_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::JwtLocation>,
{
use std::iter::Iterator;
self.jwt_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AuthProvider {
fn typename() -> &'static str {
"type.googleapis.com/google.api.AuthProvider"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OAuthRequirements {
pub canonical_scopes: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OAuthRequirements {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_canonical_scopes<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.canonical_scopes = v.into();
self
}
}
impl wkt::message::Message for OAuthRequirements {
fn typename() -> &'static str {
"type.googleapis.com/google.api.OAuthRequirements"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthRequirement {
pub provider_id: std::string::String,
pub audiences: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthRequirement {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_provider_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.provider_id = v.into();
self
}
pub fn set_audiences<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audiences = v.into();
self
}
}
impl wkt::message::Message for AuthRequirement {
fn typename() -> &'static str {
"type.googleapis.com/google.api.AuthRequirement"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Backend {
pub rules: std::vec::Vec<crate::model::BackendRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Backend {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackendRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Backend {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Backend"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackendRule {
pub selector: std::string::String,
pub address: std::string::String,
pub deadline: f64,
#[deprecated]
pub min_deadline: f64,
pub operation_deadline: f64,
pub path_translation: crate::model::backend_rule::PathTranslation,
pub protocol: std::string::String,
pub overrides_by_request_protocol:
std::collections::HashMap<std::string::String, crate::model::BackendRule>,
pub load_balancing_policy: std::string::String,
pub authentication: std::option::Option<crate::model::backend_rule::Authentication>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackendRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.address = v.into();
self
}
pub fn set_deadline<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.deadline = v.into();
self
}
#[deprecated]
pub fn set_min_deadline<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.min_deadline = v.into();
self
}
pub fn set_operation_deadline<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.operation_deadline = v.into();
self
}
pub fn set_path_translation<
T: std::convert::Into<crate::model::backend_rule::PathTranslation>,
>(
mut self,
v: T,
) -> Self {
self.path_translation = v.into();
self
}
pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.protocol = v.into();
self
}
pub fn set_overrides_by_request_protocol<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::BackendRule>,
{
use std::iter::Iterator;
self.overrides_by_request_protocol =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_load_balancing_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.load_balancing_policy = v.into();
self
}
pub fn set_authentication<
T: std::convert::Into<std::option::Option<crate::model::backend_rule::Authentication>>,
>(
mut self,
v: T,
) -> Self {
self.authentication = v.into();
self
}
pub fn jwt_audience(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.authentication.as_ref().and_then(|v| match v {
crate::model::backend_rule::Authentication::JwtAudience(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_jwt_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.authentication = std::option::Option::Some(
crate::model::backend_rule::Authentication::JwtAudience(v.into()),
);
self
}
pub fn disable_auth(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.authentication.as_ref().and_then(|v| match v {
crate::model::backend_rule::Authentication::DisableAuth(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_disable_auth<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.authentication = std::option::Option::Some(
crate::model::backend_rule::Authentication::DisableAuth(v.into()),
);
self
}
}
impl wkt::message::Message for BackendRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.BackendRule"
}
}
pub mod backend_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PathTranslation {
Unspecified,
ConstantAddress,
AppendPathToAddress,
UnknownValue(path_translation::UnknownValue),
}
#[doc(hidden)]
pub mod path_translation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PathTranslation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ConstantAddress => std::option::Option::Some(1),
Self::AppendPathToAddress => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PATH_TRANSLATION_UNSPECIFIED"),
Self::ConstantAddress => std::option::Option::Some("CONSTANT_ADDRESS"),
Self::AppendPathToAddress => std::option::Option::Some("APPEND_PATH_TO_ADDRESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PathTranslation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PathTranslation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PathTranslation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConstantAddress,
2 => Self::AppendPathToAddress,
_ => Self::UnknownValue(path_translation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PathTranslation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PATH_TRANSLATION_UNSPECIFIED" => Self::Unspecified,
"CONSTANT_ADDRESS" => Self::ConstantAddress,
"APPEND_PATH_TO_ADDRESS" => Self::AppendPathToAddress,
_ => Self::UnknownValue(path_translation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PathTranslation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ConstantAddress => serializer.serialize_i32(1),
Self::AppendPathToAddress => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PathTranslation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PathTranslation>::new(
".google.api.BackendRule.PathTranslation",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Authentication {
JwtAudience(std::string::String),
DisableAuth(bool),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Billing {
pub consumer_destinations: std::vec::Vec<crate::model::billing::BillingDestination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Billing {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_consumer_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::billing::BillingDestination>,
{
use std::iter::Iterator;
self.consumer_destinations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Billing {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Billing"
}
}
pub mod billing {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BillingDestination {
pub monitored_resource: std::string::String,
pub metrics: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BillingDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_monitored_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.monitored_resource = v.into();
self
}
pub fn set_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.metrics = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BillingDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Billing.BillingDestination"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommonLanguageSettings {
#[deprecated]
pub reference_docs_uri: std::string::String,
pub destinations: std::vec::Vec<crate::model::ClientLibraryDestination>,
pub selective_gapic_generation: std::option::Option<crate::model::SelectiveGapicGeneration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CommonLanguageSettings {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_reference_docs_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.reference_docs_uri = v.into();
self
}
pub fn set_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ClientLibraryDestination>,
{
use std::iter::Iterator;
self.destinations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_selective_gapic_generation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SelectiveGapicGeneration>,
{
self.selective_gapic_generation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_selective_gapic_generation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SelectiveGapicGeneration>,
{
self.selective_gapic_generation = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CommonLanguageSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.CommonLanguageSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClientLibrarySettings {
pub version: std::string::String,
pub launch_stage: crate::model::LaunchStage,
pub rest_numeric_enums: bool,
pub java_settings: std::option::Option<crate::model::JavaSettings>,
pub cpp_settings: std::option::Option<crate::model::CppSettings>,
pub php_settings: std::option::Option<crate::model::PhpSettings>,
pub python_settings: std::option::Option<crate::model::PythonSettings>,
pub node_settings: std::option::Option<crate::model::NodeSettings>,
pub dotnet_settings: std::option::Option<crate::model::DotnetSettings>,
pub ruby_settings: std::option::Option<crate::model::RubySettings>,
pub go_settings: std::option::Option<crate::model::GoSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClientLibrarySettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_rest_numeric_enums<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.rest_numeric_enums = v.into();
self
}
pub fn set_java_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JavaSettings>,
{
self.java_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_java_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JavaSettings>,
{
self.java_settings = v.map(|x| x.into());
self
}
pub fn set_cpp_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CppSettings>,
{
self.cpp_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cpp_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CppSettings>,
{
self.cpp_settings = v.map(|x| x.into());
self
}
pub fn set_php_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PhpSettings>,
{
self.php_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_php_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PhpSettings>,
{
self.php_settings = v.map(|x| x.into());
self
}
pub fn set_python_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PythonSettings>,
{
self.python_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_python_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PythonSettings>,
{
self.python_settings = v.map(|x| x.into());
self
}
pub fn set_node_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSettings>,
{
self.node_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSettings>,
{
self.node_settings = v.map(|x| x.into());
self
}
pub fn set_dotnet_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DotnetSettings>,
{
self.dotnet_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dotnet_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DotnetSettings>,
{
self.dotnet_settings = v.map(|x| x.into());
self
}
pub fn set_ruby_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RubySettings>,
{
self.ruby_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ruby_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RubySettings>,
{
self.ruby_settings = v.map(|x| x.into());
self
}
pub fn set_go_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoSettings>,
{
self.go_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_go_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoSettings>,
{
self.go_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ClientLibrarySettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ClientLibrarySettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Publishing {
pub method_settings: std::vec::Vec<crate::model::MethodSettings>,
pub new_issue_uri: std::string::String,
pub documentation_uri: std::string::String,
pub api_short_name: std::string::String,
pub github_label: std::string::String,
pub codeowner_github_teams: std::vec::Vec<std::string::String>,
pub doc_tag_prefix: std::string::String,
pub organization: crate::model::ClientLibraryOrganization,
pub library_settings: std::vec::Vec<crate::model::ClientLibrarySettings>,
pub proto_reference_documentation_uri: std::string::String,
pub rest_reference_documentation_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Publishing {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_method_settings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MethodSettings>,
{
use std::iter::Iterator;
self.method_settings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_new_issue_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_issue_uri = v.into();
self
}
pub fn set_documentation_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.documentation_uri = v.into();
self
}
pub fn set_api_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_short_name = v.into();
self
}
pub fn set_github_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.github_label = v.into();
self
}
pub fn set_codeowner_github_teams<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.codeowner_github_teams = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_doc_tag_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.doc_tag_prefix = v.into();
self
}
pub fn set_organization<T: std::convert::Into<crate::model::ClientLibraryOrganization>>(
mut self,
v: T,
) -> Self {
self.organization = v.into();
self
}
pub fn set_library_settings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ClientLibrarySettings>,
{
use std::iter::Iterator;
self.library_settings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_proto_reference_documentation_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.proto_reference_documentation_uri = v.into();
self
}
pub fn set_rest_reference_documentation_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rest_reference_documentation_uri = v.into();
self
}
}
impl wkt::message::Message for Publishing {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Publishing"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JavaSettings {
pub library_package: std::string::String,
pub service_class_names: std::collections::HashMap<std::string::String, std::string::String>,
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JavaSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_library_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.library_package = v.into();
self
}
pub fn set_service_class_names<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.service_class_names = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for JavaSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.JavaSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CppSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CppSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CppSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.CppSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PhpSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub library_package: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PhpSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
pub fn set_library_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.library_package = v.into();
self
}
}
impl wkt::message::Message for PhpSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.PhpSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PythonSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub experimental_features:
std::option::Option<crate::model::python_settings::ExperimentalFeatures>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PythonSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
pub fn set_experimental_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::python_settings::ExperimentalFeatures>,
{
self.experimental_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_experimental_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::python_settings::ExperimentalFeatures>,
{
self.experimental_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PythonSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.PythonSettings"
}
}
pub mod python_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExperimentalFeatures {
pub rest_async_io_enabled: bool,
pub protobuf_pythonic_types_enabled: bool,
pub unversioned_package_disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExperimentalFeatures {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rest_async_io_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.rest_async_io_enabled = v.into();
self
}
pub fn set_protobuf_pythonic_types_enabled<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.protobuf_pythonic_types_enabled = v.into();
self
}
pub fn set_unversioned_package_disabled<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.unversioned_package_disabled = v.into();
self
}
}
impl wkt::message::Message for ExperimentalFeatures {
fn typename() -> &'static str {
"type.googleapis.com/google.api.PythonSettings.ExperimentalFeatures"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NodeSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.NodeSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DotnetSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub renamed_services: std::collections::HashMap<std::string::String, std::string::String>,
pub renamed_resources: std::collections::HashMap<std::string::String, std::string::String>,
pub ignored_resources: std::vec::Vec<std::string::String>,
pub forced_namespace_aliases: std::vec::Vec<std::string::String>,
pub handwritten_signatures: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DotnetSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
pub fn set_renamed_services<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.renamed_services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_renamed_resources<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.renamed_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_ignored_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.ignored_resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_forced_namespace_aliases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.forced_namespace_aliases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_handwritten_signatures<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.handwritten_signatures = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DotnetSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.DotnetSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RubySettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RubySettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RubySettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.RubySettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoSettings {
pub common: std::option::Option<crate::model::CommonLanguageSettings>,
pub renamed_services: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CommonLanguageSettings>,
{
self.common = v.map(|x| x.into());
self
}
pub fn set_renamed_services<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.renamed_services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for GoSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.GoSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MethodSettings {
pub selector: std::string::String,
pub long_running: std::option::Option<crate::model::method_settings::LongRunning>,
pub auto_populated_fields: std::vec::Vec<std::string::String>,
pub batching: std::option::Option<crate::model::BatchingConfigProto>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MethodSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_long_running<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::method_settings::LongRunning>,
{
self.long_running = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_long_running<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::method_settings::LongRunning>,
{
self.long_running = v.map(|x| x.into());
self
}
pub fn set_auto_populated_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.auto_populated_fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_batching<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BatchingConfigProto>,
{
self.batching = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_batching<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BatchingConfigProto>,
{
self.batching = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MethodSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MethodSettings"
}
}
pub mod method_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LongRunning {
pub initial_poll_delay: std::option::Option<wkt::Duration>,
pub poll_delay_multiplier: f32,
pub max_poll_delay: std::option::Option<wkt::Duration>,
pub total_poll_timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LongRunning {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_initial_poll_delay<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.initial_poll_delay = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_initial_poll_delay<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.initial_poll_delay = v.map(|x| x.into());
self
}
pub fn set_poll_delay_multiplier<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.poll_delay_multiplier = v.into();
self
}
pub fn set_max_poll_delay<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_poll_delay = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_poll_delay<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_poll_delay = v.map(|x| x.into());
self
}
pub fn set_total_poll_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_poll_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_total_poll_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_poll_timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for LongRunning {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MethodSettings.LongRunning"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SelectiveGapicGeneration {
pub methods: std::vec::Vec<std::string::String>,
pub generate_omitted_as_internal: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SelectiveGapicGeneration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_methods<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.methods = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_generate_omitted_as_internal<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.generate_omitted_as_internal = v.into();
self
}
}
impl wkt::message::Message for SelectiveGapicGeneration {
fn typename() -> &'static str {
"type.googleapis.com/google.api.SelectiveGapicGeneration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchingConfigProto {
pub thresholds: std::option::Option<crate::model::BatchingSettingsProto>,
pub batch_descriptor: std::option::Option<crate::model::BatchingDescriptorProto>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchingConfigProto {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_thresholds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BatchingSettingsProto>,
{
self.thresholds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BatchingSettingsProto>,
{
self.thresholds = v.map(|x| x.into());
self
}
pub fn set_batch_descriptor<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BatchingDescriptorProto>,
{
self.batch_descriptor = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_batch_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BatchingDescriptorProto>,
{
self.batch_descriptor = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BatchingConfigProto {
fn typename() -> &'static str {
"type.googleapis.com/google.api.BatchingConfigProto"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchingSettingsProto {
pub element_count_threshold: i32,
pub request_byte_threshold: i64,
pub delay_threshold: std::option::Option<wkt::Duration>,
pub element_count_limit: i32,
pub request_byte_limit: i32,
pub flow_control_element_limit: i32,
pub flow_control_byte_limit: i32,
pub flow_control_limit_exceeded_behavior: crate::model::FlowControlLimitExceededBehaviorProto,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchingSettingsProto {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_element_count_threshold<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.element_count_threshold = v.into();
self
}
pub fn set_request_byte_threshold<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.request_byte_threshold = v.into();
self
}
pub fn set_delay_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.delay_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delay_threshold<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.delay_threshold = v.map(|x| x.into());
self
}
pub fn set_element_count_limit<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.element_count_limit = v.into();
self
}
pub fn set_request_byte_limit<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.request_byte_limit = v.into();
self
}
pub fn set_flow_control_element_limit<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.flow_control_element_limit = v.into();
self
}
pub fn set_flow_control_byte_limit<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.flow_control_byte_limit = v.into();
self
}
pub fn set_flow_control_limit_exceeded_behavior<
T: std::convert::Into<crate::model::FlowControlLimitExceededBehaviorProto>,
>(
mut self,
v: T,
) -> Self {
self.flow_control_limit_exceeded_behavior = v.into();
self
}
}
impl wkt::message::Message for BatchingSettingsProto {
fn typename() -> &'static str {
"type.googleapis.com/google.api.BatchingSettingsProto"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchingDescriptorProto {
pub batched_field: std::string::String,
pub discriminator_fields: std::vec::Vec<std::string::String>,
pub subresponse_field: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchingDescriptorProto {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_batched_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.batched_field = v.into();
self
}
pub fn set_discriminator_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.discriminator_fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_subresponse_field<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.subresponse_field = v.into();
self
}
}
impl wkt::message::Message for BatchingDescriptorProto {
fn typename() -> &'static str {
"type.googleapis.com/google.api.BatchingDescriptorProto"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigChange {
pub element: std::string::String,
pub old_value: std::string::String,
pub new_value: std::string::String,
pub change_type: crate::model::ChangeType,
pub advices: std::vec::Vec<crate::model::Advice>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfigChange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_element<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.element = v.into();
self
}
pub fn set_old_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.old_value = v.into();
self
}
pub fn set_new_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_value = v.into();
self
}
pub fn set_change_type<T: std::convert::Into<crate::model::ChangeType>>(
mut self,
v: T,
) -> Self {
self.change_type = v.into();
self
}
pub fn set_advices<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Advice>,
{
use std::iter::Iterator;
self.advices = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ConfigChange {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ConfigChange"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Advice {
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Advice {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for Advice {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Advice"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProjectProperties {
pub properties: std::vec::Vec<crate::model::Property>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProjectProperties {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_properties<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Property>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ProjectProperties {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ProjectProperties"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Property {
pub name: std::string::String,
pub r#type: crate::model::property::PropertyType,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Property {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::property::PropertyType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for Property {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Property"
}
}
pub mod property {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PropertyType {
Unspecified,
Int64,
Bool,
String,
Double,
UnknownValue(property_type::UnknownValue),
}
#[doc(hidden)]
pub mod property_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PropertyType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Int64 => std::option::Option::Some(1),
Self::Bool => std::option::Option::Some(2),
Self::String => std::option::Option::Some(3),
Self::Double => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
Self::Int64 => std::option::Option::Some("INT64"),
Self::Bool => std::option::Option::Some("BOOL"),
Self::String => std::option::Option::Some("STRING"),
Self::Double => std::option::Option::Some("DOUBLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PropertyType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PropertyType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PropertyType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Int64,
2 => Self::Bool,
3 => Self::String,
4 => Self::Double,
_ => Self::UnknownValue(property_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PropertyType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNSPECIFIED" => Self::Unspecified,
"INT64" => Self::Int64,
"BOOL" => Self::Bool,
"STRING" => Self::String,
"DOUBLE" => Self::Double,
_ => Self::UnknownValue(property_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PropertyType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Int64 => serializer.serialize_i32(1),
Self::Bool => serializer.serialize_i32(2),
Self::String => serializer.serialize_i32(3),
Self::Double => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PropertyType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PropertyType>::new(
".google.api.Property.PropertyType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Context {
pub rules: std::vec::Vec<crate::model::ContextRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Context {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ContextRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Context {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Context"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContextRule {
pub selector: std::string::String,
pub requested: std::vec::Vec<std::string::String>,
pub provided: std::vec::Vec<std::string::String>,
pub allowed_request_extensions: std::vec::Vec<std::string::String>,
pub allowed_response_extensions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContextRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_requested<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.requested = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_provided<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.provided = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allowed_request_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_request_extensions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allowed_response_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_response_extensions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ContextRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ContextRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Control {
pub environment: std::string::String,
pub method_policies: std::vec::Vec<crate::model::MethodPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Control {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.environment = v.into();
self
}
pub fn set_method_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MethodPolicy>,
{
use std::iter::Iterator;
self.method_policies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Control {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Control"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Distribution {
pub count: i64,
pub mean: f64,
pub sum_of_squared_deviation: f64,
pub range: std::option::Option<crate::model::distribution::Range>,
pub bucket_options: std::option::Option<crate::model::distribution::BucketOptions>,
pub bucket_counts: std::vec::Vec<i64>,
pub exemplars: std::vec::Vec<crate::model::distribution::Exemplar>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Distribution {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
pub fn set_mean<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.mean = v.into();
self
}
pub fn set_sum_of_squared_deviation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.sum_of_squared_deviation = v.into();
self
}
pub fn set_range<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::distribution::Range>,
{
self.range = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_range<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::distribution::Range>,
{
self.range = v.map(|x| x.into());
self
}
pub fn set_bucket_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::distribution::BucketOptions>,
{
self.bucket_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bucket_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::distribution::BucketOptions>,
{
self.bucket_options = v.map(|x| x.into());
self
}
pub fn set_bucket_counts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.bucket_counts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_exemplars<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::distribution::Exemplar>,
{
use std::iter::Iterator;
self.exemplars = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Distribution {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution"
}
}
pub mod distribution {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Range {
pub min: f64,
pub max: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Range {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.min = v.into();
self
}
pub fn set_max<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.max = v.into();
self
}
}
impl wkt::message::Message for Range {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.Range"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BucketOptions {
pub options: std::option::Option<crate::model::distribution::bucket_options::Options>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BucketOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_options<
T: std::convert::Into<
std::option::Option<crate::model::distribution::bucket_options::Options>,
>,
>(
mut self,
v: T,
) -> Self {
self.options = v.into();
self
}
pub fn linear_buckets(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::distribution::bucket_options::Linear>>
{
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::distribution::bucket_options::Options::LinearBuckets(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_linear_buckets<
T: std::convert::Into<std::boxed::Box<crate::model::distribution::bucket_options::Linear>>,
>(
mut self,
v: T,
) -> Self {
self.options = std::option::Option::Some(
crate::model::distribution::bucket_options::Options::LinearBuckets(v.into()),
);
self
}
pub fn exponential_buckets(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::distribution::bucket_options::Exponential>,
> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::distribution::bucket_options::Options::ExponentialBuckets(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_exponential_buckets<
T: std::convert::Into<
std::boxed::Box<crate::model::distribution::bucket_options::Exponential>,
>,
>(
mut self,
v: T,
) -> Self {
self.options = std::option::Option::Some(
crate::model::distribution::bucket_options::Options::ExponentialBuckets(v.into()),
);
self
}
pub fn explicit_buckets(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::distribution::bucket_options::Explicit>,
> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::distribution::bucket_options::Options::ExplicitBuckets(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_explicit_buckets<
T: std::convert::Into<
std::boxed::Box<crate::model::distribution::bucket_options::Explicit>,
>,
>(
mut self,
v: T,
) -> Self {
self.options = std::option::Option::Some(
crate::model::distribution::bucket_options::Options::ExplicitBuckets(v.into()),
);
self
}
}
impl wkt::message::Message for BucketOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.BucketOptions"
}
}
pub mod bucket_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Linear {
pub num_finite_buckets: i32,
pub width: f64,
pub offset: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Linear {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_num_finite_buckets<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.num_finite_buckets = v.into();
self
}
pub fn set_width<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.width = v.into();
self
}
pub fn set_offset<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.offset = v.into();
self
}
}
impl wkt::message::Message for Linear {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.BucketOptions.Linear"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Exponential {
pub num_finite_buckets: i32,
pub growth_factor: f64,
pub scale: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Exponential {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_num_finite_buckets<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.num_finite_buckets = v.into();
self
}
pub fn set_growth_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.growth_factor = v.into();
self
}
pub fn set_scale<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.scale = v.into();
self
}
}
impl wkt::message::Message for Exponential {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.BucketOptions.Exponential"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Explicit {
pub bounds: std::vec::Vec<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Explicit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bounds<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<f64>,
{
use std::iter::Iterator;
self.bounds = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Explicit {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.BucketOptions.Explicit"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Options {
LinearBuckets(std::boxed::Box<crate::model::distribution::bucket_options::Linear>),
ExponentialBuckets(
std::boxed::Box<crate::model::distribution::bucket_options::Exponential>,
),
ExplicitBuckets(std::boxed::Box<crate::model::distribution::bucket_options::Explicit>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Exemplar {
pub value: f64,
pub timestamp: std::option::Option<wkt::Timestamp>,
pub attachments: std::vec::Vec<wkt::Any>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Exemplar {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
pub fn set_timestamp<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = v.map(|x| x.into());
self
}
pub fn set_attachments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Any>,
{
use std::iter::Iterator;
self.attachments = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Exemplar {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Distribution.Exemplar"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Documentation {
pub summary: std::string::String,
pub pages: std::vec::Vec<crate::model::Page>,
pub rules: std::vec::Vec<crate::model::DocumentationRule>,
pub documentation_root_url: std::string::String,
pub service_root_url: std::string::String,
pub overview: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Documentation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_summary<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.summary = v.into();
self
}
pub fn set_pages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Page>,
{
use std::iter::Iterator;
self.pages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DocumentationRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_documentation_root_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.documentation_root_url = v.into();
self
}
pub fn set_service_root_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_root_url = v.into();
self
}
pub fn set_overview<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.overview = v.into();
self
}
}
impl wkt::message::Message for Documentation {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Documentation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DocumentationRule {
pub selector: std::string::String,
pub description: std::string::String,
pub deprecation_description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DocumentationRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_deprecation_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deprecation_description = v.into();
self
}
}
impl wkt::message::Message for DocumentationRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.DocumentationRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Page {
pub name: std::string::String,
pub content: std::string::String,
pub subpages: std::vec::Vec<crate::model::Page>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Page {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content = v.into();
self
}
pub fn set_subpages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Page>,
{
use std::iter::Iterator;
self.subpages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Page {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Page"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Endpoint {
pub name: std::string::String,
pub aliases: std::vec::Vec<std::string::String>,
pub target: std::string::String,
pub allow_cors: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Endpoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_aliases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.aliases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_allow_cors<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_cors = v.into();
self
}
}
impl wkt::message::Message for Endpoint {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Endpoint"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FieldInfo {
pub format: crate::model::field_info::Format,
pub referenced_types: std::vec::Vec<crate::model::TypeReference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FieldInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_format<T: std::convert::Into<crate::model::field_info::Format>>(
mut self,
v: T,
) -> Self {
self.format = v.into();
self
}
pub fn set_referenced_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TypeReference>,
{
use std::iter::Iterator;
self.referenced_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FieldInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.api.FieldInfo"
}
}
pub mod field_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Format {
Unspecified,
Uuid4,
Ipv4,
Ipv6,
Ipv4OrIpv6,
UnknownValue(format::UnknownValue),
}
#[doc(hidden)]
pub mod format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Format {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Uuid4 => std::option::Option::Some(1),
Self::Ipv4 => std::option::Option::Some(2),
Self::Ipv6 => std::option::Option::Some(3),
Self::Ipv4OrIpv6 => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
Self::Uuid4 => std::option::Option::Some("UUID4"),
Self::Ipv4 => std::option::Option::Some("IPV4"),
Self::Ipv6 => std::option::Option::Some("IPV6"),
Self::Ipv4OrIpv6 => std::option::Option::Some("IPV4_OR_IPV6"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Format {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Format {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Format {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Uuid4,
2 => Self::Ipv4,
3 => Self::Ipv6,
4 => Self::Ipv4OrIpv6,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Format {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FORMAT_UNSPECIFIED" => Self::Unspecified,
"UUID4" => Self::Uuid4,
"IPV4" => Self::Ipv4,
"IPV6" => Self::Ipv6,
"IPV4_OR_IPV6" => Self::Ipv4OrIpv6,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Format {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Uuid4 => serializer.serialize_i32(1),
Self::Ipv4 => serializer.serialize_i32(2),
Self::Ipv6 => serializer.serialize_i32(3),
Self::Ipv4OrIpv6 => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Format {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
".google.api.FieldInfo.Format",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TypeReference {
pub type_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TypeReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.type_name = v.into();
self
}
}
impl wkt::message::Message for TypeReference {
fn typename() -> &'static str {
"type.googleapis.com/google.api.TypeReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Http {
pub rules: std::vec::Vec<crate::model::HttpRule>,
pub fully_decode_reserved_expansion: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Http {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HttpRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_fully_decode_reserved_expansion<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.fully_decode_reserved_expansion = v.into();
self
}
}
impl wkt::message::Message for Http {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Http"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HttpRule {
pub selector: std::string::String,
pub body: std::string::String,
pub response_body: std::string::String,
pub additional_bindings: std::vec::Vec<crate::model::HttpRule>,
pub pattern: std::option::Option<crate::model::http_rule::Pattern>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HttpRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.body = v.into();
self
}
pub fn set_response_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.response_body = v.into();
self
}
pub fn set_additional_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HttpRule>,
{
use std::iter::Iterator;
self.additional_bindings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_pattern<
T: std::convert::Into<std::option::Option<crate::model::http_rule::Pattern>>,
>(
mut self,
v: T,
) -> Self {
self.pattern = v.into();
self
}
pub fn get(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Get(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_get<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern = std::option::Option::Some(crate::model::http_rule::Pattern::Get(v.into()));
self
}
pub fn put(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Put(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_put<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern = std::option::Option::Some(crate::model::http_rule::Pattern::Put(v.into()));
self
}
pub fn post(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Post(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_post<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern = std::option::Option::Some(crate::model::http_rule::Pattern::Post(v.into()));
self
}
pub fn delete(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Delete(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern =
std::option::Option::Some(crate::model::http_rule::Pattern::Delete(v.into()));
self
}
pub fn patch(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Patch(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern = std::option::Option::Some(crate::model::http_rule::Pattern::Patch(v.into()));
self
}
pub fn custom(&self) -> std::option::Option<&std::boxed::Box<crate::model::CustomHttpPattern>> {
#[allow(unreachable_patterns)]
self.pattern.as_ref().and_then(|v| match v {
crate::model::http_rule::Pattern::Custom(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_custom<T: std::convert::Into<std::boxed::Box<crate::model::CustomHttpPattern>>>(
mut self,
v: T,
) -> Self {
self.pattern =
std::option::Option::Some(crate::model::http_rule::Pattern::Custom(v.into()));
self
}
}
impl wkt::message::Message for HttpRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.HttpRule"
}
}
pub mod http_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Pattern {
Get(std::string::String),
Put(std::string::String),
Post(std::string::String),
Delete(std::string::String),
Patch(std::string::String),
Custom(std::boxed::Box<crate::model::CustomHttpPattern>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomHttpPattern {
pub kind: std::string::String,
pub path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomHttpPattern {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
}
impl wkt::message::Message for CustomHttpPattern {
fn typename() -> &'static str {
"type.googleapis.com/google.api.CustomHttpPattern"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HttpBody {
pub content_type: std::string::String,
pub data: ::bytes::Bytes,
pub extensions: std::vec::Vec<wkt::Any>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HttpBody {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_content_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content_type = v.into();
self
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
pub fn set_extensions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Any>,
{
use std::iter::Iterator;
self.extensions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for HttpBody {
fn typename() -> &'static str {
"type.googleapis.com/google.api.HttpBody"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LabelDescriptor {
pub key: std::string::String,
pub value_type: crate::model::label_descriptor::ValueType,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LabelDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_value_type<T: std::convert::Into<crate::model::label_descriptor::ValueType>>(
mut self,
v: T,
) -> Self {
self.value_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for LabelDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.api.LabelDescriptor"
}
}
pub mod label_descriptor {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueType {
String,
Bool,
Int64,
UnknownValue(value_type::UnknownValue),
}
#[doc(hidden)]
pub mod value_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValueType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::String => std::option::Option::Some(0),
Self::Bool => std::option::Option::Some(1),
Self::Int64 => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::String => std::option::Option::Some("STRING"),
Self::Bool => std::option::Option::Some("BOOL"),
Self::Int64 => std::option::Option::Some("INT64"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValueType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValueType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ValueType {
fn from(value: i32) -> Self {
match value {
0 => Self::String,
1 => Self::Bool,
2 => Self::Int64,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValueType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STRING" => Self::String,
"BOOL" => Self::Bool,
"INT64" => Self::Int64,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValueType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::String => serializer.serialize_i32(0),
Self::Bool => serializer.serialize_i32(1),
Self::Int64 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValueType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
".google.api.LabelDescriptor.ValueType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogDescriptor {
pub name: std::string::String,
pub labels: std::vec::Vec<crate::model::LabelDescriptor>,
pub description: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelDescriptor>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for LogDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.api.LogDescriptor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Logging {
pub producer_destinations: std::vec::Vec<crate::model::logging::LoggingDestination>,
pub consumer_destinations: std::vec::Vec<crate::model::logging::LoggingDestination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Logging {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_producer_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::logging::LoggingDestination>,
{
use std::iter::Iterator;
self.producer_destinations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_consumer_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::logging::LoggingDestination>,
{
use std::iter::Iterator;
self.consumer_destinations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Logging {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Logging"
}
}
pub mod logging {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoggingDestination {
pub monitored_resource: std::string::String,
pub logs: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LoggingDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_monitored_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.monitored_resource = v.into();
self
}
pub fn set_logs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.logs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LoggingDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Logging.LoggingDestination"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetricDescriptor {
pub name: std::string::String,
pub r#type: std::string::String,
pub labels: std::vec::Vec<crate::model::LabelDescriptor>,
pub metric_kind: crate::model::metric_descriptor::MetricKind,
pub value_type: crate::model::metric_descriptor::ValueType,
pub unit: std::string::String,
pub description: std::string::String,
pub display_name: std::string::String,
pub metadata: std::option::Option<crate::model::metric_descriptor::MetricDescriptorMetadata>,
pub launch_stage: crate::model::LaunchStage,
pub monitored_resource_types: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetricDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelDescriptor>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metric_kind<T: std::convert::Into<crate::model::metric_descriptor::MetricKind>>(
mut self,
v: T,
) -> Self {
self.metric_kind = v.into();
self
}
pub fn set_value_type<T: std::convert::Into<crate::model::metric_descriptor::ValueType>>(
mut self,
v: T,
) -> Self {
self.value_type = v.into();
self
}
pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.unit = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::metric_descriptor::MetricDescriptorMetadata>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::metric_descriptor::MetricDescriptorMetadata>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_monitored_resource_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.monitored_resource_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MetricDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MetricDescriptor"
}
}
pub mod metric_descriptor {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetricDescriptorMetadata {
#[deprecated]
pub launch_stage: crate::model::LaunchStage,
pub sample_period: std::option::Option<wkt::Duration>,
pub ingest_delay: std::option::Option<wkt::Duration>,
pub time_series_resource_hierarchy_level: std::vec::Vec<crate::model::metric_descriptor::metric_descriptor_metadata::TimeSeriesResourceHierarchyLevel>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetricDescriptorMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_sample_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.sample_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sample_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.sample_period = v.map(|x| x.into());
self
}
pub fn set_ingest_delay<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ingest_delay = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ingest_delay<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ingest_delay = v.map(|x| x.into());
self
}
pub fn set_time_series_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::metric_descriptor::metric_descriptor_metadata::TimeSeriesResourceHierarchyLevel>
{
use std::iter::Iterator;
self.time_series_resource_hierarchy_level = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MetricDescriptorMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MetricDescriptor.MetricDescriptorMetadata"
}
}
pub mod metric_descriptor_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TimeSeriesResourceHierarchyLevel {
Unspecified,
Project,
Organization,
Folder,
UnknownValue(time_series_resource_hierarchy_level::UnknownValue),
}
#[doc(hidden)]
pub mod time_series_resource_hierarchy_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TimeSeriesResourceHierarchyLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Project => std::option::Option::Some(1),
Self::Organization => std::option::Option::Some(2),
Self::Folder => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some(
"TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED",
),
Self::Project => std::option::Option::Some("PROJECT"),
Self::Organization => std::option::Option::Some("ORGANIZATION"),
Self::Folder => std::option::Option::Some("FOLDER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TimeSeriesResourceHierarchyLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TimeSeriesResourceHierarchyLevel {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TimeSeriesResourceHierarchyLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Project,
2 => Self::Organization,
3 => Self::Folder,
_ => Self::UnknownValue(time_series_resource_hierarchy_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TimeSeriesResourceHierarchyLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED" => Self::Unspecified,
"PROJECT" => Self::Project,
"ORGANIZATION" => Self::Organization,
"FOLDER" => Self::Folder,
_ => Self::UnknownValue(time_series_resource_hierarchy_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TimeSeriesResourceHierarchyLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Project => serializer.serialize_i32(1),
Self::Organization => serializer.serialize_i32(2),
Self::Folder => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TimeSeriesResourceHierarchyLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimeSeriesResourceHierarchyLevel>::new(
".google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel"))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MetricKind {
Unspecified,
Gauge,
Delta,
Cumulative,
UnknownValue(metric_kind::UnknownValue),
}
#[doc(hidden)]
pub mod metric_kind {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MetricKind {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Gauge => std::option::Option::Some(1),
Self::Delta => std::option::Option::Some(2),
Self::Cumulative => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("METRIC_KIND_UNSPECIFIED"),
Self::Gauge => std::option::Option::Some("GAUGE"),
Self::Delta => std::option::Option::Some("DELTA"),
Self::Cumulative => std::option::Option::Some("CUMULATIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MetricKind {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MetricKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MetricKind {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Gauge,
2 => Self::Delta,
3 => Self::Cumulative,
_ => Self::UnknownValue(metric_kind::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MetricKind {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"METRIC_KIND_UNSPECIFIED" => Self::Unspecified,
"GAUGE" => Self::Gauge,
"DELTA" => Self::Delta,
"CUMULATIVE" => Self::Cumulative,
_ => Self::UnknownValue(metric_kind::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MetricKind {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Gauge => serializer.serialize_i32(1),
Self::Delta => serializer.serialize_i32(2),
Self::Cumulative => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MetricKind {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetricKind>::new(
".google.api.MetricDescriptor.MetricKind",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueType {
Unspecified,
Bool,
Int64,
Double,
String,
Distribution,
Money,
UnknownValue(value_type::UnknownValue),
}
#[doc(hidden)]
pub mod value_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValueType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Bool => std::option::Option::Some(1),
Self::Int64 => std::option::Option::Some(2),
Self::Double => std::option::Option::Some(3),
Self::String => std::option::Option::Some(4),
Self::Distribution => std::option::Option::Some(5),
Self::Money => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
Self::Bool => std::option::Option::Some("BOOL"),
Self::Int64 => std::option::Option::Some("INT64"),
Self::Double => std::option::Option::Some("DOUBLE"),
Self::String => std::option::Option::Some("STRING"),
Self::Distribution => std::option::Option::Some("DISTRIBUTION"),
Self::Money => std::option::Option::Some("MONEY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValueType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValueType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ValueType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Bool,
2 => Self::Int64,
3 => Self::Double,
4 => Self::String,
5 => Self::Distribution,
6 => Self::Money,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValueType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
"BOOL" => Self::Bool,
"INT64" => Self::Int64,
"DOUBLE" => Self::Double,
"STRING" => Self::String,
"DISTRIBUTION" => Self::Distribution,
"MONEY" => Self::Money,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValueType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Bool => serializer.serialize_i32(1),
Self::Int64 => serializer.serialize_i32(2),
Self::Double => serializer.serialize_i32(3),
Self::String => serializer.serialize_i32(4),
Self::Distribution => serializer.serialize_i32(5),
Self::Money => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValueType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
".google.api.MetricDescriptor.ValueType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Metric {
pub r#type: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Metric {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Metric {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Metric"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonitoredResourceDescriptor {
pub name: std::string::String,
pub r#type: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub labels: std::vec::Vec<crate::model::LabelDescriptor>,
pub launch_stage: crate::model::LaunchStage,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MonitoredResourceDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelDescriptor>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
}
impl wkt::message::Message for MonitoredResourceDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MonitoredResourceDescriptor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonitoredResource {
pub r#type: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MonitoredResource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for MonitoredResource {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MonitoredResource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonitoredResourceMetadata {
pub system_labels: std::option::Option<wkt::Struct>,
pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MonitoredResourceMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_system_labels<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.system_labels = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_system_labels<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.system_labels = v.map(|x| x.into());
self
}
pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for MonitoredResourceMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MonitoredResourceMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Monitoring {
pub producer_destinations: std::vec::Vec<crate::model::monitoring::MonitoringDestination>,
pub consumer_destinations: std::vec::Vec<crate::model::monitoring::MonitoringDestination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Monitoring {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_producer_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::monitoring::MonitoringDestination>,
{
use std::iter::Iterator;
self.producer_destinations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_consumer_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::monitoring::MonitoringDestination>,
{
use std::iter::Iterator;
self.consumer_destinations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Monitoring {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Monitoring"
}
}
pub mod monitoring {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonitoringDestination {
pub monitored_resource: std::string::String,
pub metrics: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MonitoringDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_monitored_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.monitored_resource = v.into();
self
}
pub fn set_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.metrics = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MonitoringDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Monitoring.MonitoringDestination"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FieldPolicy {
pub selector: std::string::String,
pub resource_permission: std::string::String,
pub resource_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FieldPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_resource_permission<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_permission = v.into();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_type = v.into();
self
}
}
impl wkt::message::Message for FieldPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.api.FieldPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MethodPolicy {
pub selector: std::string::String,
pub request_policies: std::vec::Vec<crate::model::FieldPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MethodPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_request_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FieldPolicy>,
{
use std::iter::Iterator;
self.request_policies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MethodPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MethodPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Quota {
pub limits: std::vec::Vec<crate::model::QuotaLimit>,
pub metric_rules: std::vec::Vec<crate::model::MetricRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Quota {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_limits<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::QuotaLimit>,
{
use std::iter::Iterator;
self.limits = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metric_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MetricRule>,
{
use std::iter::Iterator;
self.metric_rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Quota {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Quota"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetricRule {
pub selector: std::string::String,
pub metric_costs: std::collections::HashMap<std::string::String, i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetricRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_metric_costs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.metric_costs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for MetricRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.MetricRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuotaLimit {
pub name: std::string::String,
pub description: std::string::String,
pub default_limit: i64,
pub max_limit: i64,
pub free_tier: i64,
pub duration: std::string::String,
pub metric: std::string::String,
pub unit: std::string::String,
pub values: std::collections::HashMap<std::string::String, i64>,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuotaLimit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_default_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.default_limit = v.into();
self
}
pub fn set_max_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max_limit = v.into();
self
}
pub fn set_free_tier<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.free_tier = v.into();
self
}
pub fn set_duration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.duration = v.into();
self
}
pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metric = v.into();
self
}
pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.unit = v.into();
self
}
pub fn set_values<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for QuotaLimit {
fn typename() -> &'static str {
"type.googleapis.com/google.api.QuotaLimit"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceDescriptor {
pub r#type: std::string::String,
pub pattern: std::vec::Vec<std::string::String>,
pub name_field: std::string::String,
pub history: crate::model::resource_descriptor::History,
pub plural: std::string::String,
pub singular: std::string::String,
pub style: std::vec::Vec<crate::model::resource_descriptor::Style>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_pattern<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.pattern = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_name_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name_field = v.into();
self
}
pub fn set_history<T: std::convert::Into<crate::model::resource_descriptor::History>>(
mut self,
v: T,
) -> Self {
self.history = v.into();
self
}
pub fn set_plural<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.plural = v.into();
self
}
pub fn set_singular<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.singular = v.into();
self
}
pub fn set_style<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::resource_descriptor::Style>,
{
use std::iter::Iterator;
self.style = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourceDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ResourceDescriptor"
}
}
pub mod resource_descriptor {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum History {
Unspecified,
OriginallySinglePattern,
FutureMultiPattern,
UnknownValue(history::UnknownValue),
}
#[doc(hidden)]
pub mod history {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl History {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OriginallySinglePattern => std::option::Option::Some(1),
Self::FutureMultiPattern => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("HISTORY_UNSPECIFIED"),
Self::OriginallySinglePattern => {
std::option::Option::Some("ORIGINALLY_SINGLE_PATTERN")
}
Self::FutureMultiPattern => std::option::Option::Some("FUTURE_MULTI_PATTERN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for History {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for History {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for History {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OriginallySinglePattern,
2 => Self::FutureMultiPattern,
_ => Self::UnknownValue(history::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for History {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HISTORY_UNSPECIFIED" => Self::Unspecified,
"ORIGINALLY_SINGLE_PATTERN" => Self::OriginallySinglePattern,
"FUTURE_MULTI_PATTERN" => Self::FutureMultiPattern,
_ => Self::UnknownValue(history::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for History {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::OriginallySinglePattern => serializer.serialize_i32(1),
Self::FutureMultiPattern => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for History {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<History>::new(
".google.api.ResourceDescriptor.History",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Style {
Unspecified,
DeclarativeFriendly,
UnknownValue(style::UnknownValue),
}
#[doc(hidden)]
pub mod style {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Style {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DeclarativeFriendly => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STYLE_UNSPECIFIED"),
Self::DeclarativeFriendly => std::option::Option::Some("DECLARATIVE_FRIENDLY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Style {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Style {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Style {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DeclarativeFriendly,
_ => Self::UnknownValue(style::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Style {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STYLE_UNSPECIFIED" => Self::Unspecified,
"DECLARATIVE_FRIENDLY" => Self::DeclarativeFriendly,
_ => Self::UnknownValue(style::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Style {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DeclarativeFriendly => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Style {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Style>::new(
".google.api.ResourceDescriptor.Style",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceReference {
pub r#type: std::string::String,
pub child_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_child_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.child_type = v.into();
self
}
}
impl wkt::message::Message for ResourceReference {
fn typename() -> &'static str {
"type.googleapis.com/google.api.ResourceReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoutingRule {
pub routing_parameters: std::vec::Vec<crate::model::RoutingParameter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoutingRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_routing_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RoutingParameter>,
{
use std::iter::Iterator;
self.routing_parameters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RoutingRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.RoutingRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoutingParameter {
pub field: std::string::String,
pub path_template: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoutingParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_path_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path_template = v.into();
self
}
}
impl wkt::message::Message for RoutingParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.api.RoutingParameter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Service {
pub name: std::string::String,
pub title: std::string::String,
pub producer_project_id: std::string::String,
pub id: std::string::String,
pub apis: std::vec::Vec<wkt::Api>,
pub types: std::vec::Vec<wkt::Type>,
pub enums: std::vec::Vec<wkt::Enum>,
pub documentation: std::option::Option<crate::model::Documentation>,
pub backend: std::option::Option<crate::model::Backend>,
pub http: std::option::Option<crate::model::Http>,
pub quota: std::option::Option<crate::model::Quota>,
pub authentication: std::option::Option<crate::model::Authentication>,
pub context: std::option::Option<crate::model::Context>,
pub usage: std::option::Option<crate::model::Usage>,
pub endpoints: std::vec::Vec<crate::model::Endpoint>,
pub control: std::option::Option<crate::model::Control>,
pub logs: std::vec::Vec<crate::model::LogDescriptor>,
pub metrics: std::vec::Vec<crate::model::MetricDescriptor>,
pub monitored_resources: std::vec::Vec<crate::model::MonitoredResourceDescriptor>,
pub billing: std::option::Option<crate::model::Billing>,
pub logging: std::option::Option<crate::model::Logging>,
pub monitoring: std::option::Option<crate::model::Monitoring>,
pub system_parameters: std::option::Option<crate::model::SystemParameters>,
pub source_info: std::option::Option<crate::model::SourceInfo>,
pub publishing: std::option::Option<crate::model::Publishing>,
pub config_version: std::option::Option<wkt::UInt32Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Service {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_producer_project_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_project_id = v.into();
self
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_apis<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Api>,
{
use std::iter::Iterator;
self.apis = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Type>,
{
use std::iter::Iterator;
self.types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enums<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Enum>,
{
use std::iter::Iterator;
self.enums = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_documentation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Documentation>,
{
self.documentation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Documentation>,
{
self.documentation = v.map(|x| x.into());
self
}
pub fn set_backend<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backend>,
{
self.backend = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backend<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backend>,
{
self.backend = v.map(|x| x.into());
self
}
pub fn set_http<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Http>,
{
self.http = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_http<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Http>,
{
self.http = v.map(|x| x.into());
self
}
pub fn set_quota<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Quota>,
{
self.quota = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quota<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Quota>,
{
self.quota = v.map(|x| x.into());
self
}
pub fn set_authentication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Authentication>,
{
self.authentication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authentication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Authentication>,
{
self.authentication = v.map(|x| x.into());
self
}
pub fn set_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Context>,
{
self.context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Context>,
{
self.context = v.map(|x| x.into());
self
}
pub fn set_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Usage>,
{
self.usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Usage>,
{
self.usage = v.map(|x| x.into());
self
}
pub fn set_endpoints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Endpoint>,
{
use std::iter::Iterator;
self.endpoints = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_control<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Control>,
{
self.control = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Control>,
{
self.control = v.map(|x| x.into());
self
}
pub fn set_logs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogDescriptor>,
{
use std::iter::Iterator;
self.logs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MetricDescriptor>,
{
use std::iter::Iterator;
self.metrics = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_monitored_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MonitoredResourceDescriptor>,
{
use std::iter::Iterator;
self.monitored_resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_billing<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Billing>,
{
self.billing = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_billing<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Billing>,
{
self.billing = v.map(|x| x.into());
self
}
pub fn set_logging<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Logging>,
{
self.logging = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Logging>,
{
self.logging = v.map(|x| x.into());
self
}
pub fn set_monitoring<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Monitoring>,
{
self.monitoring = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monitoring<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Monitoring>,
{
self.monitoring = v.map(|x| x.into());
self
}
pub fn set_system_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SystemParameters>,
{
self.system_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_system_parameters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SystemParameters>,
{
self.system_parameters = v.map(|x| x.into());
self
}
pub fn set_source_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SourceInfo>,
{
self.source_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SourceInfo>,
{
self.source_info = v.map(|x| x.into());
self
}
pub fn set_publishing<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Publishing>,
{
self.publishing = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_publishing<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Publishing>,
{
self.publishing = v.map(|x| x.into());
self
}
pub fn set_config_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::UInt32Value>,
{
self.config_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::UInt32Value>,
{
self.config_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Service {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Service"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceInfo {
pub source_files: std::vec::Vec<wkt::Any>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_files<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Any>,
{
use std::iter::Iterator;
self.source_files = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SourceInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.api.SourceInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SystemParameters {
pub rules: std::vec::Vec<crate::model::SystemParameterRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SystemParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SystemParameterRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SystemParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.api.SystemParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SystemParameterRule {
pub selector: std::string::String,
pub parameters: std::vec::Vec<crate::model::SystemParameter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SystemParameterRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SystemParameter>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SystemParameterRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.SystemParameterRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SystemParameter {
pub name: std::string::String,
pub http_header: std::string::String,
pub url_query_parameter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SystemParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_http_header<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.http_header = v.into();
self
}
pub fn set_url_query_parameter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.url_query_parameter = v.into();
self
}
}
impl wkt::message::Message for SystemParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.api.SystemParameter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Usage {
pub requirements: std::vec::Vec<std::string::String>,
pub rules: std::vec::Vec<crate::model::UsageRule>,
pub producer_notification_channel: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Usage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_requirements<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.requirements = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::UsageRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_producer_notification_channel<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_notification_channel = v.into();
self
}
}
impl wkt::message::Message for Usage {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Usage"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UsageRule {
pub selector: std::string::String,
pub allow_unregistered_calls: bool,
pub skip_service_control: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UsageRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_allow_unregistered_calls<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_unregistered_calls = v.into();
self
}
pub fn set_skip_service_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_service_control = v.into();
self
}
}
impl wkt::message::Message for UsageRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.UsageRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Visibility {
pub rules: std::vec::Vec<crate::model::VisibilityRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Visibility {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VisibilityRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Visibility {
fn typename() -> &'static str {
"type.googleapis.com/google.api.Visibility"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VisibilityRule {
pub selector: std::string::String,
pub restriction: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VisibilityRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_selector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.selector = v.into();
self
}
pub fn set_restriction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.restriction = v.into();
self
}
}
impl wkt::message::Message for VisibilityRule {
fn typename() -> &'static str {
"type.googleapis.com/google.api.VisibilityRule"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ClientLibraryOrganization {
Unspecified,
Cloud,
Ads,
Photos,
StreetView,
Shopping,
Geo,
GenerativeAi,
UnknownValue(client_library_organization::UnknownValue),
}
#[doc(hidden)]
pub mod client_library_organization {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ClientLibraryOrganization {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Cloud => std::option::Option::Some(1),
Self::Ads => std::option::Option::Some(2),
Self::Photos => std::option::Option::Some(3),
Self::StreetView => std::option::Option::Some(4),
Self::Shopping => std::option::Option::Some(5),
Self::Geo => std::option::Option::Some(6),
Self::GenerativeAi => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED")
}
Self::Cloud => std::option::Option::Some("CLOUD"),
Self::Ads => std::option::Option::Some("ADS"),
Self::Photos => std::option::Option::Some("PHOTOS"),
Self::StreetView => std::option::Option::Some("STREET_VIEW"),
Self::Shopping => std::option::Option::Some("SHOPPING"),
Self::Geo => std::option::Option::Some("GEO"),
Self::GenerativeAi => std::option::Option::Some("GENERATIVE_AI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ClientLibraryOrganization {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ClientLibraryOrganization {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ClientLibraryOrganization {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Cloud,
2 => Self::Ads,
3 => Self::Photos,
4 => Self::StreetView,
5 => Self::Shopping,
6 => Self::Geo,
7 => Self::GenerativeAi,
_ => Self::UnknownValue(client_library_organization::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ClientLibraryOrganization {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" => Self::Unspecified,
"CLOUD" => Self::Cloud,
"ADS" => Self::Ads,
"PHOTOS" => Self::Photos,
"STREET_VIEW" => Self::StreetView,
"SHOPPING" => Self::Shopping,
"GEO" => Self::Geo,
"GENERATIVE_AI" => Self::GenerativeAi,
_ => Self::UnknownValue(client_library_organization::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ClientLibraryOrganization {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Cloud => serializer.serialize_i32(1),
Self::Ads => serializer.serialize_i32(2),
Self::Photos => serializer.serialize_i32(3),
Self::StreetView => serializer.serialize_i32(4),
Self::Shopping => serializer.serialize_i32(5),
Self::Geo => serializer.serialize_i32(6),
Self::GenerativeAi => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ClientLibraryOrganization {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ClientLibraryOrganization>::new(
".google.api.ClientLibraryOrganization",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ClientLibraryDestination {
Unspecified,
Github,
PackageManager,
UnknownValue(client_library_destination::UnknownValue),
}
#[doc(hidden)]
pub mod client_library_destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ClientLibraryDestination {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Github => std::option::Option::Some(10),
Self::PackageManager => std::option::Option::Some(20),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CLIENT_LIBRARY_DESTINATION_UNSPECIFIED")
}
Self::Github => std::option::Option::Some("GITHUB"),
Self::PackageManager => std::option::Option::Some("PACKAGE_MANAGER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ClientLibraryDestination {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ClientLibraryDestination {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ClientLibraryDestination {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
10 => Self::Github,
20 => Self::PackageManager,
_ => Self::UnknownValue(client_library_destination::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ClientLibraryDestination {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLIENT_LIBRARY_DESTINATION_UNSPECIFIED" => Self::Unspecified,
"GITHUB" => Self::Github,
"PACKAGE_MANAGER" => Self::PackageManager,
_ => Self::UnknownValue(client_library_destination::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ClientLibraryDestination {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Github => serializer.serialize_i32(10),
Self::PackageManager => serializer.serialize_i32(20),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ClientLibraryDestination {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClientLibraryDestination>::new(
".google.api.ClientLibraryDestination",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FlowControlLimitExceededBehaviorProto {
UnsetBehavior,
ThrowException,
Block,
Ignore,
UnknownValue(flow_control_limit_exceeded_behavior_proto::UnknownValue),
}
#[doc(hidden)]
pub mod flow_control_limit_exceeded_behavior_proto {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FlowControlLimitExceededBehaviorProto {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::UnsetBehavior => std::option::Option::Some(0),
Self::ThrowException => std::option::Option::Some(1),
Self::Block => std::option::Option::Some(2),
Self::Ignore => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::UnsetBehavior => std::option::Option::Some("UNSET_BEHAVIOR"),
Self::ThrowException => std::option::Option::Some("THROW_EXCEPTION"),
Self::Block => std::option::Option::Some("BLOCK"),
Self::Ignore => std::option::Option::Some("IGNORE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FlowControlLimitExceededBehaviorProto {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FlowControlLimitExceededBehaviorProto {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FlowControlLimitExceededBehaviorProto {
fn from(value: i32) -> Self {
match value {
0 => Self::UnsetBehavior,
1 => Self::ThrowException,
2 => Self::Block,
3 => Self::Ignore,
_ => Self::UnknownValue(flow_control_limit_exceeded_behavior_proto::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FlowControlLimitExceededBehaviorProto {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNSET_BEHAVIOR" => Self::UnsetBehavior,
"THROW_EXCEPTION" => Self::ThrowException,
"BLOCK" => Self::Block,
"IGNORE" => Self::Ignore,
_ => Self::UnknownValue(flow_control_limit_exceeded_behavior_proto::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FlowControlLimitExceededBehaviorProto {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::UnsetBehavior => serializer.serialize_i32(0),
Self::ThrowException => serializer.serialize_i32(1),
Self::Block => serializer.serialize_i32(2),
Self::Ignore => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FlowControlLimitExceededBehaviorProto {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<
FlowControlLimitExceededBehaviorProto,
>::new(
".google.api.FlowControlLimitExceededBehaviorProto"
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangeType {
Unspecified,
Added,
Removed,
Modified,
UnknownValue(change_type::UnknownValue),
}
#[doc(hidden)]
pub mod change_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChangeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Added => std::option::Option::Some(1),
Self::Removed => std::option::Option::Some(2),
Self::Modified => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
Self::Added => std::option::Option::Some("ADDED"),
Self::Removed => std::option::Option::Some("REMOVED"),
Self::Modified => std::option::Option::Some("MODIFIED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChangeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChangeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ChangeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Added,
2 => Self::Removed,
3 => Self::Modified,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChangeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"ADDED" => Self::Added,
"REMOVED" => Self::Removed,
"MODIFIED" => Self::Modified,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChangeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Added => serializer.serialize_i32(1),
Self::Removed => serializer.serialize_i32(2),
Self::Modified => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChangeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
".google.api.ChangeType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorReason {
Unspecified,
ServiceDisabled,
BillingDisabled,
ApiKeyInvalid,
ApiKeyServiceBlocked,
ApiKeyHttpReferrerBlocked,
ApiKeyIpAddressBlocked,
ApiKeyAndroidAppBlocked,
ApiKeyIosAppBlocked,
RateLimitExceeded,
ResourceQuotaExceeded,
LocationTaxPolicyViolated,
UserProjectDenied,
ConsumerSuspended,
ConsumerInvalid,
SecurityPolicyViolated,
AccessTokenExpired,
AccessTokenScopeInsufficient,
AccountStateInvalid,
AccessTokenTypeUnsupported,
CredentialsMissing,
ResourceProjectInvalid,
SessionCookieInvalid,
UserBlockedByAdmin,
ResourceUsageRestrictionViolated,
SystemParameterUnsupported,
OrgRestrictionViolation,
OrgRestrictionHeaderInvalid,
ServiceNotVisible,
GcpSuspended,
LocationPolicyViolated,
MissingOrigin,
OverloadedCredentials,
LocationOrgPolicyViolated,
TlsOrgPolicyViolated,
EmulatorQuotaExceeded,
CredentialAndroidAppInvalid,
IamPermissionDenied,
JwtTokenInvalid,
CredentialTypeUnsupported,
AccountTypeUnsupported,
EndpointUsageRestrictionViolated,
TlsCipherRestrictionViolated,
McpServerDisabled,
UnknownValue(error_reason::UnknownValue),
}
#[doc(hidden)]
pub mod error_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ServiceDisabled => std::option::Option::Some(1),
Self::BillingDisabled => std::option::Option::Some(2),
Self::ApiKeyInvalid => std::option::Option::Some(3),
Self::ApiKeyServiceBlocked => std::option::Option::Some(4),
Self::ApiKeyHttpReferrerBlocked => std::option::Option::Some(7),
Self::ApiKeyIpAddressBlocked => std::option::Option::Some(8),
Self::ApiKeyAndroidAppBlocked => std::option::Option::Some(9),
Self::ApiKeyIosAppBlocked => std::option::Option::Some(13),
Self::RateLimitExceeded => std::option::Option::Some(5),
Self::ResourceQuotaExceeded => std::option::Option::Some(6),
Self::LocationTaxPolicyViolated => std::option::Option::Some(10),
Self::UserProjectDenied => std::option::Option::Some(11),
Self::ConsumerSuspended => std::option::Option::Some(12),
Self::ConsumerInvalid => std::option::Option::Some(14),
Self::SecurityPolicyViolated => std::option::Option::Some(15),
Self::AccessTokenExpired => std::option::Option::Some(16),
Self::AccessTokenScopeInsufficient => std::option::Option::Some(17),
Self::AccountStateInvalid => std::option::Option::Some(18),
Self::AccessTokenTypeUnsupported => std::option::Option::Some(19),
Self::CredentialsMissing => std::option::Option::Some(20),
Self::ResourceProjectInvalid => std::option::Option::Some(21),
Self::SessionCookieInvalid => std::option::Option::Some(23),
Self::UserBlockedByAdmin => std::option::Option::Some(24),
Self::ResourceUsageRestrictionViolated => std::option::Option::Some(25),
Self::SystemParameterUnsupported => std::option::Option::Some(26),
Self::OrgRestrictionViolation => std::option::Option::Some(27),
Self::OrgRestrictionHeaderInvalid => std::option::Option::Some(28),
Self::ServiceNotVisible => std::option::Option::Some(29),
Self::GcpSuspended => std::option::Option::Some(30),
Self::LocationPolicyViolated => std::option::Option::Some(31),
Self::MissingOrigin => std::option::Option::Some(33),
Self::OverloadedCredentials => std::option::Option::Some(34),
Self::LocationOrgPolicyViolated => std::option::Option::Some(35),
Self::TlsOrgPolicyViolated => std::option::Option::Some(36),
Self::EmulatorQuotaExceeded => std::option::Option::Some(38),
Self::CredentialAndroidAppInvalid => std::option::Option::Some(39),
Self::IamPermissionDenied => std::option::Option::Some(41),
Self::JwtTokenInvalid => std::option::Option::Some(42),
Self::CredentialTypeUnsupported => std::option::Option::Some(43),
Self::AccountTypeUnsupported => std::option::Option::Some(44),
Self::EndpointUsageRestrictionViolated => std::option::Option::Some(45),
Self::TlsCipherRestrictionViolated => std::option::Option::Some(46),
Self::McpServerDisabled => std::option::Option::Some(47),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ERROR_REASON_UNSPECIFIED"),
Self::ServiceDisabled => std::option::Option::Some("SERVICE_DISABLED"),
Self::BillingDisabled => std::option::Option::Some("BILLING_DISABLED"),
Self::ApiKeyInvalid => std::option::Option::Some("API_KEY_INVALID"),
Self::ApiKeyServiceBlocked => std::option::Option::Some("API_KEY_SERVICE_BLOCKED"),
Self::ApiKeyHttpReferrerBlocked => {
std::option::Option::Some("API_KEY_HTTP_REFERRER_BLOCKED")
}
Self::ApiKeyIpAddressBlocked => std::option::Option::Some("API_KEY_IP_ADDRESS_BLOCKED"),
Self::ApiKeyAndroidAppBlocked => {
std::option::Option::Some("API_KEY_ANDROID_APP_BLOCKED")
}
Self::ApiKeyIosAppBlocked => std::option::Option::Some("API_KEY_IOS_APP_BLOCKED"),
Self::RateLimitExceeded => std::option::Option::Some("RATE_LIMIT_EXCEEDED"),
Self::ResourceQuotaExceeded => std::option::Option::Some("RESOURCE_QUOTA_EXCEEDED"),
Self::LocationTaxPolicyViolated => {
std::option::Option::Some("LOCATION_TAX_POLICY_VIOLATED")
}
Self::UserProjectDenied => std::option::Option::Some("USER_PROJECT_DENIED"),
Self::ConsumerSuspended => std::option::Option::Some("CONSUMER_SUSPENDED"),
Self::ConsumerInvalid => std::option::Option::Some("CONSUMER_INVALID"),
Self::SecurityPolicyViolated => std::option::Option::Some("SECURITY_POLICY_VIOLATED"),
Self::AccessTokenExpired => std::option::Option::Some("ACCESS_TOKEN_EXPIRED"),
Self::AccessTokenScopeInsufficient => {
std::option::Option::Some("ACCESS_TOKEN_SCOPE_INSUFFICIENT")
}
Self::AccountStateInvalid => std::option::Option::Some("ACCOUNT_STATE_INVALID"),
Self::AccessTokenTypeUnsupported => {
std::option::Option::Some("ACCESS_TOKEN_TYPE_UNSUPPORTED")
}
Self::CredentialsMissing => std::option::Option::Some("CREDENTIALS_MISSING"),
Self::ResourceProjectInvalid => std::option::Option::Some("RESOURCE_PROJECT_INVALID"),
Self::SessionCookieInvalid => std::option::Option::Some("SESSION_COOKIE_INVALID"),
Self::UserBlockedByAdmin => std::option::Option::Some("USER_BLOCKED_BY_ADMIN"),
Self::ResourceUsageRestrictionViolated => {
std::option::Option::Some("RESOURCE_USAGE_RESTRICTION_VIOLATED")
}
Self::SystemParameterUnsupported => {
std::option::Option::Some("SYSTEM_PARAMETER_UNSUPPORTED")
}
Self::OrgRestrictionViolation => std::option::Option::Some("ORG_RESTRICTION_VIOLATION"),
Self::OrgRestrictionHeaderInvalid => {
std::option::Option::Some("ORG_RESTRICTION_HEADER_INVALID")
}
Self::ServiceNotVisible => std::option::Option::Some("SERVICE_NOT_VISIBLE"),
Self::GcpSuspended => std::option::Option::Some("GCP_SUSPENDED"),
Self::LocationPolicyViolated => std::option::Option::Some("LOCATION_POLICY_VIOLATED"),
Self::MissingOrigin => std::option::Option::Some("MISSING_ORIGIN"),
Self::OverloadedCredentials => std::option::Option::Some("OVERLOADED_CREDENTIALS"),
Self::LocationOrgPolicyViolated => {
std::option::Option::Some("LOCATION_ORG_POLICY_VIOLATED")
}
Self::TlsOrgPolicyViolated => std::option::Option::Some("TLS_ORG_POLICY_VIOLATED"),
Self::EmulatorQuotaExceeded => std::option::Option::Some("EMULATOR_QUOTA_EXCEEDED"),
Self::CredentialAndroidAppInvalid => {
std::option::Option::Some("CREDENTIAL_ANDROID_APP_INVALID")
}
Self::IamPermissionDenied => std::option::Option::Some("IAM_PERMISSION_DENIED"),
Self::JwtTokenInvalid => std::option::Option::Some("JWT_TOKEN_INVALID"),
Self::CredentialTypeUnsupported => {
std::option::Option::Some("CREDENTIAL_TYPE_UNSUPPORTED")
}
Self::AccountTypeUnsupported => std::option::Option::Some("ACCOUNT_TYPE_UNSUPPORTED"),
Self::EndpointUsageRestrictionViolated => {
std::option::Option::Some("ENDPOINT_USAGE_RESTRICTION_VIOLATED")
}
Self::TlsCipherRestrictionViolated => {
std::option::Option::Some("TLS_CIPHER_RESTRICTION_VIOLATED")
}
Self::McpServerDisabled => std::option::Option::Some("MCP_SERVER_DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorReason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ErrorReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ServiceDisabled,
2 => Self::BillingDisabled,
3 => Self::ApiKeyInvalid,
4 => Self::ApiKeyServiceBlocked,
5 => Self::RateLimitExceeded,
6 => Self::ResourceQuotaExceeded,
7 => Self::ApiKeyHttpReferrerBlocked,
8 => Self::ApiKeyIpAddressBlocked,
9 => Self::ApiKeyAndroidAppBlocked,
10 => Self::LocationTaxPolicyViolated,
11 => Self::UserProjectDenied,
12 => Self::ConsumerSuspended,
13 => Self::ApiKeyIosAppBlocked,
14 => Self::ConsumerInvalid,
15 => Self::SecurityPolicyViolated,
16 => Self::AccessTokenExpired,
17 => Self::AccessTokenScopeInsufficient,
18 => Self::AccountStateInvalid,
19 => Self::AccessTokenTypeUnsupported,
20 => Self::CredentialsMissing,
21 => Self::ResourceProjectInvalid,
23 => Self::SessionCookieInvalid,
24 => Self::UserBlockedByAdmin,
25 => Self::ResourceUsageRestrictionViolated,
26 => Self::SystemParameterUnsupported,
27 => Self::OrgRestrictionViolation,
28 => Self::OrgRestrictionHeaderInvalid,
29 => Self::ServiceNotVisible,
30 => Self::GcpSuspended,
31 => Self::LocationPolicyViolated,
33 => Self::MissingOrigin,
34 => Self::OverloadedCredentials,
35 => Self::LocationOrgPolicyViolated,
36 => Self::TlsOrgPolicyViolated,
38 => Self::EmulatorQuotaExceeded,
39 => Self::CredentialAndroidAppInvalid,
41 => Self::IamPermissionDenied,
42 => Self::JwtTokenInvalid,
43 => Self::CredentialTypeUnsupported,
44 => Self::AccountTypeUnsupported,
45 => Self::EndpointUsageRestrictionViolated,
46 => Self::TlsCipherRestrictionViolated,
47 => Self::McpServerDisabled,
_ => Self::UnknownValue(error_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ERROR_REASON_UNSPECIFIED" => Self::Unspecified,
"SERVICE_DISABLED" => Self::ServiceDisabled,
"BILLING_DISABLED" => Self::BillingDisabled,
"API_KEY_INVALID" => Self::ApiKeyInvalid,
"API_KEY_SERVICE_BLOCKED" => Self::ApiKeyServiceBlocked,
"API_KEY_HTTP_REFERRER_BLOCKED" => Self::ApiKeyHttpReferrerBlocked,
"API_KEY_IP_ADDRESS_BLOCKED" => Self::ApiKeyIpAddressBlocked,
"API_KEY_ANDROID_APP_BLOCKED" => Self::ApiKeyAndroidAppBlocked,
"API_KEY_IOS_APP_BLOCKED" => Self::ApiKeyIosAppBlocked,
"RATE_LIMIT_EXCEEDED" => Self::RateLimitExceeded,
"RESOURCE_QUOTA_EXCEEDED" => Self::ResourceQuotaExceeded,
"LOCATION_TAX_POLICY_VIOLATED" => Self::LocationTaxPolicyViolated,
"USER_PROJECT_DENIED" => Self::UserProjectDenied,
"CONSUMER_SUSPENDED" => Self::ConsumerSuspended,
"CONSUMER_INVALID" => Self::ConsumerInvalid,
"SECURITY_POLICY_VIOLATED" => Self::SecurityPolicyViolated,
"ACCESS_TOKEN_EXPIRED" => Self::AccessTokenExpired,
"ACCESS_TOKEN_SCOPE_INSUFFICIENT" => Self::AccessTokenScopeInsufficient,
"ACCOUNT_STATE_INVALID" => Self::AccountStateInvalid,
"ACCESS_TOKEN_TYPE_UNSUPPORTED" => Self::AccessTokenTypeUnsupported,
"CREDENTIALS_MISSING" => Self::CredentialsMissing,
"RESOURCE_PROJECT_INVALID" => Self::ResourceProjectInvalid,
"SESSION_COOKIE_INVALID" => Self::SessionCookieInvalid,
"USER_BLOCKED_BY_ADMIN" => Self::UserBlockedByAdmin,
"RESOURCE_USAGE_RESTRICTION_VIOLATED" => Self::ResourceUsageRestrictionViolated,
"SYSTEM_PARAMETER_UNSUPPORTED" => Self::SystemParameterUnsupported,
"ORG_RESTRICTION_VIOLATION" => Self::OrgRestrictionViolation,
"ORG_RESTRICTION_HEADER_INVALID" => Self::OrgRestrictionHeaderInvalid,
"SERVICE_NOT_VISIBLE" => Self::ServiceNotVisible,
"GCP_SUSPENDED" => Self::GcpSuspended,
"LOCATION_POLICY_VIOLATED" => Self::LocationPolicyViolated,
"MISSING_ORIGIN" => Self::MissingOrigin,
"OVERLOADED_CREDENTIALS" => Self::OverloadedCredentials,
"LOCATION_ORG_POLICY_VIOLATED" => Self::LocationOrgPolicyViolated,
"TLS_ORG_POLICY_VIOLATED" => Self::TlsOrgPolicyViolated,
"EMULATOR_QUOTA_EXCEEDED" => Self::EmulatorQuotaExceeded,
"CREDENTIAL_ANDROID_APP_INVALID" => Self::CredentialAndroidAppInvalid,
"IAM_PERMISSION_DENIED" => Self::IamPermissionDenied,
"JWT_TOKEN_INVALID" => Self::JwtTokenInvalid,
"CREDENTIAL_TYPE_UNSUPPORTED" => Self::CredentialTypeUnsupported,
"ACCOUNT_TYPE_UNSUPPORTED" => Self::AccountTypeUnsupported,
"ENDPOINT_USAGE_RESTRICTION_VIOLATED" => Self::EndpointUsageRestrictionViolated,
"TLS_CIPHER_RESTRICTION_VIOLATED" => Self::TlsCipherRestrictionViolated,
"MCP_SERVER_DISABLED" => Self::McpServerDisabled,
_ => Self::UnknownValue(error_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ServiceDisabled => serializer.serialize_i32(1),
Self::BillingDisabled => serializer.serialize_i32(2),
Self::ApiKeyInvalid => serializer.serialize_i32(3),
Self::ApiKeyServiceBlocked => serializer.serialize_i32(4),
Self::ApiKeyHttpReferrerBlocked => serializer.serialize_i32(7),
Self::ApiKeyIpAddressBlocked => serializer.serialize_i32(8),
Self::ApiKeyAndroidAppBlocked => serializer.serialize_i32(9),
Self::ApiKeyIosAppBlocked => serializer.serialize_i32(13),
Self::RateLimitExceeded => serializer.serialize_i32(5),
Self::ResourceQuotaExceeded => serializer.serialize_i32(6),
Self::LocationTaxPolicyViolated => serializer.serialize_i32(10),
Self::UserProjectDenied => serializer.serialize_i32(11),
Self::ConsumerSuspended => serializer.serialize_i32(12),
Self::ConsumerInvalid => serializer.serialize_i32(14),
Self::SecurityPolicyViolated => serializer.serialize_i32(15),
Self::AccessTokenExpired => serializer.serialize_i32(16),
Self::AccessTokenScopeInsufficient => serializer.serialize_i32(17),
Self::AccountStateInvalid => serializer.serialize_i32(18),
Self::AccessTokenTypeUnsupported => serializer.serialize_i32(19),
Self::CredentialsMissing => serializer.serialize_i32(20),
Self::ResourceProjectInvalid => serializer.serialize_i32(21),
Self::SessionCookieInvalid => serializer.serialize_i32(23),
Self::UserBlockedByAdmin => serializer.serialize_i32(24),
Self::ResourceUsageRestrictionViolated => serializer.serialize_i32(25),
Self::SystemParameterUnsupported => serializer.serialize_i32(26),
Self::OrgRestrictionViolation => serializer.serialize_i32(27),
Self::OrgRestrictionHeaderInvalid => serializer.serialize_i32(28),
Self::ServiceNotVisible => serializer.serialize_i32(29),
Self::GcpSuspended => serializer.serialize_i32(30),
Self::LocationPolicyViolated => serializer.serialize_i32(31),
Self::MissingOrigin => serializer.serialize_i32(33),
Self::OverloadedCredentials => serializer.serialize_i32(34),
Self::LocationOrgPolicyViolated => serializer.serialize_i32(35),
Self::TlsOrgPolicyViolated => serializer.serialize_i32(36),
Self::EmulatorQuotaExceeded => serializer.serialize_i32(38),
Self::CredentialAndroidAppInvalid => serializer.serialize_i32(39),
Self::IamPermissionDenied => serializer.serialize_i32(41),
Self::JwtTokenInvalid => serializer.serialize_i32(42),
Self::CredentialTypeUnsupported => serializer.serialize_i32(43),
Self::AccountTypeUnsupported => serializer.serialize_i32(44),
Self::EndpointUsageRestrictionViolated => serializer.serialize_i32(45),
Self::TlsCipherRestrictionViolated => serializer.serialize_i32(46),
Self::McpServerDisabled => serializer.serialize_i32(47),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ErrorReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorReason>::new(
".google.api.ErrorReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FieldBehavior {
Unspecified,
Optional,
Required,
OutputOnly,
InputOnly,
Immutable,
UnorderedList,
NonEmptyDefault,
Identifier,
UnknownValue(field_behavior::UnknownValue),
}
#[doc(hidden)]
pub mod field_behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FieldBehavior {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Optional => std::option::Option::Some(1),
Self::Required => std::option::Option::Some(2),
Self::OutputOnly => std::option::Option::Some(3),
Self::InputOnly => std::option::Option::Some(4),
Self::Immutable => std::option::Option::Some(5),
Self::UnorderedList => std::option::Option::Some(6),
Self::NonEmptyDefault => std::option::Option::Some(7),
Self::Identifier => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FIELD_BEHAVIOR_UNSPECIFIED"),
Self::Optional => std::option::Option::Some("OPTIONAL"),
Self::Required => std::option::Option::Some("REQUIRED"),
Self::OutputOnly => std::option::Option::Some("OUTPUT_ONLY"),
Self::InputOnly => std::option::Option::Some("INPUT_ONLY"),
Self::Immutable => std::option::Option::Some("IMMUTABLE"),
Self::UnorderedList => std::option::Option::Some("UNORDERED_LIST"),
Self::NonEmptyDefault => std::option::Option::Some("NON_EMPTY_DEFAULT"),
Self::Identifier => std::option::Option::Some("IDENTIFIER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FieldBehavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FieldBehavior {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FieldBehavior {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Optional,
2 => Self::Required,
3 => Self::OutputOnly,
4 => Self::InputOnly,
5 => Self::Immutable,
6 => Self::UnorderedList,
7 => Self::NonEmptyDefault,
8 => Self::Identifier,
_ => Self::UnknownValue(field_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FieldBehavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIELD_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
"OPTIONAL" => Self::Optional,
"REQUIRED" => Self::Required,
"OUTPUT_ONLY" => Self::OutputOnly,
"INPUT_ONLY" => Self::InputOnly,
"IMMUTABLE" => Self::Immutable,
"UNORDERED_LIST" => Self::UnorderedList,
"NON_EMPTY_DEFAULT" => Self::NonEmptyDefault,
"IDENTIFIER" => Self::Identifier,
_ => Self::UnknownValue(field_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FieldBehavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Optional => serializer.serialize_i32(1),
Self::Required => serializer.serialize_i32(2),
Self::OutputOnly => serializer.serialize_i32(3),
Self::InputOnly => serializer.serialize_i32(4),
Self::Immutable => serializer.serialize_i32(5),
Self::UnorderedList => serializer.serialize_i32(6),
Self::NonEmptyDefault => serializer.serialize_i32(7),
Self::Identifier => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FieldBehavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FieldBehavior>::new(
".google.api.FieldBehavior",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LaunchStage {
Unspecified,
Unimplemented,
Prelaunch,
EarlyAccess,
Alpha,
Beta,
Ga,
Deprecated,
UnknownValue(launch_stage::UnknownValue),
}
#[doc(hidden)]
pub mod launch_stage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LaunchStage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Unimplemented => std::option::Option::Some(6),
Self::Prelaunch => std::option::Option::Some(7),
Self::EarlyAccess => std::option::Option::Some(1),
Self::Alpha => std::option::Option::Some(2),
Self::Beta => std::option::Option::Some(3),
Self::Ga => std::option::Option::Some(4),
Self::Deprecated => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LAUNCH_STAGE_UNSPECIFIED"),
Self::Unimplemented => std::option::Option::Some("UNIMPLEMENTED"),
Self::Prelaunch => std::option::Option::Some("PRELAUNCH"),
Self::EarlyAccess => std::option::Option::Some("EARLY_ACCESS"),
Self::Alpha => std::option::Option::Some("ALPHA"),
Self::Beta => std::option::Option::Some("BETA"),
Self::Ga => std::option::Option::Some("GA"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LaunchStage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LaunchStage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LaunchStage {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EarlyAccess,
2 => Self::Alpha,
3 => Self::Beta,
4 => Self::Ga,
5 => Self::Deprecated,
6 => Self::Unimplemented,
7 => Self::Prelaunch,
_ => Self::UnknownValue(launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LaunchStage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LAUNCH_STAGE_UNSPECIFIED" => Self::Unspecified,
"UNIMPLEMENTED" => Self::Unimplemented,
"PRELAUNCH" => Self::Prelaunch,
"EARLY_ACCESS" => Self::EarlyAccess,
"ALPHA" => Self::Alpha,
"BETA" => Self::Beta,
"GA" => Self::Ga,
"DEPRECATED" => Self::Deprecated,
_ => Self::UnknownValue(launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LaunchStage {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Unimplemented => serializer.serialize_i32(6),
Self::Prelaunch => serializer.serialize_i32(7),
Self::EarlyAccess => serializer.serialize_i32(1),
Self::Alpha => serializer.serialize_i32(2),
Self::Beta => serializer.serialize_i32(3),
Self::Ga => serializer.serialize_i32(4),
Self::Deprecated => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LaunchStage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LaunchStage>::new(
".google.api.LaunchStage",
))
}
}