Skip to main content

CapacityCommitment

Struct CapacityCommitment 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output 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: i64

Optional. Number of slots in this commitment.

§plan: CommitmentPlan

Optional. Capacity commitment commitment plan.

§state: State

Output 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: CommitmentPlan

Optional. 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: bool
👎Deprecated

Applicable 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: Edition

Optional. Edition of the capacity commitment.

§is_flat_rate: bool

Output only. If true, the commitment is a flat-rate commitment, otherwise, it’s an edition commitment.

Implementations§

Source§

impl CapacityCommitment

Source

pub fn new() -> Self

Creates a new default instance.

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = CapacityCommitment::new().set_name(format!("projects/{project_id}/locations/{location_id}/capacityCommitments/{capacity_commitment_id}"));
Source

pub fn set_slot_count<T: Into<i64>>(self, v: T) -> Self

Sets the value of slot_count.

§Example
let x = CapacityCommitment::new().set_slot_count(42);
Source

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);
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_bigquery_reservation_v1::model::capacity_commitment::State;
let x0 = CapacityCommitment::new().set_state(State::Pending);
let x1 = CapacityCommitment::new().set_state(State::Active);
let x2 = CapacityCommitment::new().set_state(State::Failed);
Source

pub fn set_commitment_start_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of commitment_start_time.

§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_commitment_start_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_commitment_start_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

pub fn set_commitment_end_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of commitment_end_time.

§Example
use wkt::Timestamp;
let x = CapacityCommitment::new().set_commitment_end_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_commitment_end_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

pub fn set_failure_status<T>(self, v: T) -> Self
where T: Into<Status>,

Sets the value of failure_status.

§Example
use google_cloud_rpc::model::Status;
let x = CapacityCommitment::new().set_failure_status(Status::default()/* use setters */);
Source

pub fn set_or_clear_failure_status<T>(self, v: Option<T>) -> Self
where T: Into<Status>,

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>);
Source

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);
Source

pub fn set_multi_region_auxiliary<T: Into<bool>>(self, v: T) -> Self

👎Deprecated

Sets the value of multi_region_auxiliary.

§Example
let x = CapacityCommitment::new().set_multi_region_auxiliary(true);
Source

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);
Source

pub fn set_is_flat_rate<T: Into<bool>>(self, v: T) -> Self

Sets the value of is_flat_rate.

§Example
let x = CapacityCommitment::new().set_is_flat_rate(true);

Trait Implementations§

Source§

impl Clone for CapacityCommitment

Source§

fn clone(&self) -> CapacityCommitment

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CapacityCommitment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CapacityCommitment

Source§

fn default() -> CapacityCommitment

Returns the “default value” for a type. Read more
Source§

impl Message for CapacityCommitment

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for CapacityCommitment

Source§

fn eq(&self, other: &CapacityCommitment) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CapacityCommitment

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more