2.10.3 (latest) 2.10.2 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 Assignment.

An assignment allows a project to submit jobs
of a certain type using slots from the specified reservation.

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

## 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. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters. |
| `↳ assignee` | `string` Optional. The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`. |
| `↳ job_type` | `int` Optional. Which type of jobs will use the reservation. |
| `↳ state` | `int` Output only. State of the assignment. |
| `↳ enable_gemini_in_bigquery` | `bool` Optional. Deprecated: "Gemini in BigQuery" is now available by default for all BigQuery editions and should not be explicitly set. Controls if "Gemini in BigQuery" (<https://cloud.google.com/gemini/docs/bigquery/overview>) features should be enabled for this reservation assignment. |
| `↳ scheduling_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SchedulingPolicy` Optional. The scheduling policy to use for jobs and queries of this assignee when running under the associated reservation. The scheduling policy controls how the reservation's resources are distributed. This overrides the default scheduling policy specified on the reservation. This feature is not yet generally available. |
| `↳ principal` | `string` Optional. Represents the principal for this assignment. If not empty, jobs run by this principal utilize the associated reservation. Otherwise, jobs fall back to using the reservation assigned to the project, folder, or organization, in that order. If no reservation is assigned at any of these levels, on-demand capacity is used. The supported formats are: \* \* `principal://goog/subject/USER_EMAIL_ADDRESS` for users, \* \* `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts, \* \* `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities. \* \* The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example, deleted users. |
| `↳ precedence` | `int|string` Optional. Specifies the priority precedence for this assignment. Used to resolve ambiguity when multiple assignments match a single job. Higher numerical values represent higher priority (e.g., 20 is higher than 10). If unspecified, it defaults to 0. Multiple assignments can share the same precedence, but it is recommended to use unique precedence values for assignments within the same assignee scope. |
| `↳ condition` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Expr.html` Optional. Common Expression Language (CEL) condition that defines the matching criteria for this assignment. The condition must resolve to a boolean value. Supported variables will be added later. |

### getName

Output only. Name of the resource. E.g.:
`projects/myproject/locations/US/reservations/team1-prod/assignments/123`.

The assignment_id must only contain lower case alphanumeric characters or
dashes and the max length is 64 characters.

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

### setName

Output only. Name of the resource. E.g.:
`projects/myproject/locations/US/reservations/team1-prod/assignments/123`.

The assignment_id must only contain lower case alphanumeric characters or
dashes and the max length is 64 characters.

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

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

### getAssignee

Optional. The resource which will use the reservation. E.g.

`projects/myproject`, `folders/123`, or `organizations/456`.

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

### setAssignee

Optional. The resource which will use the reservation. E.g.

`projects/myproject`, `folders/123`, or `organizations/456`.

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

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

### getJobType

Optional. Which type of jobs will use the reservation.

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

### setJobType

Optional. Which type of jobs will use the reservation.

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

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

### getState

Output only. State of the assignment.

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

### setState

Output only. State of the assignment.

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

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

### getEnableGeminiInBigquery

Optional. Deprecated: "Gemini in BigQuery" is now available by
default for all BigQuery editions and should not be explicitly set.

Controls if "Gemini in BigQuery"
(<https://cloud.google.com/gemini/docs/bigquery/overview>) features should be
enabled for this reservation assignment.

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

### setEnableGeminiInBigquery

Optional. Deprecated: "Gemini in BigQuery" is now available by
default for all BigQuery editions and should not be explicitly set.

Controls if "Gemini in BigQuery"
(<https://cloud.google.com/gemini/docs/bigquery/overview>) features should be
enabled for this reservation assignment.

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

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

### getSchedulingPolicy

Optional. The scheduling policy to use for jobs and queries of this
assignee when running under the associated reservation. The scheduling
policy controls how the reservation's resources are distributed. This
overrides the default scheduling policy specified on the reservation.

This feature is not yet generally available.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SchedulingPolicy|null` |   |

### hasSchedulingPolicy

### clearSchedulingPolicy

### setSchedulingPolicy

Optional. The scheduling policy to use for jobs and queries of this
assignee when running under the associated reservation. The scheduling
policy controls how the reservation's resources are distributed. This
overrides the default scheduling policy specified on the reservation.

This feature is not yet generally available.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SchedulingPolicy` |

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

### getPrincipal

Optional. Represents the principal for this assignment. If not empty, jobs
run by this principal utilize the associated reservation. Otherwise, jobs
fall back to using the reservation assigned to the project, folder,
or organization, in that order. If no reservation is assigned at any of
these levels, on-demand capacity is used.

The supported formats are:

- `principal://goog/subject/USER_EMAIL_ADDRESS` for users,
- `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts,
- `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities.
- The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example, deleted users.

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

### setPrincipal

Optional. Represents the principal for this assignment. If not empty, jobs
run by this principal utilize the associated reservation. Otherwise, jobs
fall back to using the reservation assigned to the project, folder,
or organization, in that order. If no reservation is assigned at any of
these levels, on-demand capacity is used.

The supported formats are:

- `principal://goog/subject/USER_EMAIL_ADDRESS` for users,
- `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts,
- `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities.
- The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example, deleted users.

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

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

### getPrecedence

Optional. Specifies the priority precedence for this assignment. Used to
resolve ambiguity when multiple assignments match a single job. Higher
numerical values represent higher priority (e.g., 20 is higher than 10). If
unspecified, it defaults to 0. Multiple assignments can share the same
precedence, but it is recommended to use unique precedence values for
assignments within the same assignee scope.

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

### setPrecedence

Optional. Specifies the priority precedence for this assignment. Used to
resolve ambiguity when multiple assignments match a single job. Higher
numerical values represent higher priority (e.g., 20 is higher than 10). If
unspecified, it defaults to 0. Multiple assignments can share the same
precedence, but it is recommended to use unique precedence values for
assignments within the same assignee scope.

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

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

### getCondition

Optional. Common Expression Language (CEL) condition that defines the
matching criteria for this assignment.

The condition must resolve to a boolean value.
Supported variables will be added later.

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

### hasCondition

### clearCondition

### setCondition

Optional. Common Expression Language (CEL) condition that defines the
matching criteria for this assignment.

The condition must resolve to a boolean value.
Supported variables will be added later.

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

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