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

Service Description: This API allows users to manage their BigQuery reservations.

A reservation provides computational resource guarantees, in the form of
[slots](https://cloud.google.com/bigquery/docs/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`.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To
assist with these names, this class includes a format method for each type of
name, and additionally a parseName method to extract the individual identifiers
contained within formatted names that are returned by the API.

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\BigQuery\Reservation\V1\ReservationServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new ReservationServiceClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` The transport used for executing network requests. May be either the string `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. *Advanced usage* : Additionally, it is possible to pass in an already instantiated [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = \[ 'grpc' =\> \[...\], 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\GrpcTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) methods for the supported options. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### createAssignment

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.

"None" assignments represent an absence of the assignment. Projects
assigned to None use on-demand pricing. To create a "None" assignment, use
"none" as a reservation_id in the parent. Example parent:
`projects/myproject/locations/US/reservations/none`.

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.

The async variant is [ReservationServiceClient::createAssignmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__createAssignmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateAssignmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\CreateAssignmentRequest;

    /**
     * @param string $formattedParent The parent resource name of the assignment
     *                                E.g. `projects/myproject/locations/US/reservations/team1-prod`
     *                                Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
     */
    function create_assignment_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new CreateAssignmentRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var Assignment $response */
            $response = $reservationServiceClient->createAssignment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::reservationName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]'
        );

        create_assignment_sample($formattedParent);
    }

### createCapacityCommitment

Creates a new capacity commitment resource.

The async variant is
[ReservationServiceClient::createCapacityCommitmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__createCapacityCommitmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateCapacityCommitmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\CreateCapacityCommitmentRequest;

    /**
     * @param string $formattedParent Resource name of the parent reservation. E.g.,
     *                                `projects/myproject/locations/US`
     *                                Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function create_capacity_commitment_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new CreateCapacityCommitmentRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var CapacityCommitment $response */
            $response = $reservationServiceClient->createCapacityCommitment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        create_capacity_commitment_sample($formattedParent);
    }

### createReservation

Creates a new reservation resource.

The async variant is [ReservationServiceClient::createReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__createReservationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\CreateReservationRequest;
    use Google\Cloud\BigQuery\Reservation\V1\Reservation;

    /**
     * @param string $formattedParent Project, location. E.g.,
     *                                `projects/myproject/locations/US`
     *                                Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function create_reservation_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new CreateReservationRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var Reservation $response */
            $response = $reservationServiceClient->createReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        create_reservation_sample($formattedParent);
    }

### createReservationGroup

Creates a new reservation group.

The async variant is
[ReservationServiceClient::createReservationGroupAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__createReservationGroupAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateReservationGroupRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Cloud\BigQuery\Reservation\V1\ReservationGroup` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\CreateReservationGroupRequest;
    use Google\Cloud\BigQuery\Reservation\V1\ReservationGroup;

    /**
     * @param string $formattedParent    Project, location. E.g.,
     *                                   `projects/myproject/locations/US`
     *                                   Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     * @param string $reservationGroupId The reservation group ID. It must only contain lower case
     *                                   alphanumeric characters or dashes. It must start with a letter and must not
     *                                   end with a dash. Its maximum length is 64 characters.
     */
    function create_reservation_group_sample(
        string $formattedParent,
        string $reservationGroupId
    ): void {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $reservationGroup = new ReservationGroup();
        $request = (new CreateReservationGroupRequest())
            ->setParent($formattedParent)
            ->setReservationGroupId($reservationGroupId)
            ->setReservationGroup($reservationGroup);

        // Call the API and handle any network failures.
        try {
            /** @var ReservationGroup $response */
            $response = $reservationServiceClient->createReservationGroup($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
        $reservationGroupId = '[RESERVATION_GROUP_ID]';

        create_reservation_group_sample($formattedParent, $reservationGroupId);
    }

### deleteAssignment

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.

The async variant is [ReservationServiceClient::deleteAssignmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__deleteAssignmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteAssignmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\DeleteAssignmentRequest;

    /**
     * @param string $formattedName Name of the resource, e.g.
     *                              `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
     *                              Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field.
     */
    function delete_assignment_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new DeleteAssignmentRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $reservationServiceClient->deleteAssignment($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::assignmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]',
            '[ASSIGNMENT]'
        );

        delete_assignment_sample($formattedName);
    }

### deleteCapacityCommitment

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`.

The async variant is
[ReservationServiceClient::deleteCapacityCommitmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__deleteCapacityCommitmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteCapacityCommitmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\DeleteCapacityCommitmentRequest;

    /**
     * @param string $formattedName Resource name of the capacity commitment to delete. E.g.,
     *                              `projects/myproject/locations/US/capacityCommitments/123`
     *                              Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
     */
    function delete_capacity_commitment_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new DeleteCapacityCommitmentRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $reservationServiceClient->deleteCapacityCommitment($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::capacityCommitmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[CAPACITY_COMMITMENT]'
        );

        delete_capacity_commitment_sample($formattedName);
    }

### deleteReservation

Deletes a reservation.

Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
assignments.

The async variant is [ReservationServiceClient::deleteReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__deleteReservationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\DeleteReservationRequest;

    /**
     * @param string $formattedName Resource name of the reservation to retrieve. E.g.,
     *                              `projects/myproject/locations/US/reservations/team1-prod`
     *                              Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
     */
    function delete_reservation_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new DeleteReservationRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $reservationServiceClient->deleteReservation($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::reservationName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]'
        );

        delete_reservation_sample($formattedName);
    }

### deleteReservationGroup

Deletes a reservation.

Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
assignments.

The async variant is
[ReservationServiceClient::deleteReservationGroupAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__deleteReservationGroupAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteReservationGroupRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\DeleteReservationGroupRequest;

    /**
     * @param string $formattedName Resource name of the reservation group to retrieve. E.g.,
     *                              `projects/myproject/locations/US/reservationGroups/team1-prod`
     *                              Please see {@see ReservationServiceClient::reservationGroupName()} for help formatting this field.
     */
    function delete_reservation_group_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new DeleteReservationGroupRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $reservationServiceClient->deleteReservationGroup($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::reservationGroupName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION_GROUP]'
        );

        delete_reservation_group_sample($formattedName);
    }

### failoverReservation

Fail over a reservation to the secondary location. The operation should be
done in the current secondary location, which will be promoted to the
new primary location for the reservation.

Attempting to failover a reservation in the current primary location will
fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.

The async variant is [ReservationServiceClient::failoverReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__failoverReservationAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.FailoverReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\FailoverReservationRequest;
    use Google\Cloud\BigQuery\Reservation\V1\Reservation;

    /**
     * @param string $formattedName Resource name of the reservation to failover. E.g.,
     *                              `projects/myproject/locations/US/reservations/team1-prod`
     *                              Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
     */
    function failover_reservation_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new FailoverReservationRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Reservation $response */
            $response = $reservationServiceClient->failoverReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::reservationName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]'
        );

        failover_reservation_sample($formattedName);
    }

### getBiReservation

Retrieves a BI reservation.

The async variant is [ReservationServiceClient::getBiReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__getBiReservationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetBiReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\BiReservation;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\GetBiReservationRequest;

    /**
     * @param string $formattedName Name of the requested reservation, for example:
     *                              `projects/{project_id}/locations/{location_id}/biReservation`
     *                              Please see {@see ReservationServiceClient::biReservationName()} for help formatting this field.
     */
    function get_bi_reservation_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new GetBiReservationRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var BiReservation $response */
            $response = $reservationServiceClient->getBiReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::biReservationName('[PROJECT]', '[LOCATION]');

        get_bi_reservation_sample($formattedName);
    }

### getCapacityCommitment

Returns information about the capacity commitment.

The async variant is
[ReservationServiceClient::getCapacityCommitmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__getCapacityCommitmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetCapacityCommitmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\GetCapacityCommitmentRequest;

    /**
     * @param string $formattedName Resource name of the capacity commitment to retrieve. E.g.,
     *                              `projects/myproject/locations/US/capacityCommitments/123`
     *                              Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
     */
    function get_capacity_commitment_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new GetCapacityCommitmentRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var CapacityCommitment $response */
            $response = $reservationServiceClient->getCapacityCommitment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::capacityCommitmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[CAPACITY_COMMITMENT]'
        );

        get_capacity_commitment_sample($formattedName);
    }

### getIamPolicy

Gets the access control policy for a resource.

May return:

- A`NOT_FOUND` error if the resource doesn't exist or you don't have the permission to view it.
- An empty policy if the resource exists but doesn't have a set policy.

Supported resources are:

- Reservations
- ReservationAssignments

To call this method, you must have the following Google IAM permissions:

- `bigqueryreservation.reservations.getIamPolicy` to get policies on reservations.

The async variant is [ReservationServiceClient::getIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__getIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\Iam\V1\GetIamPolicyRequest;
    use Google\Cloud\Iam\V1\Policy;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being requested.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function get_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new GetIamPolicyRequest())
            ->setResource($resource);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $reservationServiceClient->getIamPolicy($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $resource = '[RESOURCE]';

        get_iam_policy_sample($resource);
    }

### getReservation

Returns information about the reservation.

The async variant is [ReservationServiceClient::getReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__getReservationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\GetReservationRequest;
    use Google\Cloud\BigQuery\Reservation\V1\Reservation;

    /**
     * @param string $formattedName Resource name of the reservation to retrieve. E.g.,
     *                              `projects/myproject/locations/US/reservations/team1-prod`
     *                              Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
     */
    function get_reservation_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new GetReservationRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Reservation $response */
            $response = $reservationServiceClient->getReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::reservationName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]'
        );

        get_reservation_sample($formattedName);
    }

### getReservationGroup

Returns information about the reservation group.

The async variant is [ReservationServiceClient::getReservationGroupAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__getReservationGroupAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetReservationGroupRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Cloud\BigQuery\Reservation\V1\ReservationGroup` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\GetReservationGroupRequest;
    use Google\Cloud\BigQuery\Reservation\V1\ReservationGroup;

    /**
     * @param string $formattedName Resource name of the reservation group to retrieve. E.g.,
     *                              `projects/myproject/locations/US/reservationGroups/team1-prod`
     *                              Please see {@see ReservationServiceClient::reservationGroupName()} for help formatting this field.
     */
    function get_reservation_group_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new GetReservationGroupRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var ReservationGroup $response */
            $response = $reservationServiceClient->getReservationGroup($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::reservationGroupName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION_GROUP]'
        );

        get_reservation_group_sample($formattedName);
    }

### listAssignments

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.

The async variant is [ReservationServiceClient::listAssignmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__listAssignmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListAssignmentsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsRequest;

    /**
     * @param string $formattedParent The parent resource name e.g.:
     *
     *                                `projects/myproject/locations/US/reservations/team1-prod`
     *
     *                                Or:
     *
     *                                `projects/myproject/locations/US/reservations/-`
     *                                Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
     */
    function list_assignments_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new ListAssignmentsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->listAssignments($request);

            /** @var Assignment $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::reservationName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]'
        );

        list_assignments_sample($formattedParent);
    }

### listCapacityCommitments

Lists all the capacity commitments for the admin project.

The async variant is
[ReservationServiceClient::listCapacityCommitmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__listCapacityCommitmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListCapacityCommitmentsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsRequest;

    /**
     * @param string $formattedParent Resource name of the parent reservation. E.g.,
     *                                `projects/myproject/locations/US`
     *                                Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function list_capacity_commitments_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new ListCapacityCommitmentsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->listCapacityCommitments($request);

            /** @var CapacityCommitment $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        list_capacity_commitments_sample($formattedParent);
    }

### listReservationGroups

Lists all the reservation groups for the project in the specified location.

The async variant is
[ReservationServiceClient::listReservationGroupsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__listReservationGroupsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListReservationGroupsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\ListReservationGroupsRequest;
    use Google\Cloud\BigQuery\Reservation\V1\ReservationGroup;

    /**
     * @param string $formattedParent The parent resource name containing project and location, e.g.:
     *                                `projects/myproject/locations/US`
     *                                Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function list_reservation_groups_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new ListReservationGroupsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->listReservationGroups($request);

            /** @var ReservationGroup $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        list_reservation_groups_sample($formattedParent);
    }

### listReservations

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

The async variant is [ReservationServiceClient::listReservationsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__listReservationsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListReservationsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\ListReservationsRequest;
    use Google\Cloud\BigQuery\Reservation\V1\Reservation;

    /**
     * @param string $formattedParent The parent resource name containing project and location, e.g.:
     *                                `projects/myproject/locations/US`
     *                                Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function list_reservations_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new ListReservationsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->listReservations($request);

            /** @var Reservation $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        list_reservations_sample($formattedParent);
    }

### mergeCapacityCommitments

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`.

The async variant is
[ReservationServiceClient::mergeCapacityCommitmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__mergeCapacityCommitmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.MergeCapacityCommitmentsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\MergeCapacityCommitmentsRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function merge_capacity_commitments_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = new MergeCapacityCommitmentsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var CapacityCommitment $response */
            $response = $reservationServiceClient->mergeCapacityCommitments($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### moveAssignment

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.

The async variant is [ReservationServiceClient::moveAssignmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__moveAssignmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.MoveAssignmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\MoveAssignmentRequest;

    /**
     * @param string $formattedName The resource name of the assignment,
     *                              e.g.
     *                              `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
     *                              Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field.
     */
    function move_assignment_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new MoveAssignmentRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Assignment $response */
            $response = $reservationServiceClient->moveAssignment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::assignmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[RESERVATION]',
            '[ASSIGNMENT]'
        );

        move_assignment_sample($formattedName);
    }

### searchAllAssignments

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/*`.

The async variant is
[ReservationServiceClient::searchAllAssignmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__searchAllAssignmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SearchAllAssignmentsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsRequest;

    /**
     * @param string $formattedParent The resource name with location (project name could be the
     *                                wildcard '-'), e.g.:
     *                                `projects/-/locations/US`. Please see
     *                                {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function search_all_assignments_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new SearchAllAssignmentsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->searchAllAssignments($request);

            /** @var Assignment $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        search_all_assignments_sample($formattedParent);
    }

### searchAssignments

Deprecated: 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.

The async variant is [ReservationServiceClient::searchAssignmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__searchAssignmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SearchAssignmentsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsRequest;

    /**
     * @param string $formattedParent The resource name of the admin project(containing project and
     *                                location), e.g.:
     *                                `projects/myproject/locations/US`. Please see
     *                                {@see ReservationServiceClient::locationName()} for help formatting this field.
     */
    function search_assignments_sample(string $formattedParent): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new SearchAssignmentsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $reservationServiceClient->searchAssignments($request);

            /** @var Assignment $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');

        search_assignments_sample($formattedParent);
    }

### setIamPolicy

Sets an access control policy for a resource. Replaces any existing
policy.

Supported resources are:

- Reservations

To call this method, you must have the following Google IAM permissions:

- `bigqueryreservation.reservations.setIamPolicy` to set policies on reservations.

The async variant is [ReservationServiceClient::setIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__setIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\Iam\V1\SetIamPolicyRequest;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being specified.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function set_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $policy = new Policy();
        $request = (new SetIamPolicyRequest())
            ->setResource($resource)
            ->setPolicy($policy);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $reservationServiceClient->setIamPolicy($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $resource = '[RESOURCE]';

        set_iam_policy_sample($resource);
    }

### splitCapacityCommitment

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 delete the first one after the commitment end time passes.

The async variant is
[ReservationServiceClient::splitCapacityCommitmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__splitCapacityCommitmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SplitCapacityCommitmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentRequest;
    use Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentResponse;

    /**
     * @param string $formattedName The resource name e.g.,:
     *                              `projects/myproject/locations/US/capacityCommitments/123`
     *                              Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
     */
    function split_capacity_commitment_sample(string $formattedName): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = (new SplitCapacityCommitmentRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var SplitCapacityCommitmentResponse $response */
            $response = $reservationServiceClient->splitCapacityCommitment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = ReservationServiceClient::capacityCommitmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[CAPACITY_COMMITMENT]'
        );

        split_capacity_commitment_sample($formattedName);
    }

### testIamPermissions

Gets your permissions on a resource. Returns an empty set of permissions if
the resource doesn't exist.

Supported resources are:

- Reservations

No Google IAM permissions are required to call this method.

The async variant is [ReservationServiceClient::testIamPermissionsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__testIamPermissionsAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
    use Google\Cloud\Iam\V1\TestIamPermissionsResponse;

    /**
     * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
     *                                   See the operation documentation for the appropriate value for this field.
     * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
     *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
     *                                   information see
     *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
     */
    function test_iam_permissions_sample(string $resource, string $permissionsElement): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $permissions = [$permissionsElement];
        $request = (new TestIamPermissionsRequest())
            ->setResource($resource)
            ->setPermissions($permissions);

        // Call the API and handle any network failures.
        try {
            /** @var TestIamPermissionsResponse $response */
            $response = $reservationServiceClient->testIamPermissions($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $resource = '[RESOURCE]';
        $permissionsElement = '[PERMISSIONS]';

        test_iam_permissions_sample($resource, $permissionsElement);
    }

### updateAssignment

Updates an existing assignment.

Only the `priority` field can be updated.

The async variant is [ReservationServiceClient::updateAssignmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__updateAssignmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateAssignmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Assignment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\UpdateAssignmentRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_assignment_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = new UpdateAssignmentRequest();

        // Call the API and handle any network failures.
        try {
            /** @var Assignment $response */
            $response = $reservationServiceClient->updateAssignment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateBiReservation

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.

The async variant is [ReservationServiceClient::updateBiReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__updateBiReservationAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateBiReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\BiReservation;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\UpdateBiReservationRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_bi_reservation_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = new UpdateBiReservationRequest();

        // Call the API and handle any network failures.
        try {
            /** @var BiReservation $response */
            $response = $reservationServiceClient->updateBiReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateCapacityCommitment

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`.

The async variant is
[ReservationServiceClient::updateCapacityCommitmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__updateCapacityCommitmentAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateCapacityCommitmentRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\UpdateCapacityCommitmentRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_capacity_commitment_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = new UpdateCapacityCommitmentRequest();

        // Call the API and handle any network failures.
        try {
            /** @var CapacityCommitment $response */
            $response = $reservationServiceClient->updateCapacityCommitment($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateReservation

Updates an existing reservation resource.

The async variant is [ReservationServiceClient::updateReservationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__updateReservationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateReservationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\Reservation;
    use Google\Cloud\BigQuery\Reservation\V1\UpdateReservationRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_reservation_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $request = new UpdateReservationRequest();

        // Call the API and handle any network failures.
        try {
            /** @var Reservation $response */
            $response = $reservationServiceClient->updateReservation($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateReservationGroup

Updates an existing reservation group resource.

The async variant is
[ReservationServiceClient::updateReservationGroupAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Client.ReservationServiceClient#_Google_Cloud_BigQuery_Reservation_V1_Client_ReservationServiceClient__updateReservationGroupAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateReservationGroupRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Cloud\BigQuery\Reservation\V1\ReservationGroup` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
    use Google\Cloud\BigQuery\Reservation\V1\ReservationGroup;
    use Google\Cloud\BigQuery\Reservation\V1\UpdateReservationGroupRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_reservation_group_sample(): void
    {
        // Create a client.
        $reservationServiceClient = new ReservationServiceClient();

        // Prepare the request message.
        $reservationGroup = new ReservationGroup();
        $request = (new UpdateReservationGroupRequest())
            ->setReservationGroup($reservationGroup);

        // Call the API and handle any network failures.
        try {
            /** @var ReservationGroup $response */
            $response = $reservationServiceClient->updateReservationGroup($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### createAssignmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateAssignmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Assignment>` |   |

### createCapacityCommitmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateCapacityCommitmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment>` |   |

### createReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Reservation>` |   |

### createReservationGroupAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CreateReservationGroupRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<Google\Cloud\BigQuery\Reservation\V1\ReservationGroup>` |   |

### deleteAssignmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteAssignmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteCapacityCommitmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteCapacityCommitmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteReservationGroupAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.DeleteReservationGroupRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### failoverReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.FailoverReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Reservation>` |   |

### getBiReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetBiReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.BiReservation>` |   |

### getCapacityCommitmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetCapacityCommitmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment>` |   |

### getIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### getReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Reservation>` |   |

### getReservationGroupAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.GetReservationGroupRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<Google\Cloud\BigQuery\Reservation\V1\ReservationGroup>` |   |

### listAssignmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListAssignmentsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listCapacityCommitmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListCapacityCommitmentsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listReservationGroupsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListReservationGroupsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listReservationsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.ListReservationsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### mergeCapacityCommitmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.MergeCapacityCommitmentsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment>` |   |

### moveAssignmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.MoveAssignmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Assignment>` |   |

### searchAllAssignmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SearchAllAssignmentsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### searchAssignmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SearchAssignmentsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### setIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### splitCapacityCommitmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SplitCapacityCommitmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.SplitCapacityCommitmentResponse>` |   |

### testIamPermissionsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html>` |   |

### updateAssignmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateAssignmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Assignment>` |   |

### updateBiReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateBiReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.BiReservation>` |   |

### updateCapacityCommitmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateCapacityCommitmentRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.CapacityCommitment>` |   |

### updateReservationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateReservationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.Reservation>` |   |

### updateReservationGroupAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-reservation/latest/V1.UpdateReservationGroupRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<Google\Cloud\BigQuery\Reservation\V1\ReservationGroup>` |   |

### static::assignmentName

Formats a string containing the fully-qualified path to represent a assignment
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `reservation` | `string` |
| `assignment` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted assignment resource. |

### static::biReservationName

Formats a string containing the fully-qualified path to represent a
bi_reservation resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted bi_reservation resource. |

### static::capacityCommitmentName

Formats a string containing the fully-qualified path to represent a
capacity_commitment resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `capacityCommitment` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted capacity_commitment resource. |

### static::locationName

Formats a string containing the fully-qualified path to represent a location
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted location resource. |

### static::reservationName

Formats a string containing the fully-qualified path to represent a reservation
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `reservation` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted reservation resource. |

### static::reservationGroupName

Formats a string containing the fully-qualified path to represent a
reservation_group resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `reservationGroup` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted reservation_group resource. |

### static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported:
Template: Pattern

- assignment: projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}
- biReservation: projects/{project}/locations/{location}/biReservation
- capacityCommitment: projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}
- location: projects/{project}/locations/{location}
- reservation: projects/{project}/locations/{location}/reservations/{reservation}
- reservationGroup: projects/{project}/locations/{location}/reservationGroups/{reservation_group}

The optional $template argument can be supplied to specify a particular pattern,
and must match one of the templates listed above. If no $template argument is
provided, or if the $template argument does not match one of the templates
listed, then parseName will check each of the supported templates, and return
the first match.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `formattedName` | `string` The formatted name string |
| `template` | `?string` Optional name of template to match |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` | An associative array from name component IDs to component values. |