#[non_exhaustive]pub struct CapacityCommitment {
pub name: String,
pub slot_count: i64,
pub plan: CommitmentPlan,
pub state: State,
pub commitment_start_time: Option<Timestamp>,
pub commitment_end_time: Option<Timestamp>,
pub failure_status: Option<Status>,
pub renewal_plan: CommitmentPlan,
pub multi_region_auxiliary: bool,
pub edition: Edition,
pub is_flat_rate: bool,
/* private fields */
}Expand description
Capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes.
In order to remove annual commitment, its plan needs to be changed to monthly or flex first.
A capacity commitment resource exists as a child resource of the admin project.
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: StringOutput only. The resource name of the capacity commitment, e.g.,
projects/myproject/locations/US/capacityCommitments/123
The commitment_id must only contain lower case alphanumeric characters or
dashes. It must start with a letter and must not end
with a dash. Its maximum length is 64 characters.
slot_count: i64Optional. Number of slots in this commitment.
plan: CommitmentPlanOptional. Capacity commitment commitment plan.
state: StateOutput only. State of the commitment.
commitment_start_time: Option<Timestamp>Output only. The start of the current commitment period. It is applicable only for ACTIVE capacity commitments. Note after the commitment is renewed, commitment_start_time won’t be changed. It refers to the start time of the original commitment.
commitment_end_time: Option<Timestamp>Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments. Note after renewal, commitment_end_time is the time the renewed commitment expires. So itwould be at a time after commitment_start_time + committed period, because we don’t change commitment_start_time ,
failure_status: Option<Status>Output only. For FAILED commitment plan, provides the reason of failure.
renewal_plan: CommitmentPlanOptional. The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.
multi_region_auxiliary: boolApplicable only for commitments located within one of the BigQuery multi-regions (US or EU).
If set to true, this commitment is placed in the organization’s secondary region which is designated for disaster recovery purposes. If false, this commitment is placed in the organization’s default region.
NOTE: this is a preview feature. Project must be allow-listed in order to set this field.
edition: EditionOptional. Edition of the capacity commitment.
is_flat_rate: boolOutput only. If true, the commitment is a flat-rate commitment, otherwise, it’s an edition commitment.
Implementations§
Source§impl CapacityCommitment
impl CapacityCommitment
Sourcepub fn set_slot_count<T: Into<i64>>(self, v: T) -> Self
pub fn set_slot_count<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_plan<T: Into<CommitmentPlan>>(self, v: T) -> Self
pub fn set_plan<T: Into<CommitmentPlan>>(self, v: T) -> Self
Sets the value of plan.
§Example
use google_cloud_bigquery_reservation_v1::model::capacity_commitment::CommitmentPlan;
let x0 = CapacityCommitment::new().set_plan(CommitmentPlan::Flex);
let x1 = CapacityCommitment::new().set_plan(CommitmentPlan::Monthly);
let x2 = CapacityCommitment::new().set_plan(CommitmentPlan::Annual);Sourcepub fn set_commitment_start_time<T>(self, v: T) -> Self
pub fn set_commitment_start_time<T>(self, v: T) -> Self
Sets the value of commitment_start_time.
§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_commitment_start_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_commitment_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_commitment_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of commitment_start_time.
§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_or_clear_commitment_start_time(Some(Timestamp::default()/* use setters */));
let x = CapacityCommitment::new().set_or_clear_commitment_start_time(None::<Timestamp>);Sourcepub fn set_commitment_end_time<T>(self, v: T) -> Self
pub fn set_commitment_end_time<T>(self, v: T) -> Self
Sets the value of commitment_end_time.
§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_commitment_end_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_commitment_end_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_commitment_end_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of commitment_end_time.
§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_or_clear_commitment_end_time(Some(Timestamp::default()/* use setters */));
let x = CapacityCommitment::new().set_or_clear_commitment_end_time(None::<Timestamp>);Sourcepub fn set_failure_status<T>(self, v: T) -> Self
pub fn set_failure_status<T>(self, v: T) -> Self
Sets the value of failure_status.
§Example
use google_cloud_rpc::model::Status;
let x = CapacityCommitment::new().set_failure_status(Status::default()/* use setters */);Sourcepub fn set_or_clear_failure_status<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_failure_status<T>(self, v: Option<T>) -> Self
Sets or clears the value of failure_status.
§Example
use google_cloud_rpc::model::Status;
let x = CapacityCommitment::new().set_or_clear_failure_status(Some(Status::default()/* use setters */));
let x = CapacityCommitment::new().set_or_clear_failure_status(None::<Status>);Sourcepub fn set_renewal_plan<T: Into<CommitmentPlan>>(self, v: T) -> Self
pub fn set_renewal_plan<T: Into<CommitmentPlan>>(self, v: T) -> Self
Sets the value of renewal_plan.
§Example
use google_cloud_bigquery_reservation_v1::model::capacity_commitment::CommitmentPlan;
let x0 = CapacityCommitment::new().set_renewal_plan(CommitmentPlan::Flex);
let x1 = CapacityCommitment::new().set_renewal_plan(CommitmentPlan::Monthly);
let x2 = CapacityCommitment::new().set_renewal_plan(CommitmentPlan::Annual);Sourcepub fn set_multi_region_auxiliary<T: Into<bool>>(self, v: T) -> Self
👎Deprecated
pub fn set_multi_region_auxiliary<T: Into<bool>>(self, v: T) -> Self
Sets the value of multi_region_auxiliary.
§Example
let x = CapacityCommitment::new().set_multi_region_auxiliary(true);Sourcepub fn set_edition<T: Into<Edition>>(self, v: T) -> Self
pub fn set_edition<T: Into<Edition>>(self, v: T) -> Self
Sets the value of edition.
§Example
use google_cloud_bigquery_reservation_v1::model::Edition;
let x0 = CapacityCommitment::new().set_edition(Edition::Standard);
let x1 = CapacityCommitment::new().set_edition(Edition::Enterprise);
let x2 = CapacityCommitment::new().set_edition(Edition::EnterprisePlus);Sourcepub fn set_is_flat_rate<T: Into<bool>>(self, v: T) -> Self
pub fn set_is_flat_rate<T: Into<bool>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for CapacityCommitment
impl Clone for CapacityCommitment
Source§fn clone(&self) -> CapacityCommitment
fn clone(&self) -> CapacityCommitment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more