#[non_exhaustive]pub struct QuotaPreference {
pub name: String,
pub dimensions: HashMap<String, String>,
pub quota_config: Option<QuotaConfig>,
pub etag: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub service: String,
pub quota_id: String,
pub reconciling: bool,
pub justification: String,
pub contact_email: String,
/* private fields */
}Expand description
QuotaPreference represents the preferred quota configuration specified for a project, folder or organization. There is only one QuotaPreference resource for a quota value targeting a unique set of dimensions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringRequired except in the CREATE requests.
The resource name of the quota preference.
The ID component following “locations/” must be “global”.
Example:
projects/123/locations/global/quotaPreferences/my-config-for-us-east1
dimensions: HashMap<String, String>Immutable. The dimensions that this quota preference applies to. The key of the map entry is the name of a dimension, such as “region”, “zone”, “network_id”, and the value of the map entry is the dimension value.
If a dimension is missing from the map of dimensions, the quota preference applies to all the dimension values except for those that have other quota preferences configured for the specific value.
NOTE: QuotaPreferences can only be applied across all values of “user” and “resource” dimension. Do not set values for “user” or “resource” in the dimension map.
Example: {“provider”, “Foo Inc”} where “provider” is a service specific dimension.
quota_config: Option<QuotaConfig>Required. Preferred quota configuration.
etag: StringOptional. The current etag of the quota preference. If an etag is provided on update and does not match the current server’s etag of the quota preference, the request will be blocked and an ABORTED error will be returned. See https://google.aip.dev/134#etags for more details on etags.
create_time: Option<Timestamp>Output only. Create time stamp
update_time: Option<Timestamp>Output only. Update time stamp
service: StringRequired. The name of the service to which the quota preference is applied.
quota_id: StringRequired. The id of the quota to which the quota preference is applied. A
quota name is unique in the service. Example: CpusPerProjectPerRegion
reconciling: boolOutput only. Is the quota preference pending Google Cloud approval and fulfillment.
justification: StringThe reason / justification for this quota preference.
contact_email: StringInput only. An email address that can be used to contact the the user, in case Google Cloud needs more information to make a decision before additional quota can be granted.
When requesting a quota increase, the email address is required.
When requesting a quota decrease, the email address is optional.
For example, the email address is optional when the
QuotaConfig.preferred_value is smaller than the
QuotaDetails.reset_value.
Implementations§
Source§impl QuotaPreference
impl QuotaPreference
pub fn new() -> Self
Sourcepub fn set_dimensions<T, K, V>(self, v: T) -> Self
pub fn set_dimensions<T, K, V>(self, v: T) -> Self
Sets the value of dimensions.
§Example
let x = QuotaPreference::new().set_dimensions([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_quota_config<T>(self, v: T) -> Selfwhere
T: Into<QuotaConfig>,
pub fn set_quota_config<T>(self, v: T) -> Selfwhere
T: Into<QuotaConfig>,
Sets the value of quota_config.
§Example
use google_cloud_api_cloudquotas_v1::model::QuotaConfig;
let x = QuotaPreference::new().set_quota_config(QuotaConfig::default()/* use setters */);Sourcepub fn set_or_clear_quota_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<QuotaConfig>,
pub fn set_or_clear_quota_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<QuotaConfig>,
Sets or clears the value of quota_config.
§Example
use google_cloud_api_cloudquotas_v1::model::QuotaConfig;
let x = QuotaPreference::new().set_or_clear_quota_config(Some(QuotaConfig::default()/* use setters */));
let x = QuotaPreference::new().set_or_clear_quota_config(None::<QuotaConfig>);Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = QuotaPreference::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = QuotaPreference::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = QuotaPreference::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = QuotaPreference::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = QuotaPreference::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = QuotaPreference::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_service<T: Into<String>>(self, v: T) -> Self
pub fn set_service<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_quota_id<T: Into<String>>(self, v: T) -> Self
pub fn set_quota_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_reconciling<T: Into<bool>>(self, v: T) -> Self
pub fn set_reconciling<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_justification<T: Into<String>>(self, v: T) -> Self
pub fn set_justification<T: Into<String>>(self, v: T) -> Self
Sets the value of justification.
§Example
let x = QuotaPreference::new().set_justification("example");Sourcepub fn set_contact_email<T: Into<String>>(self, v: T) -> Self
pub fn set_contact_email<T: Into<String>>(self, v: T) -> Self
Sets the value of contact_email.
§Example
let x = QuotaPreference::new().set_contact_email("example");Trait Implementations§
Source§impl Clone for QuotaPreference
impl Clone for QuotaPreference
Source§fn clone(&self) -> QuotaPreference
fn clone(&self) -> QuotaPreference
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more