2.11.0 (latest) 2.10.3 2.7.0 2.6.2 2.5.0 2.4.0 2.3.0 2.2.1 2.1.2 2.0.2 1.3.5 1.2.3 1.1.2 1.0.3 Reference documentation and code samples for the Google BigQuery Reservation V1 Client class CapacityCommitment.

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.

Generated from protobuf message `google.cloud.bigquery.reservation.v1.CapacityCommitment`

## Namespace

Google \\ Cloud \\ BigQuery \\ Reservation \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ 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` | `int|string` Optional. Number of slots in this commitment. |
| `↳ plan` | `int` Optional. Capacity commitment commitment plan. |
| `↳ state` | `int` Output only. State of the commitment. |
| `↳ commitment_start_time` | `Google\Protobuf\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` | `Google\Protobuf\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` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` Output only. For FAILED commitment plan, provides the reason of failure. |
| `↳ renewal_plan` | `int` 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` 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` | `int` 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. |

### getName

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSlotCount

Optional. Number of slots in this commitment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setSlotCount

Optional. Number of slots in this commitment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPlan

Optional. Capacity commitment commitment plan.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [CommitmentPlan](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.CommitmentPlan). |

### setPlan

Optional. Capacity commitment commitment plan.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [CommitmentPlan](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.CommitmentPlan). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getState

Output only. State of the commitment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.State). |

### setState

Output only. State of the commitment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.State). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCommitmentStartTime

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCommitmentStartTime

### clearCommitmentStartTime

### setCommitmentStartTime

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCommitmentEndTime

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 ,

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCommitmentEndTime

### clearCommitmentEndTime

### setCommitmentEndTime

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 ,

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFailureStatus

Output only. For FAILED commitment plan, provides the reason of failure.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasFailureStatus

### clearFailureStatus

### setFailureStatus

Output only. For FAILED commitment plan, provides the reason of failure.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRenewalPlan

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [CommitmentPlan](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.CommitmentPlan). |

### setRenewalPlan

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [CommitmentPlan](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment.CommitmentPlan). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMultiRegionAuxiliary

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setMultiRegionAuxiliary

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEdition

Optional. Edition of the capacity commitment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Edition](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Edition). |

### setEdition

Optional. Edition of the capacity commitment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Edition](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Edition). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getIsFlatRate

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setIsFlatRate

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |