On January 1, 2020 this library will no longer support Python 2 on the latest released version. Previously released library versions will continue to be available. For more information please visit Python 2 support on Google Cloud.

Client for Google Cloud Bigquery Reservation API

class google.cloud.bigquery.reservation_v1.Assignment(mapping=None, **kwargs)[source]

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

name

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

Type

str

assignee

The resource which will use the reservation. E.g. projects/myproject, folders/123, or organizations/456.

Type

str

job_type

Which type of jobs will use the reservation.

Type

JobType

state

Output only. State of the assignment.

Type

State

class JobType[source]

Types of job, which could be specified when using the reservation.

class State[source]

Assignment will remain in PENDING state if no active capacity commitment is present. It will become ACTIVE when some capacity commitment becomes active.

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.BiReservation(mapping=None, **kwargs)[source]

Represents a BI Reservation.

name

The resource name of the singleton BI reservation. Reservation names have the form projects/{project_id}/locations/{location_id}/bireservation.

Type

str

update_time

Output only. The last update timestamp of a reservation.

Type

Timestamp

size

Size of a reservation, in bytes.

Type

int

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.CapacityCommitment(mapping=None, **kwargs)[source]

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.

name

Output only. The resource name of the capacity commitment, e.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

slot_count

Number of slots in this commitment.

Type

int

plan

Capacity commitment commitment plan.

Type

CommitmentPlan

state

Output only. State of the commitment.

Type

State

commitment_end_time

Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments.

Type

Timestamp

failure_status

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

Type

Status

renewal_plan

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.

Type

CommitmentPlan

class CommitmentPlan[source]

Commitment plan defines the current committed period. Capacity commitment cannot be deleted during it’s committed period.

class State[source]

Capacity commitment can either become ACTIVE right away or transition from PENDING to ACTIVE or FAILED.

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.CreateAssignmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. Note: “bigquery.reservationAssignments.create” permission is required on the related assignee.

parent

Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod

Type

str

assignment

Assignment resource to create.

Type

Assignment

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.CreateCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].

parent

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US

Type

str

capacity_commitment

Content of the capacity commitment to create.

Type

CapacityCommitment

enforce_single_admin_project_per_org

If true, fail the request if another project in the organization has a capacity commitment.

Type

bool

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.CreateReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].

parent

Required. Project, location. E.g., projects/myproject/locations/US

Type

str

reservation_id

The reservation ID. This field must only contain lower case alphanumeric characters or dash. Max length is 64 characters.

Type

str

reservation

Definition of the new reservation to create.

Type

Reservation

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.DeleteAssignmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. Note: “bigquery.reservationAssignments.delete” permission is required on the related assignee.

name

Required. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.DeleteCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].

name

Required. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.DeleteReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].

name

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.GetBiReservationRequest(mapping=None, **kwargs)[source]

A request to get a singleton BI reservation.

name

Required. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/bireservation

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.GetCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].

name

Required. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.GetReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].

name

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListAssignmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

parent

Required. The parent resource name e.g.:

projects/myproject/locations/US/reservations/team1-prod

Or:

projects/myproject/locations/US/reservations/-

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListAssignmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

assignments

List of assignments visible to the user.

Type

Sequence[Assignment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListCapacityCommitmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

parent

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US

Type

str

page_size

The maximum number of items to return.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListCapacityCommitmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

capacity_commitments

List of capacity commitments visible to the user.

Type

Sequence[CapacityCommitment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListReservationsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

parent

Required. The parent resource name containing project and location, e.g.: “projects/myproject/locations/US”.

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ListReservationsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

reservations

List of reservations visible to the user.

Type

Sequence[Reservation]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.MergeCapacityCommitmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].

parent

Parent resource that identifies admin project and location e.g., projects/myproject/locations/us

Type

str

capacity_commitment_ids

Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent.

Type

Sequence[str]

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.MoveAssignmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].

Note: “bigquery.reservationAssignments.create” permission is required on the destination_id.

Note: “bigquery.reservationAssignments.create” and “bigquery.reservationAssignments.delete” permission are required on the related assignee.

name

Required. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123

Type

str

destination_id

The new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.Reservation(mapping=None, **kwargs)[source]

A reservation is a mechanism used to guarantee slots to users.

name

The resource name of the reservation, e.g., projects/*/locations/*/reservations/team1-prod.

Type

str

slot_capacity

Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the unit of parallelism.

Queries using this reservation might use more slots during runtime if ignore_idle_slots is set to false.

If the new reservation’s slot capacity exceed the parent’s slot capacity or if total slot capacity of the new reservation and its siblings exceeds the parent’s slot capacity, the request will fail with google.rpc.Code.RESOURCE_EXHAUSTED.

Type

int

ignore_idle_slots

If false, any query using this reservation will use idle slots from other reservations within the same admin project. If true, a query using this reservation will execute with the slot capacity specified above at most.

Type

bool

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.SearchAssignmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. Note: “bigquery.reservationAssignments.search” permission is required on the related assignee.

parent

Required. The resource name of the admin project(containing project and location), e.g.: “projects/myproject/locations/US”.

Type

str

query

Please specify resource name as assignee in the query.

Examples:

  • assignee=projects/myproject

  • assignee=folders/123

  • assignee=organizations/456

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.SearchAssignmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].

assignments

List of assignments visible to the user.

Type

Sequence[Assignment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.SplitCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

name

Required. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123

Type

str

slot_count

Number of slots in the capacity commitment after the split.

Type

int

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.SplitCapacityCommitmentResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

first

First capacity commitment, result of a split.

Type

CapacityCommitment

second

Second capacity commitment, result of a split.

Type

CapacityCommitment

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.UpdateBiReservationRequest(mapping=None, **kwargs)[source]

A request to update a BI reservation.

bi_reservation

A reservation to update.

Type

BiReservation

update_mask

A list of fields to be updated in this request.

Type

FieldMask

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.UpdateCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].

capacity_commitment

Content of the capacity commitment to update.

Type

CapacityCommitment

update_mask

Standard field mask for the set of fields to be updated.

Type

FieldMask

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.UpdateReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].

reservation

Content of the reservation to update.

Type

Reservation

update_mask

Standard field mask for the set of fields to be updated.

Type

FieldMask

__bool__()

Return True if any field is truthy, False otherwise.

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accomodate cases not automatically covered.

Parameters

key (str) – The name of the field.

Returns

Whether the field’s value corresponds to a non-empty

wire serialization.

Return type

bool

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__(key)

Retrieve the given field’s value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be “present”.

For primitives, a value of the correct type will always be returned (the “falsy” values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

Note

Some well-known protocol buffer types (e.g. google.protobuf.Timestamp) will be converted to their Python equivalents. See the marshal module for more details.

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.bigquery.reservation_v1.ReservationServiceClient(*, credentials: google.auth.credentials.Credentials = None, transport: Union[str, google.cloud.bigquery.reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport] = None, client_options: <module 'google.api_core.client_options' from '/tmpfs/src/github/python-bigquery-reservation/.nox/docs/lib/python3.7/site-packages/google/api_core/client_options.py'> = None)[source]

This API allows users to manage their flat-rate BigQuery reservations.

A reservation provides computational resource guarantees, in the form of slots, to users. A slot is a unit of computational power in BigQuery, and serves as the basic unit of parallelism. In a scan of a multi-partitioned table, a single slot operates on a single partition of the table. A reservation resource exists as a child resource of the admin project and location, e.g.: projects/myproject/locations/US/reservations/reservationName.

A capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. A capacity commitment resource exists as a child resource of the admin project and location, e.g.: projects/myproject/locations/US/capacityCommitments/id.

Instantiate the reservation service client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Union[str, ReservationServiceTransport]) – The transport to use. If set to None, a transport is chosen automatically.

  • client_options (ClientOptions) – Custom options for the client. (1) The api_endpoint property can be used to override the default endpoint provided by the client. (2) If transport argument is None, client_options can be used to create a mutual TLS transport. If client_cert_source is provided, mutual TLS transport will be created with the given api_endpoint or the default mTLS endpoint, and the client SSL credentials obtained from client_cert_source.

Raises

google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.

static assignment_path(project: str, location: str, reservation: str, assignment: str) → str[source]

Return a fully-qualified assignment string.

static bi_reservation_path(project: str, location: str) → str[source]

Return a fully-qualified bi_reservation string.

static capacity_commitment_path(project: str, location: str, capacity_commitment: str) → str[source]

Return a fully-qualified capacity_commitment string.

create_assignment(request: google.cloud.bigquery.reservation_v1.types.reservation.CreateAssignmentRequest = None, *, parent: str = None, assignment: google.cloud.bigquery.reservation_v1.types.reservation.Assignment = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.Assignment[source]

Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.

Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type.

Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query.

When creating assignments, it does not matter if other assignments exist at higher levels.

Example:

  • The organization organizationA contains two projects, project1 and project2.

  • Assignments for all three entities (organizationA, project1, and project2) could all be created and mapped to the same or different reservations.

Returns google.rpc.Code.PERMISSION_DENIED if user does not have ‘bigquery.admin’ permissions on the project using the reservation and the project that owns this reservation.

Returns google.rpc.Code.INVALID_ARGUMENT when location of the assignment does not match location of the reservation.

Parameters
  • request (CreateAssignmentRequest) – The request object. The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. Note: “bigquery.reservationAssignments.create” permission is required on the related assignee.

  • parent (str) – Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • assignment (Assignment) – Assignment resource to create. This corresponds to the assignment field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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

Return type

Assignment

create_capacity_commitment(request: google.cloud.bigquery.reservation_v1.types.reservation.CreateCapacityCommitmentRequest = None, *, parent: str = None, capacity_commitment: google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment[source]

Creates a new capacity commitment resource.

Parameters
  • request (CreateCapacityCommitmentRequest) – The request object. The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].

  • parent (str) – Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • capacity_commitment (CapacityCommitment) – Content of the capacity commitment to create. This corresponds to the capacity_commitment field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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.

Return type

CapacityCommitment

create_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.CreateReservationRequest = None, *, parent: str = None, reservation: google.cloud.bigquery.reservation_v1.types.reservation.Reservation = None, reservation_id: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.Reservation[source]

Creates a new reservation resource.

Parameters
  • request (CreateReservationRequest) – The request object. The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].

  • parent (str) – Required. Project, location. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • reservation (Reservation) – Definition of the new reservation to create. This corresponds to the reservation field on the request instance; if request is provided, this should not be set.

  • reservation_id (str) – The reservation ID. This field must only contain lower case alphanumeric characters or dash. Max length is 64 characters. This corresponds to the reservation_id field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A reservation is a mechanism used to guarantee slots to users.

Return type

Reservation

delete_assignment(request: google.cloud.bigquery.reservation_v1.types.reservation.DeleteAssignmentRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]

Deletes a assignment. No expansion will happen.

Example:

  • Organization organizationA contains two projects, project1 and project2.

  • Reservation res1 exists and was created previously.

  • CreateAssignment was used previously to define the following associations between entities and reservations: <organizationA, res1> and <project1, res1>

In this example, deletion of the <organizationA, res1> assignment won’t affect the other assignment <project1, res1>. After said deletion, queries from project1 will still use res1 while queries from project2 will switch to use on-demand mode.

Parameters
  • request (DeleteAssignmentRequest) – The request object. The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. Note: “bigquery.reservationAssignments.delete” permission is required on the related assignee.

  • name (str) – Required. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

delete_capacity_commitment(request: google.cloud.bigquery.reservation_v1.types.reservation.DeleteCapacityCommitmentRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]

Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code google.rpc.Code.FAILED_PRECONDITION.

Parameters
  • request (DeleteCapacityCommitmentRequest) – The request object. The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].

  • name (str) – Required. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

delete_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.DeleteReservationRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]

Deletes a reservation. Returns google.rpc.Code.FAILED_PRECONDITION when reservation has assignments.

Parameters
  • request (DeleteReservationRequest) – The request object. The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].

  • name (str) – Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]

Creates an instance of this client using the provided credentials file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

{@api.name}

classmethod from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

{@api.name}

get_bi_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.GetBiReservationRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.BiReservation[source]

Retrieves a BI reservation.

Parameters
  • request (GetBiReservationRequest) – The request object. A request to get a singleton BI reservation.

  • name (str) – Required. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/bireservation This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Represents a BI Reservation.

Return type

BiReservation

get_capacity_commitment(request: google.cloud.bigquery.reservation_v1.types.reservation.GetCapacityCommitmentRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment[source]

Returns information about the capacity commitment.

Parameters
  • request (GetCapacityCommitmentRequest) – The request object. The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].

  • name (str) – Required. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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.

Return type

CapacityCommitment

get_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.GetReservationRequest = None, *, name: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.Reservation[source]

Returns information about the reservation.

Parameters
  • request (GetReservationRequest) – The request object. The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].

  • name (str) – Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A reservation is a mechanism used to guarantee slots to users.

Return type

Reservation

list_assignments(request: google.cloud.bigquery.reservation_v1.types.reservation.ListAssignmentsRequest = None, *, parent: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.services.reservation_service.pagers.ListAssignmentsPager[source]

Lists assignments.

Only explicitly created assignments will be returned.

Example:

  • Organization organizationA contains two projects, project1 and project2.

  • Reservation res1 exists and was created previously.

  • CreateAssignment was used previously to define the following associations between entities and reservations: <organizationA, res1> and <project1, res1>

In this example, ListAssignments will just return the above two assignments for reservation res1, and no expansion/merge will happen.

The wildcard “-” can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed.

Note “-” cannot be used for projects nor locations.

Parameters
  • request (ListAssignmentsRequest) – The request object. The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

  • parent (str) –

    Required. The parent resource name e.g.:

    projects/myproject/locations/US/reservations/team1-prod

    Or:

    projects/myproject/locations/US/reservations/- This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

ListAssignmentsPager

list_capacity_commitments(request: google.cloud.bigquery.reservation_v1.types.reservation.ListCapacityCommitmentsRequest = None, *, parent: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsPager[source]

Lists all the capacity commitments for the admin project.

Parameters
  • request (ListCapacityCommitmentsRequest) – The request object. The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

  • parent (str) – Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

ListCapacityCommitmentsPager

list_reservations(request: google.cloud.bigquery.reservation_v1.types.reservation.ListReservationsRequest = None, *, parent: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.services.reservation_service.pagers.ListReservationsPager[source]

Lists all the reservations for the project in the specified location.

Parameters
  • request (ListReservationsRequest) – The request object. The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

  • parent (str) – Required. The parent resource name containing project and location, e.g.: “projects/myproject/locations/US”. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

ListReservationsPager

merge_capacity_commitments(request: google.cloud.bigquery.reservation_v1.types.reservation.MergeCapacityCommitmentsRequest = None, *, parent: str = None, capacity_commitment_ids: Sequence[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment[source]

Merges capacity commitments of the same plan into a single commitment.

The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments.

Attempting to merge capacity commitments of different plan will fail with the error code google.rpc.Code.FAILED_PRECONDITION.

Parameters
  • request (MergeCapacityCommitmentsRequest) – The request object. The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].

  • parent (str) – Parent resource that identifies admin project and location e.g., projects/myproject/locations/us This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • capacity_commitment_ids (Sequence[str]) – Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent. This corresponds to the capacity_commitment_ids field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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.

Return type

CapacityCommitment

move_assignment(request: google.cloud.bigquery.reservation_v1.types.reservation.MoveAssignmentRequest = None, *, name: str = None, destination_id: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.Assignment[source]

Moves an assignment under a new reservation. This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.

Parameters
  • request (MoveAssignmentRequest) –

    The request object. The request for [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment]. Note: “bigquery.reservationAssignments.create” permission is required on the destination_id.

    Note: “bigquery.reservationAssignments.create” and “bigquery.reservationAssignments.delete” permission are required on the related assignee.

  • name (str) – Required. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • destination_id (str) – The new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod This corresponds to the destination_id field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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

Return type

Assignment

static parse_assignment_path(path: str) → Dict[str, str][source]

Parse a assignment path into its component segments.

static parse_bi_reservation_path(path: str) → Dict[str, str][source]

Parse a bi_reservation path into its component segments.

static parse_capacity_commitment_path(path: str) → Dict[str, str][source]

Parse a capacity_commitment path into its component segments.

static parse_reservation_path(path: str) → Dict[str, str][source]

Parse a reservation path into its component segments.

static reservation_path(project: str, location: str, reservation: str) → str[source]

Return a fully-qualified reservation string.

search_assignments(request: google.cloud.bigquery.reservation_v1.types.reservation.SearchAssignmentsRequest = None, *, parent: str = None, query: str = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.services.reservation_service.pagers.SearchAssignmentsPager[source]

Looks up assignments for a specified resource for a particular region. If the request is about a project:

  1. Assignments created on the project will be returned if they exist.

  2. Otherwise assignments created on the closest ancestor will be returned.

  3. Assignments for different JobTypes will all be returned.

The same logic applies if the request is about a folder.

If the request is about an organization, then assignments created on the organization will be returned (organization doesn’t have ancestors).

Comparing to ListAssignments, there are some behavior differences:

  1. permission on the assignee will be verified in this API.

  2. Hierarchy lookup (project->folder->organization) happens in this API.

  3. Parent here is projects/*/locations/*, instead of projects/*/locations/*reservations/*.

Note “-” cannot be used for projects nor locations.

Parameters
  • request (SearchAssignmentsRequest) – The request object. The request for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. Note: “bigquery.reservationAssignments.search” permission is required on the related assignee.

  • parent (str) – Required. The resource name of the admin project(containing project and location), e.g.: “projects/myproject/locations/US”. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • query (str) –

    Please specify resource name as assignee in the query.

    Examples:

    • assignee=projects/myproject

    • assignee=folders/123

    • assignee=organizations/456

    This corresponds to the query field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

SearchAssignmentsPager

split_capacity_commitment(request: google.cloud.bigquery.reservation_v1.types.reservation.SplitCapacityCommitmentRequest = None, *, name: str = None, slot_count: int = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.SplitCapacityCommitmentResponse[source]

Splits capacity commitment to two commitments of the same plan and commitment_end_time.

A common use case is to enable downgrading commitments.

For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the first one to FLEX and then delete it.

Parameters
  • request (SplitCapacityCommitmentRequest) – The request object. The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

  • name (str) – Required. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • slot_count (int) – Number of slots in the capacity commitment after the split. This corresponds to the slot_count field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

Return type

SplitCapacityCommitmentResponse

update_bi_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.UpdateBiReservationRequest = None, *, bi_reservation: google.cloud.bigquery.reservation_v1.types.reservation.BiReservation = None, update_mask: google.protobuf.field_mask_pb2.FieldMask = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.BiReservation[source]

Updates a BI reservation.

Only fields specified in the field_mask are updated.

A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.

Parameters
  • request (UpdateBiReservationRequest) – The request object. A request to update a BI reservation.

  • bi_reservation (BiReservation) – A reservation to update. This corresponds to the bi_reservation field on the request instance; if request is provided, this should not be set.

  • update_mask (FieldMask) – A list of fields to be updated in this request. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Represents a BI Reservation.

Return type

BiReservation

update_capacity_commitment(request: google.cloud.bigquery.reservation_v1.types.reservation.UpdateCapacityCommitmentRequest = None, *, capacity_commitment: google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment = None, update_mask: google.protobuf.field_mask_pb2.FieldMask = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.CapacityCommitment[source]

Updates an existing capacity commitment.

Only plan and renewal_plan fields can be updated.

Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code google.rpc.Code.FAILED_PRECONDITION.

Parameters
  • request (UpdateCapacityCommitmentRequest) – The request object. The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].

  • capacity_commitment (CapacityCommitment) – Content of the capacity commitment to update. This corresponds to the capacity_commitment field on the request instance; if request is provided, this should not be set.

  • update_mask (FieldMask) – Standard field mask for the set of fields to be updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

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.

Return type

CapacityCommitment

update_reservation(request: google.cloud.bigquery.reservation_v1.types.reservation.UpdateReservationRequest = None, *, reservation: google.cloud.bigquery.reservation_v1.types.reservation.Reservation = None, update_mask: google.protobuf.field_mask_pb2.FieldMask = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.bigquery.reservation_v1.types.reservation.Reservation[source]

Updates an existing reservation resource.

Parameters
  • request (UpdateReservationRequest) – The request object. The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].

  • reservation (Reservation) – Content of the reservation to update. This corresponds to the reservation field on the request instance; if request is provided, this should not be set.

  • update_mask (FieldMask) – Standard field mask for the set of fields to be updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A reservation is a mechanism used to guarantee slots to users.

Return type

Reservation