# Class ReservationServiceClient (2.92.0)

2.92.0 (latest) 2.89.0 2.88.0 2.86.0 2.84.0 2.83.0 2.82.0 2.81.0 2.79.0 2.77.0 2.76.0 2.75.0 2.74.0 2.73.0 2.71.0 2.69.0 2.68.0 2.65.0 2.64.0 2.63.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.50.0 2.49.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.6 2.3.1 2.2.7 2.1.4

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-bigqueryreservation/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java) | [Product Reference](https://cloud.google.com/bigquery/docs/reference/reservations/rpc) |

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. Sample code to get started:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       Reservation reservation = Reservation.newBuilder().build();
       String reservationId = "reservationId1116965383";
       Reservation response =
           reservationServiceClient.createReservation(parent, reservation, reservationId);
     }
     
Note: close() needs to be called on the ReservationServiceClient object to clean up resources
such as threads. In the example above, try-with-resources is used, which automatically calls
close().

| Method | Description | Method Variants |
|---|---|---|
| CreateReservation | Creates a new reservation resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createReservation(CreateReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createReservation(LocationName parent, Reservation reservation, String reservationId) - createReservation(String parent, Reservation reservation, String reservationId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createReservationCallable() |
| ListReservations | Lists all the reservations for the project in the specified location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listReservations(ListReservationsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listReservations(LocationName parent) - listReservations(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listReservationsPagedCallable() - listReservationsCallable() |
| GetReservation | Returns information about the reservation. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getReservation(GetReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getReservation(ReservationName name) - getReservation(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getReservationCallable() |
| DeleteReservation | Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteReservation(DeleteReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteReservation(ReservationName name) - deleteReservation(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteReservationCallable() |
| UpdateReservation | Updates an existing reservation resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateReservation(UpdateReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateReservation(Reservation reservation, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateReservationCallable() |
| 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`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - failoverReservation(FailoverReservationRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - failoverReservationCallable() |
| CreateCapacityCommitment | Creates a new capacity commitment resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createCapacityCommitment(CreateCapacityCommitmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createCapacityCommitment(LocationName parent, CapacityCommitment capacityCommitment) - createCapacityCommitment(String parent, CapacityCommitment capacityCommitment) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createCapacityCommitmentCallable() |
| ListCapacityCommitments | Lists all the capacity commitments for the admin project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listCapacityCommitments(ListCapacityCommitmentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listCapacityCommitments(LocationName parent) - listCapacityCommitments(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listCapacityCommitmentsPagedCallable() - listCapacityCommitmentsCallable() |
| GetCapacityCommitment | Returns information about the capacity commitment. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getCapacityCommitment(GetCapacityCommitmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getCapacityCommitment(CapacityCommitmentName name) - getCapacityCommitment(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getCapacityCommitmentCallable() |
| 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`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteCapacityCommitment(DeleteCapacityCommitmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteCapacityCommitment(CapacityCommitmentName name) - deleteCapacityCommitment(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteCapacityCommitmentCallable() |
| 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`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateCapacityCommitment(UpdateCapacityCommitmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateCapacityCommitment(CapacityCommitment capacityCommitment, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateCapacityCommitmentCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - splitCapacityCommitment(SplitCapacityCommitmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - splitCapacityCommitment(CapacityCommitmentName name, long slotCount) - splitCapacityCommitment(String name, long slotCount) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - splitCapacityCommitmentCallable() |
| 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`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - mergeCapacityCommitments(MergeCapacityCommitmentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - mergeCapacityCommitments(LocationName parent, List\<String\> capacityCommitmentIds) - mergeCapacityCommitments(String parent, List\<String\> capacityCommitmentIds) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - mergeCapacityCommitmentsCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createAssignment(CreateAssignmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createAssignment(ReservationName parent, Assignment assignment) - createAssignment(String parent, Assignment assignment) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createAssignmentCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listAssignments(ListAssignmentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listAssignments(ReservationName parent) - listAssignments(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listAssignmentsPagedCallable() - listAssignmentsCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteAssignment(DeleteAssignmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteAssignment(AssignmentName name) - deleteAssignment(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteAssignmentCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - searchAssignments(SearchAssignmentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - searchAssignments(LocationName parent, String query) - searchAssignments(String parent, String query) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - searchAssignmentsPagedCallable() - searchAssignmentsCallable() |
| 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/*`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - searchAllAssignments(SearchAllAssignmentsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - searchAllAssignments(LocationName parent, String query) - searchAllAssignments(String parent, String query) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - searchAllAssignmentsPagedCallable() - searchAllAssignmentsCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - moveAssignment(MoveAssignmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - moveAssignment(AssignmentName name, ReservationName destinationId) - moveAssignment(AssignmentName name, String destinationId) - moveAssignment(String name, ReservationName destinationId) - moveAssignment(String name, String destinationId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - moveAssignmentCallable() |
| UpdateAssignment | Updates an existing assignment. Only the `priority` field can be updated. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateAssignment(UpdateAssignmentRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateAssignment(Assignment assignment, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateAssignmentCallable() |
| GetBiReservation | Retrieves a BI reservation. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getBiReservation(GetBiReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getBiReservation(BiReservationName name) - getBiReservation(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getBiReservationCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateBiReservation(UpdateBiReservationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateBiReservation(BiReservation biReservation, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateBiReservationCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getIamPolicy(ResourceName resource) - getIamPolicy(String resource) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - setIamPolicy(ResourceName resource, Policy policy) - setIamPolicy(String resource, Policy policy) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
| CreateReservationGroup | Creates a new reservation group. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createReservationGroup(CreateReservationGroupRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createReservationGroupCallable() |
| GetReservationGroup | Returns information about the reservation group. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getReservationGroup(GetReservationGroupRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getReservationGroup(ReservationGroupName name) - getReservationGroup(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getReservationGroupCallable() |
| DeleteReservationGroup | Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteReservationGroup(DeleteReservationGroupRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteReservationGroup(ReservationGroupName name) - deleteReservationGroup(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteReservationGroupCallable() |
| ListReservationGroups | Lists all the reservation groups for the project in the specified location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listReservationGroups(ListReservationGroupsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listReservationGroups(LocationName parent) - listReservationGroups(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listReservationGroupsPagedCallable() - listReservationGroupsCallable() |
[Methods]

See the individual methods for example code.

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 parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ReservationServiceSettings to
create(). For example:

To customize credentials:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     ReservationServiceSettings reservationServiceSettings =
         ReservationServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     ReservationServiceClient reservationServiceClient =
         ReservationServiceClient.create(reservationServiceSettings);
     
To customize the endpoint:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     ReservationServiceSettings reservationServiceSettings =
         ReservationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     ReservationServiceClient reservationServiceClient =
         ReservationServiceClient.create(reservationServiceSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     ReservationServiceSettings reservationServiceSettings =
         ReservationServiceSettings.newHttpJsonBuilder().build();
     ReservationServiceClient reservationServiceClient =
         ReservationServiceClient.create(reservationServiceSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ReservationServiceClient

## Static Methods

### create()

    public static final ReservationServiceClient create()

Constructs an instance of ReservationServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(ReservationServiceSettings settings)

    public static final ReservationServiceClient create(ReservationServiceSettings settings)

Constructs an instance of ReservationServiceClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(ReservationServiceStub stub)

    public static final ReservationServiceClient create(ReservationServiceStub stub)

Constructs an instance of ReservationServiceClient, using the given stub for making calls. This
is for advanced usage - prefer using create(ReservationServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient` |   |

## Constructors

### ReservationServiceClient(ReservationServiceSettings settings)

    protected ReservationServiceClient(ReservationServiceSettings settings)

Constructs an instance of ReservationServiceClient, using the given settings. This is protected
so that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceSettings` |

### ReservationServiceClient(ReservationServiceStub stub)

    protected ReservationServiceClient(ReservationServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createAssignment(CreateAssignmentRequest request)

    public final Assignment createAssignment(CreateAssignmentRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateAssignmentRequest request =
           CreateAssignmentRequest.newBuilder()
               .setParent(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setAssignment(Assignment.newBuilder().build())
               .setAssignmentId("assignmentId-1603989304")
               .build();
       Assignment response = reservationServiceClient.createAssignment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest` The request object containing all of the parameters for the API call. |

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

### createAssignment(ReservationName parent, Assignment assignment)

    public final Assignment createAssignment(ReservationName parent, Assignment assignment)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       Assignment assignment = Assignment.newBuilder().build();
       Assignment response = reservationServiceClient.createAssignment(parent, assignment);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` Required. The parent resource name of the assignment E.g. `projects/myproject/locations/US/reservations/team1-prod` |
| `assignment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment` Assignment resource to create. |

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

### createAssignment(String parent, Assignment assignment)

    public final Assignment createAssignment(String parent, Assignment assignment)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       Assignment assignment = Assignment.newBuilder().build();
       Assignment response = reservationServiceClient.createAssignment(parent, assignment);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name of the assignment E.g. `projects/myproject/locations/US/reservations/team1-prod` |
| `assignment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment` Assignment resource to create. |

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

### createAssignmentCallable()

    public final UnaryCallable<CreateAssignmentRequest,Assignment> createAssignmentCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateAssignmentRequest request =
           CreateAssignmentRequest.newBuilder()
               .setParent(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setAssignment(Assignment.newBuilder().build())
               .setAssignmentId("assignmentId-1603989304")
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.createAssignmentCallable().futureCall(request);
       // Do something.
       Assignment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment>` |   |

### createCapacityCommitment(CreateCapacityCommitmentRequest request)

    public final CapacityCommitment createCapacityCommitment(CreateCapacityCommitmentRequest request)

Creates a new capacity commitment resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateCapacityCommitmentRequest request =
           CreateCapacityCommitmentRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setCapacityCommitment(CapacityCommitment.newBuilder().build())
               .setEnforceSingleAdminProjectPerOrg(true)
               .setCapacityCommitmentId("capacityCommitmentId1185645802")
               .build();
       CapacityCommitment response = reservationServiceClient.createCapacityCommitment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest` The request object containing all of the parameters for the API call. |

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

### createCapacityCommitment(LocationName parent, CapacityCommitment capacityCommitment)

    public final CapacityCommitment createCapacityCommitment(LocationName parent, CapacityCommitment capacityCommitment)

Creates a new capacity commitment resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
       CapacityCommitment response =
           reservationServiceClient.createCapacityCommitment(parent, capacityCommitment);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. Resource name of the parent reservation. E.g., `projects/myproject/locations/US` |
| `capacityCommitment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment` Content of the capacity commitment to create. |

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

### createCapacityCommitment(String parent, CapacityCommitment capacityCommitment)

    public final CapacityCommitment createCapacityCommitment(String parent, CapacityCommitment capacityCommitment)

Creates a new capacity commitment resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
       CapacityCommitment response =
           reservationServiceClient.createCapacityCommitment(parent, capacityCommitment);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the parent reservation. E.g., `projects/myproject/locations/US` |
| `capacityCommitment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment` Content of the capacity commitment to create. |

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

### createCapacityCommitmentCallable()

    public final UnaryCallable<CreateCapacityCommitmentRequest,CapacityCommitment> createCapacityCommitmentCallable()

Creates a new capacity commitment resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateCapacityCommitmentRequest request =
           CreateCapacityCommitmentRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setCapacityCommitment(CapacityCommitment.newBuilder().build())
               .setEnforceSingleAdminProjectPerOrg(true)
               .setCapacityCommitmentId("capacityCommitmentId1185645802")
               .build();
       ApiFuture<CapacityCommitment> future =
           reservationServiceClient.createCapacityCommitmentCallable().futureCall(request);
       // Do something.
       CapacityCommitment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment>` |   |

### createReservation(CreateReservationRequest request)

    public final Reservation createReservation(CreateReservationRequest request)

Creates a new reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateReservationRequest request =
           CreateReservationRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setReservationId("reservationId1116965383")
               .setReservation(Reservation.newBuilder().build())
               .build();
       Reservation response = reservationServiceClient.createReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateReservationRequest` The request object containing all of the parameters for the API call. |

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

### createReservation(LocationName parent, Reservation reservation, String reservationId)

    public final Reservation createReservation(LocationName parent, Reservation reservation, String reservationId)

Creates a new reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       Reservation reservation = Reservation.newBuilder().build();
       String reservationId = "reservationId1116965383";
       Reservation response =
           reservationServiceClient.createReservation(parent, reservation, reservationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. Project, location. E.g., `projects/myproject/locations/US` |
| `reservation` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation` Definition of the new reservation to create. |
| `reservationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The reservation 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. |

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

### createReservation(String parent, Reservation reservation, String reservationId)

    public final Reservation createReservation(String parent, Reservation reservation, String reservationId)

Creates a new reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       Reservation reservation = Reservation.newBuilder().build();
       String reservationId = "reservationId1116965383";
       Reservation response =
           reservationServiceClient.createReservation(parent, reservation, reservationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Project, location. E.g., `projects/myproject/locations/US` |
| `reservation` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation` Definition of the new reservation to create. |
| `reservationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The reservation 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. |

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

### createReservationCallable()

    public final UnaryCallable<CreateReservationRequest,Reservation> createReservationCallable()

Creates a new reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateReservationRequest request =
           CreateReservationRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setReservationId("reservationId1116965383")
               .setReservation(Reservation.newBuilder().build())
               .build();
       ApiFuture<Reservation> future =
           reservationServiceClient.createReservationCallable().futureCall(request);
       // Do something.
       Reservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation>` |   |

### createReservationGroup(CreateReservationGroupRequest request)

    public final ReservationGroup createReservationGroup(CreateReservationGroupRequest request)

Creates a new reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateReservationGroupRequest request =
           CreateReservationGroupRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setReservationGroupId("reservationGroupId-1636887922")
               .setReservationGroup(ReservationGroup.newBuilder().build())
               .build();
       ReservationGroup response = reservationServiceClient.createReservationGroup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup` |   |

### createReservationGroupCallable()

    public final UnaryCallable<CreateReservationGroupRequest,ReservationGroup> createReservationGroupCallable()

Creates a new reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CreateReservationGroupRequest request =
           CreateReservationGroupRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setReservationGroupId("reservationGroupId-1636887922")
               .setReservationGroup(ReservationGroup.newBuilder().build())
               .build();
       ApiFuture<ReservationGroup> future =
           reservationServiceClient.createReservationGroupCallable().futureCall(request);
       // Do something.
       ReservationGroup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup>` |   |

### deleteAssignment(AssignmentName name)

    public final void deleteAssignment(AssignmentName name)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       AssignmentName name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
       reservationServiceClient.deleteAssignment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.AssignmentName` Required. Name of the resource, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |

### deleteAssignment(DeleteAssignmentRequest request)

    public final void deleteAssignment(DeleteAssignmentRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteAssignmentRequest request =
           DeleteAssignmentRequest.newBuilder()
               .setName(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .build();
       reservationServiceClient.deleteAssignment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest` The request object containing all of the parameters for the API call. |

### deleteAssignment(String name)

    public final void deleteAssignment(String name)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]").toString();
       reservationServiceClient.deleteAssignment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Name of the resource, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |

### deleteAssignmentCallable()

    public final UnaryCallable<DeleteAssignmentRequest,Empty> deleteAssignmentCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteAssignmentRequest request =
           DeleteAssignmentRequest.newBuilder()
               .setName(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .build();
       ApiFuture<Empty> future =
           reservationServiceClient.deleteAssignmentCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteCapacityCommitment(CapacityCommitmentName name)

    public final void deleteCapacityCommitment(CapacityCommitmentName name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CapacityCommitmentName name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
       reservationServiceClient.deleteCapacityCommitment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitmentName` Required. Resource name of the capacity commitment to delete. E.g., `projects/myproject/locations/US/capacityCommitments/123` |

### deleteCapacityCommitment(DeleteCapacityCommitmentRequest request)

    public final void deleteCapacityCommitment(DeleteCapacityCommitmentRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteCapacityCommitmentRequest request =
           DeleteCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .setForce(true)
               .build();
       reservationServiceClient.deleteCapacityCommitment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest` The request object containing all of the parameters for the API call. |

### deleteCapacityCommitment(String name)

    public final void deleteCapacityCommitment(String name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]").toString();
       reservationServiceClient.deleteCapacityCommitment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the capacity commitment to delete. E.g., `projects/myproject/locations/US/capacityCommitments/123` |

### deleteCapacityCommitmentCallable()

    public final UnaryCallable<DeleteCapacityCommitmentRequest,Empty> deleteCapacityCommitmentCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteCapacityCommitmentRequest request =
           DeleteCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .setForce(true)
               .build();
       ApiFuture<Empty> future =
           reservationServiceClient.deleteCapacityCommitmentCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteReservation(DeleteReservationRequest request)

    public final void deleteReservation(DeleteReservationRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteReservationRequest request =
           DeleteReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .build();
       reservationServiceClient.deleteReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest` The request object containing all of the parameters for the API call. |

### deleteReservation(ReservationName name)

    public final void deleteReservation(ReservationName name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       reservationServiceClient.deleteReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` Required. Resource name of the reservation to retrieve. E.g., `projects/myproject/locations/US/reservations/team1-prod` |

### deleteReservation(String name)

    public final void deleteReservation(String name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       reservationServiceClient.deleteReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the reservation to retrieve. E.g., `projects/myproject/locations/US/reservations/team1-prod` |

### deleteReservationCallable()

    public final UnaryCallable<DeleteReservationRequest,Empty> deleteReservationCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteReservationRequest request =
           DeleteReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .build();
       ApiFuture<Empty> future =
           reservationServiceClient.deleteReservationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteReservationGroup(DeleteReservationGroupRequest request)

    public final void deleteReservationGroup(DeleteReservationGroupRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteReservationGroupRequest request =
           DeleteReservationGroupRequest.newBuilder()
               .setName(
                   ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]")
                       .toString())
               .build();
       reservationServiceClient.deleteReservationGroup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest` The request object containing all of the parameters for the API call. |

### deleteReservationGroup(ReservationGroupName name)

    public final void deleteReservationGroup(ReservationGroupName name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationGroupName name =
           ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]");
       reservationServiceClient.deleteReservationGroup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroupName` Required. Resource name of the reservation group to retrieve. E.g., `projects/myproject/locations/US/reservationGroups/team1-prod` |

### deleteReservationGroup(String name)

    public final void deleteReservationGroup(String name)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]").toString();
       reservationServiceClient.deleteReservationGroup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the reservation group to retrieve. E.g., `projects/myproject/locations/US/reservationGroups/team1-prod` |

### deleteReservationGroupCallable()

    public final UnaryCallable<DeleteReservationGroupRequest,Empty> deleteReservationGroupCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       DeleteReservationGroupRequest request =
           DeleteReservationGroupRequest.newBuilder()
               .setName(
                   ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]")
                       .toString())
               .build();
       ApiFuture<Empty> future =
           reservationServiceClient.deleteReservationGroupCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### failoverReservation(FailoverReservationRequest request)

    public final Reservation failoverReservation(FailoverReservationRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       FailoverReservationRequest request =
           FailoverReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setFailoverMode(FailoverMode.forNumber(0))
               .build();
       Reservation response = reservationServiceClient.failoverReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.FailoverReservationRequest` The request object containing all of the parameters for the API call. |

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

### failoverReservationCallable()

    public final UnaryCallable<FailoverReservationRequest,Reservation> failoverReservationCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       FailoverReservationRequest request =
           FailoverReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setFailoverMode(FailoverMode.forNumber(0))
               .build();
       ApiFuture<Reservation> future =
           reservationServiceClient.failoverReservationCallable().futureCall(request);
       // Do something.
       Reservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.FailoverReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation>` |   |

### getBiReservation(BiReservationName name)

    public final BiReservation getBiReservation(BiReservationName name)

Retrieves a BI reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]");
       BiReservation response = reservationServiceClient.getBiReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.BiReservationName` Required. Name of the requested reservation, for example: `projects/{project_id}/locations/{location_id}/biReservation` |

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

### getBiReservation(GetBiReservationRequest request)

    public final BiReservation getBiReservation(GetBiReservationRequest request)

Retrieves a BI reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetBiReservationRequest request =
           GetBiReservationRequest.newBuilder()
               .setName(BiReservationName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       BiReservation response = reservationServiceClient.getBiReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest` The request object containing all of the parameters for the API call. |

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

### getBiReservation(String name)

    public final BiReservation getBiReservation(String name)

Retrieves a BI reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name = BiReservationName.of("[PROJECT]", "[LOCATION]").toString();
       BiReservation response = reservationServiceClient.getBiReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Name of the requested reservation, for example: `projects/{project_id}/locations/{location_id}/biReservation` |

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

### getBiReservationCallable()

    public final UnaryCallable<GetBiReservationRequest,BiReservation> getBiReservationCallable()

Retrieves a BI reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetBiReservationRequest request =
           GetBiReservationRequest.newBuilder()
               .setName(BiReservationName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       ApiFuture<BiReservation> future =
           reservationServiceClient.getBiReservationCallable().futureCall(request);
       // Do something.
       BiReservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.BiReservation>` |   |

### getCapacityCommitment(CapacityCommitmentName name)

    public final CapacityCommitment getCapacityCommitment(CapacityCommitmentName name)

Returns information about the capacity commitment.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CapacityCommitmentName name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
       CapacityCommitment response = reservationServiceClient.getCapacityCommitment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitmentName` Required. Resource name of the capacity commitment to retrieve. E.g., `projects/myproject/locations/US/capacityCommitments/123` |

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

### getCapacityCommitment(GetCapacityCommitmentRequest request)

    public final CapacityCommitment getCapacityCommitment(GetCapacityCommitmentRequest request)

Returns information about the capacity commitment.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetCapacityCommitmentRequest request =
           GetCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .build();
       CapacityCommitment response = reservationServiceClient.getCapacityCommitment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest` The request object containing all of the parameters for the API call. |

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

### getCapacityCommitment(String name)

    public final CapacityCommitment getCapacityCommitment(String name)

Returns information about the capacity commitment.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]").toString();
       CapacityCommitment response = reservationServiceClient.getCapacityCommitment(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the capacity commitment to retrieve. E.g., `projects/myproject/locations/US/capacityCommitments/123` |

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

### getCapacityCommitmentCallable()

    public final UnaryCallable<GetCapacityCommitmentRequest,CapacityCommitment> getCapacityCommitmentCallable()

Returns information about the capacity commitment.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetCapacityCommitmentRequest request =
           GetCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .build();
       ApiFuture<CapacityCommitment> future =
           reservationServiceClient.getCapacityCommitmentCallable().futureCall(request);
       // Do something.
       CapacityCommitment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment>` |   |

### getIamPolicy(ResourceName resource)

    public final Policy getIamPolicy(ResourceName resource)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ResourceName resource =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
       Policy response = reservationServiceClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = reservationServiceClient.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(String resource)

    public final Policy getIamPolicy(String resource)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String resource =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]").toString();
       Policy response = reservationServiceClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future =
           reservationServiceClient.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getReservation(GetReservationRequest request)

    public final Reservation getReservation(GetReservationRequest request)

Returns information about the reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetReservationRequest request =
           GetReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .build();
       Reservation response = reservationServiceClient.getReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetReservationRequest` The request object containing all of the parameters for the API call. |

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

### getReservation(ReservationName name)

    public final Reservation getReservation(ReservationName name)

Returns information about the reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       Reservation response = reservationServiceClient.getReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` Required. Resource name of the reservation to retrieve. E.g., `projects/myproject/locations/US/reservations/team1-prod` |

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

### getReservation(String name)

    public final Reservation getReservation(String name)

Returns information about the reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       Reservation response = reservationServiceClient.getReservation(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the reservation to retrieve. E.g., `projects/myproject/locations/US/reservations/team1-prod` |

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

### getReservationCallable()

    public final UnaryCallable<GetReservationRequest,Reservation> getReservationCallable()

Returns information about the reservation.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetReservationRequest request =
           GetReservationRequest.newBuilder()
               .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .build();
       ApiFuture<Reservation> future =
           reservationServiceClient.getReservationCallable().futureCall(request);
       // Do something.
       Reservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation>` |   |

### getReservationGroup(GetReservationGroupRequest request)

    public final ReservationGroup getReservationGroup(GetReservationGroupRequest request)

Returns information about the reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetReservationGroupRequest request =
           GetReservationGroupRequest.newBuilder()
               .setName(
                   ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]")
                       .toString())
               .build();
       ReservationGroup response = reservationServiceClient.getReservationGroup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup` |   |

### getReservationGroup(ReservationGroupName name)

    public final ReservationGroup getReservationGroup(ReservationGroupName name)

Returns information about the reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationGroupName name =
           ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]");
       ReservationGroup response = reservationServiceClient.getReservationGroup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroupName` Required. Resource name of the reservation group to retrieve. E.g., `projects/myproject/locations/US/reservationGroups/team1-prod` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup` |   |

### getReservationGroup(String name)

    public final ReservationGroup getReservationGroup(String name)

Returns information about the reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]").toString();
       ReservationGroup response = reservationServiceClient.getReservationGroup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the reservation group to retrieve. E.g., `projects/myproject/locations/US/reservationGroups/team1-prod` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup` |   |

### getReservationGroupCallable()

    public final UnaryCallable<GetReservationGroupRequest,ReservationGroup> getReservationGroupCallable()

Returns information about the reservation group.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       GetReservationGroupRequest request =
           GetReservationGroupRequest.newBuilder()
               .setName(
                   ReservationGroupName.of("[PROJECT]", "[LOCATION]", "[RESERVATION_GROUP]")
                       .toString())
               .build();
       ApiFuture<ReservationGroup> future =
           reservationServiceClient.getReservationGroupCallable().futureCall(request);
       // Do something.
       ReservationGroup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationGroup>` |   |

### getSettings()

    public final ReservationServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceSettings` |   |

### getStub()

    public ReservationServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listAssignments(ListAssignmentsRequest request)

    public final ReservationServiceClient.ListAssignmentsPagedResponse listAssignments(ListAssignmentsRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListAssignmentsRequest request =
           ListAssignmentsRequest.newBuilder()
               .setParent(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Assignment element : reservationServiceClient.listAssignments(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse` |   |

### listAssignments(ReservationName parent)

    public final ReservationServiceClient.ListAssignmentsPagedResponse listAssignments(ReservationName parent)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       for (Assignment element : reservationServiceClient.listAssignments(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` Required. The parent resource name e.g.: `projects/myproject/locations/US/reservations/team1-prod` Or: `projects/myproject/locations/US/reservations/-` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse` |   |

### listAssignments(String parent)

    public final ReservationServiceClient.ListAssignmentsPagedResponse listAssignments(String parent)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       for (Assignment element : reservationServiceClient.listAssignments(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name e.g.: `projects/myproject/locations/US/reservations/team1-prod` Or: `projects/myproject/locations/US/reservations/-` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse` |   |

### listAssignmentsCallable()

    public final UnaryCallable<ListAssignmentsRequest,ListAssignmentsResponse> listAssignmentsCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListAssignmentsRequest request =
           ListAssignmentsRequest.newBuilder()
               .setParent(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListAssignmentsResponse response =
             reservationServiceClient.listAssignmentsCallable().call(request);
         for (Assignment element : response.getAssignmentsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse>` |   |

### listAssignmentsPagedCallable()

    public final UnaryCallable<ListAssignmentsRequest,ReservationServiceClient.ListAssignmentsPagedResponse> listAssignmentsPagedCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListAssignmentsRequest request =
           ListAssignmentsRequest.newBuilder()
               .setParent(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.listAssignmentsPagedCallable().futureCall(request);
       // Do something.
       for (Assignment element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse>` |   |

### listCapacityCommitments(ListCapacityCommitmentsRequest request)

    public final ReservationServiceClient.ListCapacityCommitmentsPagedResponse listCapacityCommitments(ListCapacityCommitmentsRequest request)

Lists all the capacity commitments for the admin project.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListCapacityCommitmentsRequest request =
           ListCapacityCommitmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (CapacityCommitment element :
           reservationServiceClient.listCapacityCommitments(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse` |   |

### listCapacityCommitments(LocationName parent)

    public final ReservationServiceClient.ListCapacityCommitmentsPagedResponse listCapacityCommitments(LocationName parent)

Lists all the capacity commitments for the admin project.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (CapacityCommitment element :
           reservationServiceClient.listCapacityCommitments(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. Resource name of the parent reservation. E.g., `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse` |   |

### listCapacityCommitments(String parent)

    public final ReservationServiceClient.ListCapacityCommitmentsPagedResponse listCapacityCommitments(String parent)

Lists all the capacity commitments for the admin project.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (CapacityCommitment element :
           reservationServiceClient.listCapacityCommitments(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Resource name of the parent reservation. E.g., `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse` |   |

### listCapacityCommitmentsCallable()

    public final UnaryCallable<ListCapacityCommitmentsRequest,ListCapacityCommitmentsResponse> listCapacityCommitmentsCallable()

Lists all the capacity commitments for the admin project.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListCapacityCommitmentsRequest request =
           ListCapacityCommitmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListCapacityCommitmentsResponse response =
             reservationServiceClient.listCapacityCommitmentsCallable().call(request);
         for (CapacityCommitment element : response.getCapacityCommitmentsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse>` |   |

### listCapacityCommitmentsPagedCallable()

    public final UnaryCallable<ListCapacityCommitmentsRequest,ReservationServiceClient.ListCapacityCommitmentsPagedResponse> listCapacityCommitmentsPagedCallable()

Lists all the capacity commitments for the admin project.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListCapacityCommitmentsRequest request =
           ListCapacityCommitmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<CapacityCommitment> future =
           reservationServiceClient.listCapacityCommitmentsPagedCallable().futureCall(request);
       // Do something.
       for (CapacityCommitment element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse>` |   |

### listReservationGroups(ListReservationGroupsRequest request)

    public final ReservationServiceClient.ListReservationGroupsPagedResponse listReservationGroups(ListReservationGroupsRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationGroupsRequest request =
           ListReservationGroupsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (ReservationGroup element :
           reservationServiceClient.listReservationGroups(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationGroupsPagedResponse` |   |

### listReservationGroups(LocationName parent)

    public final ReservationServiceClient.ListReservationGroupsPagedResponse listReservationGroups(LocationName parent)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (ReservationGroup element :
           reservationServiceClient.listReservationGroups(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. The parent resource name containing project and location, e.g.: `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationGroupsPagedResponse` |   |

### listReservationGroups(String parent)

    public final ReservationServiceClient.ListReservationGroupsPagedResponse listReservationGroups(String parent)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (ReservationGroup element :
           reservationServiceClient.listReservationGroups(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name containing project and location, e.g.: `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationGroupsPagedResponse` |   |

### listReservationGroupsCallable()

    public final UnaryCallable<ListReservationGroupsRequest,ListReservationGroupsResponse> listReservationGroupsCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationGroupsRequest request =
           ListReservationGroupsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListReservationGroupsResponse response =
             reservationServiceClient.listReservationGroupsCallable().call(request);
         for (ReservationGroup element : response.getReservationGroupsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse>` |   |

### listReservationGroupsPagedCallable()

    public final UnaryCallable<ListReservationGroupsRequest,ReservationServiceClient.ListReservationGroupsPagedResponse> listReservationGroupsPagedCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationGroupsRequest request =
           ListReservationGroupsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<ReservationGroup> future =
           reservationServiceClient.listReservationGroupsPagedCallable().futureCall(request);
       // Do something.
       for (ReservationGroup element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationGroupsPagedResponse>` |   |

### listReservations(ListReservationsRequest request)

    public final ReservationServiceClient.ListReservationsPagedResponse listReservations(ListReservationsRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationsRequest request =
           ListReservationsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Reservation element : reservationServiceClient.listReservations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse` |   |

### listReservations(LocationName parent)

    public final ReservationServiceClient.ListReservationsPagedResponse listReservations(LocationName parent)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (Reservation element : reservationServiceClient.listReservations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. The parent resource name containing project and location, e.g.: `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse` |   |

### listReservations(String parent)

    public final ReservationServiceClient.ListReservationsPagedResponse listReservations(String parent)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (Reservation element : reservationServiceClient.listReservations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name containing project and location, e.g.: `projects/myproject/locations/US` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse` |   |

### listReservationsCallable()

    public final UnaryCallable<ListReservationsRequest,ListReservationsResponse> listReservationsCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationsRequest request =
           ListReservationsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListReservationsResponse response =
             reservationServiceClient.listReservationsCallable().call(request);
         for (Reservation element : response.getReservationsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationsResponse>` |   |

### listReservationsPagedCallable()

    public final UnaryCallable<ListReservationsRequest,ReservationServiceClient.ListReservationsPagedResponse> listReservationsPagedCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ListReservationsRequest request =
           ListReservationsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Reservation> future =
           reservationServiceClient.listReservationsPagedCallable().futureCall(request);
       // Do something.
       for (Reservation element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ListReservationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse>` |   |

### mergeCapacityCommitments(LocationName parent, List\<String\> capacityCommitmentIds)

    public final CapacityCommitment mergeCapacityCommitments(LocationName parent, List<String> capacityCommitmentIds)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       List<String> capacityCommitmentIds = new ArrayList<>();
       CapacityCommitment response =
           reservationServiceClient.mergeCapacityCommitments(parent, capacityCommitmentIds);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Parent resource that identifies admin project and location e.g., `projects/myproject/locations/us` |
| `capacityCommitmentIds` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent. ID is the last portion of capacity commitment name e.g., 'abc' for projects/myproject/locations/US/capacityCommitments/abc |

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

### mergeCapacityCommitments(MergeCapacityCommitmentsRequest request)

    public final CapacityCommitment mergeCapacityCommitments(MergeCapacityCommitmentsRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       MergeCapacityCommitmentsRequest request =
           MergeCapacityCommitmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .addAllCapacityCommitmentIds(new ArrayList<String>())
               .setCapacityCommitmentId("capacityCommitmentId1185645802")
               .build();
       CapacityCommitment response = reservationServiceClient.mergeCapacityCommitments(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest` The request object containing all of the parameters for the API call. |

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

### mergeCapacityCommitments(String parent, List\<String\> capacityCommitmentIds)

    public final CapacityCommitment mergeCapacityCommitments(String parent, List<String> capacityCommitmentIds)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       List<String> capacityCommitmentIds = new ArrayList<>();
       CapacityCommitment response =
           reservationServiceClient.mergeCapacityCommitments(parent, capacityCommitmentIds);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Parent resource that identifies admin project and location e.g., `projects/myproject/locations/us` |
| `capacityCommitmentIds` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent. ID is the last portion of capacity commitment name e.g., 'abc' for projects/myproject/locations/US/capacityCommitments/abc |

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

### mergeCapacityCommitmentsCallable()

    public final UnaryCallable<MergeCapacityCommitmentsRequest,CapacityCommitment> mergeCapacityCommitmentsCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       MergeCapacityCommitmentsRequest request =
           MergeCapacityCommitmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .addAllCapacityCommitmentIds(new ArrayList<String>())
               .setCapacityCommitmentId("capacityCommitmentId1185645802")
               .build();
       ApiFuture<CapacityCommitment> future =
           reservationServiceClient.mergeCapacityCommitmentsCallable().futureCall(request);
       // Do something.
       CapacityCommitment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment>` |   |

### moveAssignment(AssignmentName name, ReservationName destinationId)

    public final Assignment moveAssignment(AssignmentName name, ReservationName destinationId)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       AssignmentName name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
       ReservationName destinationId =
           ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.AssignmentName` Required. The resource name of the assignment, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |
| `destinationId` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` The new reservation ID, e.g.: `projects/myotherproject/locations/US/reservations/team2-prod` |

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

### moveAssignment(AssignmentName name, String destinationId)

    public final Assignment moveAssignment(AssignmentName name, String destinationId)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       AssignmentName name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
       String destinationId =
           ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.AssignmentName` Required. The resource name of the assignment, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |
| `destinationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The new reservation ID, e.g.: `projects/myotherproject/locations/US/reservations/team2-prod` |

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

### moveAssignment(MoveAssignmentRequest request)

    public final Assignment moveAssignment(MoveAssignmentRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       MoveAssignmentRequest request =
           MoveAssignmentRequest.newBuilder()
               .setName(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setDestinationId(
                   ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setAssignmentId("assignmentId-1603989304")
               .build();
       Assignment response = reservationServiceClient.moveAssignment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest` The request object containing all of the parameters for the API call. |

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

### moveAssignment(String name, ReservationName destinationId)

    public final Assignment moveAssignment(String name, ReservationName destinationId)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]").toString();
       ReservationName destinationId =
           ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
       Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the assignment, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |
| `destinationId` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationName` The new reservation ID, e.g.: `projects/myotherproject/locations/US/reservations/team2-prod` |

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

### moveAssignment(String name, String destinationId)

    public final Assignment moveAssignment(String name, String destinationId)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]").toString();
       String destinationId =
           ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString();
       Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the assignment, e.g. `projects/myproject/locations/US/reservations/team1-prod/assignments/123` |
| `destinationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The new reservation ID, e.g.: `projects/myotherproject/locations/US/reservations/team2-prod` |

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

### moveAssignmentCallable()

    public final UnaryCallable<MoveAssignmentRequest,Assignment> moveAssignmentCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       MoveAssignmentRequest request =
           MoveAssignmentRequest.newBuilder()
               .setName(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setDestinationId(
                   ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString())
               .setAssignmentId("assignmentId-1603989304")
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.moveAssignmentCallable().futureCall(request);
       // Do something.
       Assignment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment>` |   |

### searchAllAssignments(LocationName parent, String query)

    public final ReservationServiceClient.SearchAllAssignmentsPagedResponse searchAllAssignments(LocationName parent, String query)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       String query = "query107944136";
       for (Assignment element :
           reservationServiceClient.searchAllAssignments(parent, query).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. The resource name with location (project name could be the wildcard '-'), e.g.: `projects/-/locations/US`. |
| `query` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Please specify resource name as assignee in the query. Examples: - `assignee=projects/myproject` - `assignee=folders/123` - `assignee=organizations/456` <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse` |   |

### searchAllAssignments(SearchAllAssignmentsRequest request)

    public final ReservationServiceClient.SearchAllAssignmentsPagedResponse searchAllAssignments(SearchAllAssignmentsRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAllAssignmentsRequest request =
           SearchAllAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Assignment element :
           reservationServiceClient.searchAllAssignments(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse` |   |

### searchAllAssignments(String parent, String query)

    public final ReservationServiceClient.SearchAllAssignmentsPagedResponse searchAllAssignments(String parent, String query)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       String query = "query107944136";
       for (Assignment element :
           reservationServiceClient.searchAllAssignments(parent, query).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name with location (project name could be the wildcard '-'), e.g.: `projects/-/locations/US`. |
| `query` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Please specify resource name as assignee in the query. Examples: - `assignee=projects/myproject` - `assignee=folders/123` - `assignee=organizations/456` <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse` |   |

### searchAllAssignmentsCallable()

    public final UnaryCallable<SearchAllAssignmentsRequest,SearchAllAssignmentsResponse> searchAllAssignmentsCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAllAssignmentsRequest request =
           SearchAllAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         SearchAllAssignmentsResponse response =
             reservationServiceClient.searchAllAssignmentsCallable().call(request);
         for (Assignment element : response.getAssignmentsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse>` |   |

### searchAllAssignmentsPagedCallable()

    public final UnaryCallable<SearchAllAssignmentsRequest,ReservationServiceClient.SearchAllAssignmentsPagedResponse> searchAllAssignmentsPagedCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAllAssignmentsRequest request =
           SearchAllAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.searchAllAssignmentsPagedCallable().futureCall(request);
       // Do something.
       for (Assignment element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse>` |   |

### searchAssignments(LocationName parent, String query) (deprecated)

    public final ReservationServiceClient.SearchAssignmentsPagedResponse searchAssignments(LocationName parent, String query)

**Deprecated.** *This method is deprecated and will be removed in the next major version update.*

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       String query = "query107944136";
       for (Assignment element :
           reservationServiceClient.searchAssignments(parent, query).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.LocationName` Required. The resource name of the admin project(containing project and location), e.g.: `projects/myproject/locations/US`. |
| `query` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Please specify resource name as assignee in the query. Examples: - `assignee=projects/myproject` - `assignee=folders/123` - `assignee=organizations/456` <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse` |   |

### searchAssignments(SearchAssignmentsRequest request) (deprecated)

    public final ReservationServiceClient.SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsRequest request)

**Deprecated.** *This method is deprecated and will be removed in the next major version update.*

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAssignmentsRequest request =
           SearchAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Assignment element : reservationServiceClient.searchAssignments(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse` |   |

### searchAssignments(String parent, String query) (deprecated)

    public final ReservationServiceClient.SearchAssignmentsPagedResponse searchAssignments(String parent, String query)

**Deprecated.** *This method is deprecated and will be removed in the next major version update.*

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       String query = "query107944136";
       for (Assignment element :
           reservationServiceClient.searchAssignments(parent, query).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the admin project(containing project and location), e.g.: `projects/myproject/locations/US`. |
| `query` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Please specify resource name as assignee in the query. Examples: - `assignee=projects/myproject` - `assignee=folders/123` - `assignee=organizations/456` <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse` |   |

### searchAssignmentsCallable() (deprecated)

    public final UnaryCallable<SearchAssignmentsRequest,SearchAssignmentsResponse> searchAssignmentsCallable()

**Deprecated.** *This method is deprecated and will be removed in the next major version update.*

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAssignmentsRequest request =
           SearchAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         SearchAssignmentsResponse response =
             reservationServiceClient.searchAssignmentsCallable().call(request);
         for (Assignment element : response.getAssignmentsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse>` |   |

### searchAssignmentsPagedCallable() (deprecated)

    public final UnaryCallable<SearchAssignmentsRequest,ReservationServiceClient.SearchAssignmentsPagedResponse> searchAssignmentsPagedCallable()

**Deprecated.** *This method is deprecated and will be removed in the next major version update.*

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SearchAssignmentsRequest request =
           SearchAssignmentsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQuery("query107944136")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.searchAssignmentsPagedCallable().futureCall(request);
       // Do something.
       for (Assignment element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse>` |   |

### setIamPolicy(ResourceName resource, Policy policy)

    public final Policy setIamPolicy(ResourceName resource, Policy policy)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       ResourceName resource =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
       Policy policy = Policy.newBuilder().build();
       Policy response = reservationServiceClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = reservationServiceClient.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(String resource, Policy policy)

    public final Policy setIamPolicy(String resource, Policy policy)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String resource =
           AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]").toString();
       Policy policy = Policy.newBuilder().build();
       Policy response = reservationServiceClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future =
           reservationServiceClient.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### splitCapacityCommitment(CapacityCommitmentName name, long slotCount)

    public final SplitCapacityCommitmentResponse splitCapacityCommitment(CapacityCommitmentName name, long slotCount)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CapacityCommitmentName name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
       long slotCount = -191518834;
       SplitCapacityCommitmentResponse response =
           reservationServiceClient.splitCapacityCommitment(name, slotCount);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitmentName` Required. The resource name e.g.,: `projects/myproject/locations/US/capacityCommitments/123` |
| `slotCount` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` Number of slots in the capacity commitment after the split. |

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

### splitCapacityCommitment(SplitCapacityCommitmentRequest request)

    public final SplitCapacityCommitmentResponse splitCapacityCommitment(SplitCapacityCommitmentRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SplitCapacityCommitmentRequest request =
           SplitCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .setSlotCount(-191518834)
               .build();
       SplitCapacityCommitmentResponse response =
           reservationServiceClient.splitCapacityCommitment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest` The request object containing all of the parameters for the API call. |

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

### splitCapacityCommitment(String name, long slotCount)

    public final SplitCapacityCommitmentResponse splitCapacityCommitment(String name, long slotCount)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       String name =
           CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]").toString();
       long slotCount = -191518834;
       SplitCapacityCommitmentResponse response =
           reservationServiceClient.splitCapacityCommitment(name, slotCount);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name e.g.,: `projects/myproject/locations/US/capacityCommitments/123` |
| `slotCount` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` Number of slots in the capacity commitment after the split. |

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

### splitCapacityCommitmentCallable()

    public final UnaryCallable<SplitCapacityCommitmentRequest,SplitCapacityCommitmentResponse> splitCapacityCommitmentCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       SplitCapacityCommitmentRequest request =
           SplitCapacityCommitmentRequest.newBuilder()
               .setName(
                   CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]")
                       .toString())
               .setSlotCount(-191518834)
               .build();
       ApiFuture<SplitCapacityCommitmentResponse> future =
           reservationServiceClient.splitCapacityCommitmentCallable().futureCall(request);
       // Do something.
       SplitCapacityCommitmentResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse>` |   |

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response = reservationServiceClient.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(
                   AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]")
                       .toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           reservationServiceClient.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |

### updateAssignment(Assignment assignment, FieldMask updateMask)

    public final Assignment updateAssignment(Assignment assignment, FieldMask updateMask)

Updates an existing assignment.

Only the `priority` field can be updated.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       Assignment assignment = Assignment.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Assignment response = reservationServiceClient.updateAssignment(assignment, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `assignment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment` Content of the assignment to update. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Standard field mask for the set of fields to be updated. |

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

### updateAssignment(UpdateAssignmentRequest request)

    public final Assignment updateAssignment(UpdateAssignmentRequest request)

Updates an existing assignment.

Only the `priority` field can be updated.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateAssignmentRequest request =
           UpdateAssignmentRequest.newBuilder()
               .setAssignment(Assignment.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Assignment response = reservationServiceClient.updateAssignment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest` The request object containing all of the parameters for the API call. |

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

### updateAssignmentCallable()

    public final UnaryCallable<UpdateAssignmentRequest,Assignment> updateAssignmentCallable()

Updates an existing assignment.

Only the `priority` field can be updated.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateAssignmentRequest request =
           UpdateAssignmentRequest.newBuilder()
               .setAssignment(Assignment.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Assignment> future =
           reservationServiceClient.updateAssignmentCallable().futureCall(request);
       // Do something.
       Assignment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Assignment>` |   |

### updateBiReservation(BiReservation biReservation, FieldMask updateMask)

    public final BiReservation updateBiReservation(BiReservation biReservation, FieldMask updateMask)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       BiReservation biReservation = BiReservation.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       BiReservation response =
           reservationServiceClient.updateBiReservation(biReservation, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `biReservation` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.BiReservation` A reservation to update. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` A list of fields to be updated in this request. |

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

### updateBiReservation(UpdateBiReservationRequest request)

    public final BiReservation updateBiReservation(UpdateBiReservationRequest request)

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateBiReservationRequest request =
           UpdateBiReservationRequest.newBuilder()
               .setBiReservation(BiReservation.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       BiReservation response = reservationServiceClient.updateBiReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest` The request object containing all of the parameters for the API call. |

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

### updateBiReservationCallable()

    public final UnaryCallable<UpdateBiReservationRequest,BiReservation> updateBiReservationCallable()

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.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateBiReservationRequest request =
           UpdateBiReservationRequest.newBuilder()
               .setBiReservation(BiReservation.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<BiReservation> future =
           reservationServiceClient.updateBiReservationCallable().futureCall(request);
       // Do something.
       BiReservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.BiReservation>` |   |

### updateCapacityCommitment(CapacityCommitment capacityCommitment, FieldMask updateMask)

    public final CapacityCommitment updateCapacityCommitment(CapacityCommitment capacityCommitment, FieldMask updateMask)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       CapacityCommitment response =
           reservationServiceClient.updateCapacityCommitment(capacityCommitment, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `capacityCommitment` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment` Content of the capacity commitment to update. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Standard field mask for the set of fields to be updated. |

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

### updateCapacityCommitment(UpdateCapacityCommitmentRequest request)

    public final CapacityCommitment updateCapacityCommitment(UpdateCapacityCommitmentRequest request)

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateCapacityCommitmentRequest request =
           UpdateCapacityCommitmentRequest.newBuilder()
               .setCapacityCommitment(CapacityCommitment.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       CapacityCommitment response = reservationServiceClient.updateCapacityCommitment(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest` The request object containing all of the parameters for the API call. |

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

### updateCapacityCommitmentCallable()

    public final UnaryCallable<UpdateCapacityCommitmentRequest,CapacityCommitment> updateCapacityCommitmentCallable()

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

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateCapacityCommitmentRequest request =
           UpdateCapacityCommitmentRequest.newBuilder()
               .setCapacityCommitment(CapacityCommitment.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<CapacityCommitment> future =
           reservationServiceClient.updateCapacityCommitmentCallable().futureCall(request);
       // Do something.
       CapacityCommitment response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.CapacityCommitment>` |   |

### updateReservation(Reservation reservation, FieldMask updateMask)

    public final Reservation updateReservation(Reservation reservation, FieldMask updateMask)

Updates an existing reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       Reservation reservation = Reservation.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Reservation response = reservationServiceClient.updateReservation(reservation, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `reservation` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation` Content of the reservation to update. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Standard field mask for the set of fields to be updated. |

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

### updateReservation(UpdateReservationRequest request)

    public final Reservation updateReservation(UpdateReservationRequest request)

Updates an existing reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateReservationRequest request =
           UpdateReservationRequest.newBuilder()
               .setReservation(Reservation.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Reservation response = reservationServiceClient.updateReservation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest` The request object containing all of the parameters for the API call. |

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

### updateReservationCallable()

    public final UnaryCallable<UpdateReservationRequest,Reservation> updateReservationCallable()

Updates an existing reservation resource.

Sample code:


     // This snippet 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 as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
       UpdateReservationRequest request =
           UpdateReservationRequest.newBuilder()
               .setReservation(Reservation.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Reservation> future =
           reservationServiceClient.updateReservationCallable().futureCall(request);
       // Do something.
       Reservation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigqueryreservation/latest/com.google.cloud.bigquery.reservation.v1.Reservation>` |   |