diff --git a/README.md b/README.md index 42ae6ad2..73c31a31 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-bigqueryreservation - 2.0.2 + 2.0.3 ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigqueryreservation:2.0.2' +implementation 'com.google.cloud:google-cloud-bigqueryreservation:2.0.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigqueryreservation" % "2.0.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigqueryreservation" % "2.0.3" ``` ## Authentication diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java index 28177c3a..fbc67ade 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java @@ -763,6 +763,7 @@ public final CapacityCommitment createCapacityCommitment( * .toString()) * .setCapacityCommitment(CapacityCommitment.newBuilder().build()) * .setEnforceSingleAdminProjectPerOrg(true) + * .setCapacityCommitmentId("capacityCommitmentId1185645802") * .build(); * CapacityCommitment response = reservationServiceClient.createCapacityCommitment(request); * } @@ -791,6 +792,7 @@ public final CapacityCommitment createCapacityCommitment( * .toString()) * .setCapacityCommitment(CapacityCommitment.newBuilder().build()) * .setEnforceSingleAdminProjectPerOrg(true) + * .setCapacityCommitmentId("capacityCommitmentId1185645802") * .build(); * ApiFuture future = * reservationServiceClient.createCapacityCommitmentCallable().futureCall(request); @@ -1124,6 +1126,7 @@ public final void deleteCapacityCommitment(String name) { * .setName( * CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") * .toString()) + * .setForce(true) * .build(); * reservationServiceClient.deleteCapacityCommitment(request); * } @@ -1150,6 +1153,7 @@ public final void deleteCapacityCommitment(DeleteCapacityCommitmentRequest reque * .setName( * CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") * .toString()) + * .setForce(true) * .build(); * ApiFuture future = * reservationServiceClient.deleteCapacityCommitmentCallable().futureCall(request); @@ -1567,6 +1571,10 @@ public final CapacityCommitment mergeCapacityCommitments( * 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. * @@ -1621,6 +1629,10 @@ public final Assignment createAssignment(ReservationName parent, Assignment assi * 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. * @@ -1673,6 +1685,10 @@ public final Assignment createAssignment(String parent, Assignment assignment) { * 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. * @@ -1689,6 +1705,7 @@ public final Assignment createAssignment(String parent, Assignment assignment) { * AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]") * .toString()) * .setAssignment(Assignment.newBuilder().build()) + * .setAssignmentId("assignmentId-1603989304") * .build(); * Assignment response = reservationServiceClient.createAssignment(request); * } @@ -1725,6 +1742,10 @@ public final Assignment createAssignment(CreateAssignmentRequest request) { * 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. * @@ -1741,6 +1762,7 @@ public final Assignment createAssignment(CreateAssignmentRequest request) { * AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]") * .toString()) * .setAssignment(Assignment.newBuilder().build()) + * .setAssignmentId("assignmentId-1603989304") * .build(); * ApiFuture future = * reservationServiceClient.createAssignmentCallable().futureCall(request); @@ -2151,8 +2173,8 @@ public final UnaryCallable deleteAssignmentCalla // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Looks up assignments for a specified resource for a particular region. If the request is about - * a project: + * 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 @@ -2196,7 +2218,9 @@ public final UnaryCallable deleteAssignmentCalla * * * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final SearchAssignmentsPagedResponse searchAssignments(LocationName parent, String query) { SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder() @@ -2208,8 +2232,8 @@ public final SearchAssignmentsPagedResponse searchAssignments(LocationName paren // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Looks up assignments for a specified resource for a particular region. If the request is about - * a project: + * 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 @@ -2253,7 +2277,9 @@ public final SearchAssignmentsPagedResponse searchAssignments(LocationName paren * * * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final SearchAssignmentsPagedResponse searchAssignments(String parent, String query) { SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder().setParent(parent).setQuery(query).build(); @@ -2262,8 +2288,8 @@ public final SearchAssignmentsPagedResponse searchAssignments(String parent, Str // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Looks up assignments for a specified resource for a particular region. If the request is about - * a project: + * 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 @@ -2302,15 +2328,17 @@ public final SearchAssignmentsPagedResponse searchAssignments(String parent, Str * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsRequest request) { return searchAssignmentsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Looks up assignments for a specified resource for a particular region. If the request is about - * a project: + * 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 @@ -2349,7 +2377,10 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR * } * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final UnaryCallable searchAssignmentsPagedCallable() { return stub.searchAssignmentsPagedCallable(); @@ -2357,8 +2388,8 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Looks up assignments for a specified resource for a particular region. If the request is about - * a project: + * 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 @@ -2404,12 +2435,269 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR * } * } * } + * + * @deprecated This method is deprecated and will be removed in the next major version update. */ + @Deprecated public final UnaryCallable searchAssignmentsCallable() { return stub.searchAssignmentsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String query = "query107944136";
+   *   for (Assignment element :
+   *       reservationServiceClient.searchAllAssignments(parent, query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name with location (project name could be the wildcard + * '-'), e.g.: `projects/-/locations/US`. + * @param query Please specify resource name as assignee in the query. + *

Examples: + *

+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchAllAssignmentsPagedResponse searchAllAssignments( + LocationName parent, String query) { + SearchAllAssignmentsRequest request = + SearchAllAssignmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchAllAssignments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * 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);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name with location (project name could be the wildcard + * '-'), e.g.: `projects/-/locations/US`. + * @param query Please specify resource name as assignee in the query. + *

Examples: + *

+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchAllAssignmentsPagedResponse searchAllAssignments(String parent, String query) { + SearchAllAssignmentsRequest request = + SearchAllAssignmentsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchAllAssignments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * 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);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchAllAssignmentsPagedResponse searchAllAssignments( + SearchAllAssignmentsRequest request) { + return searchAllAssignmentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   SearchAllAssignmentsRequest request =
+   *       SearchAllAssignmentsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuery("query107944136")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       reservationServiceClient.searchAllAssignmentsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Assignment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchAllAssignmentsPagedCallable() { + return stub.searchAllAssignmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * 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.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchAllAssignmentsCallable() { + return stub.searchAllAssignmentsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Moves an assignment under a new reservation. @@ -2619,7 +2907,7 @@ public final UnaryCallable moveAssignmentCall * } * * @param name Required. Name of the requested reservation, for example: - * `projects/{project_id}/locations/{location_id}/bireservation` + * `projects/{project_id}/locations/{location_id}/biReservation` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final BiReservation getBiReservation(BiReservationName name) { @@ -2642,7 +2930,7 @@ public final BiReservation getBiReservation(BiReservationName name) { * } * * @param name Required. Name of the requested reservation, for example: - * `projects/{project_id}/locations/{location_id}/bireservation` + * `projects/{project_id}/locations/{location_id}/biReservation` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final BiReservation getBiReservation(String name) { @@ -3140,4 +3428,84 @@ protected SearchAssignmentsFixedSizeCollection createCollection( return new SearchAssignmentsFixedSizeCollection(pages, collectionSize); } } + + public static class SearchAllAssignmentsPagedResponse + extends AbstractPagedListResponse< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + Assignment, + SearchAllAssignmentsPage, + SearchAllAssignmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchAllAssignmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new SearchAllAssignmentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private SearchAllAssignmentsPagedResponse(SearchAllAssignmentsPage page) { + super(page, SearchAllAssignmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchAllAssignmentsPage + extends AbstractPage< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + Assignment, + SearchAllAssignmentsPage> { + + private SearchAllAssignmentsPage( + PageContext context, + SearchAllAssignmentsResponse response) { + super(context, response); + } + + private static SearchAllAssignmentsPage createEmptyPage() { + return new SearchAllAssignmentsPage(null, null); + } + + @Override + protected SearchAllAssignmentsPage createPage( + PageContext context, + SearchAllAssignmentsResponse response) { + return new SearchAllAssignmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchAllAssignmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + Assignment, + SearchAllAssignmentsPage, + SearchAllAssignmentsFixedSizeCollection> { + + private SearchAllAssignmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchAllAssignmentsFixedSizeCollection createEmptyCollection() { + return new SearchAllAssignmentsFixedSizeCollection(null, 0); + } + + @Override + protected SearchAllAssignmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchAllAssignmentsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java index 9b7dd396..ca99a3a6 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse; +import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse; import com.google.api.core.ApiFunction; @@ -164,13 +165,27 @@ public UnaryCallSettings deleteAssignmentSetting return ((ReservationServiceStubSettings) getStubSettings()).deleteAssignmentSettings(); } - /** Returns the object with the settings used for calls to searchAssignments. */ + /** + * Returns the object with the settings used for calls to searchAssignments. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public PagedCallSettings< SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> searchAssignmentsSettings() { return ((ReservationServiceStubSettings) getStubSettings()).searchAssignmentsSettings(); } + /** Returns the object with the settings used for calls to searchAllAssignments. */ + public PagedCallSettings< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).searchAllAssignmentsSettings(); + } + /** Returns the object with the settings used for calls to moveAssignment. */ public UnaryCallSettings moveAssignmentSettings() { return ((ReservationServiceStubSettings) getStubSettings()).moveAssignmentSettings(); @@ -377,13 +392,27 @@ public UnaryCallSettings.Builder deleteAssignmen return getStubSettingsBuilder().deleteAssignmentSettings(); } - /** Returns the builder for the settings used for calls to searchAssignments. */ + /** + * Returns the builder for the settings used for calls to searchAssignments. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public PagedCallSettings.Builder< SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> searchAssignmentsSettings() { return getStubSettingsBuilder().searchAssignmentsSettings(); } + /** Returns the builder for the settings used for calls to searchAllAssignments. */ + public PagedCallSettings.Builder< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings() { + return getStubSettingsBuilder().searchAllAssignmentsSettings(); + } + /** Returns the builder for the settings used for calls to moveAssignment. */ public UnaryCallSettings.Builder moveAssignmentSettings() { return getStubSettingsBuilder().moveAssignmentSettings(); diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/gapic_metadata.json b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/gapic_metadata.json index 345ab1be..8d21578a 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/gapic_metadata.json +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/gapic_metadata.json @@ -52,6 +52,9 @@ "MoveAssignment": { "methods": ["moveAssignment", "moveAssignment", "moveAssignment", "moveAssignment", "moveAssignment", "moveAssignmentCallable"] }, + "SearchAllAssignments": { + "methods": ["searchAllAssignments", "searchAllAssignments", "searchAllAssignments", "searchAllAssignmentsPagedCallable", "searchAllAssignmentsCallable"] + }, "SearchAssignments": { "methods": ["searchAssignments", "searchAssignments", "searchAssignments", "searchAssignmentsPagedCallable", "searchAssignmentsCallable"] }, diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java index 9637afac..60f8c078 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to BigQuery Reservation API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= ReservationServiceClient ======================= * diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java index 14ff223f..f114d060 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse; +import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -48,6 +49,8 @@ import com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; import com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; import com.google.cloud.bigquery.reservation.v1.Reservation; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; @@ -257,6 +260,18 @@ public class GrpcReservationServiceStub extends ReservationServiceStub { ProtoUtils.marshaller(SearchAssignmentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + searchAllAssignmentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/SearchAllAssignments") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchAllAssignmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchAllAssignmentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor moveAssignmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -324,6 +339,10 @@ public class GrpcReservationServiceStub extends ReservationServiceStub { searchAssignmentsCallable; private final UnaryCallable searchAssignmentsPagedCallable; + private final UnaryCallable + searchAllAssignmentsCallable; + private final UnaryCallable + searchAllAssignmentsPagedCallable; private final UnaryCallable moveAssignmentCallable; private final UnaryCallable getBiReservationCallable; private final UnaryCallable @@ -548,6 +567,17 @@ protected GrpcReservationServiceStub( return params.build(); }) .build(); + GrpcCallSettings + searchAllAssignmentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchAllAssignmentsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings moveAssignmentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(moveAssignmentMethodDescriptor) @@ -668,6 +698,16 @@ protected GrpcReservationServiceStub( searchAssignmentsTransportSettings, settings.searchAssignmentsSettings(), clientContext); + this.searchAllAssignmentsCallable = + callableFactory.createUnaryCallable( + searchAllAssignmentsTransportSettings, + settings.searchAllAssignmentsSettings(), + clientContext); + this.searchAllAssignmentsPagedCallable = + callableFactory.createPagedCallable( + searchAllAssignmentsTransportSettings, + settings.searchAllAssignmentsSettings(), + clientContext); this.moveAssignmentCallable = callableFactory.createUnaryCallable( moveAssignmentTransportSettings, settings.moveAssignmentSettings(), clientContext); @@ -800,6 +840,18 @@ public UnaryCallable deleteAssignmentCallable() return searchAssignmentsPagedCallable; } + @Override + public UnaryCallable + searchAllAssignmentsCallable() { + return searchAllAssignmentsCallable; + } + + @Override + public UnaryCallable + searchAllAssignmentsPagedCallable() { + return searchAllAssignmentsPagedCallable; + } + @Override public UnaryCallable moveAssignmentCallable() { return moveAssignmentCallable; diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java index 5c959468..5486ec6f 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse; +import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -44,6 +45,8 @@ import com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; import com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; import com.google.cloud.bigquery.reservation.v1.Reservation; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; @@ -146,16 +149,28 @@ public UnaryCallable deleteAssignmentCallable() throw new UnsupportedOperationException("Not implemented: deleteAssignmentCallable()"); } + @Deprecated public UnaryCallable searchAssignmentsPagedCallable() { throw new UnsupportedOperationException("Not implemented: searchAssignmentsPagedCallable()"); } + @Deprecated public UnaryCallable searchAssignmentsCallable() { throw new UnsupportedOperationException("Not implemented: searchAssignmentsCallable()"); } + public UnaryCallable + searchAllAssignmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchAllAssignmentsPagedCallable()"); + } + + public UnaryCallable + searchAllAssignmentsCallable() { + throw new UnsupportedOperationException("Not implemented: searchAllAssignmentsCallable()"); + } + public UnaryCallable moveAssignmentCallable() { throw new UnsupportedOperationException("Not implemented: moveAssignmentCallable()"); } diff --git a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java index da521cf7..eb354c0b 100644 --- a/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java +++ b/google-cloud-bigqueryreservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse; +import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse; import com.google.api.core.ApiFunction; @@ -64,6 +65,8 @@ import com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; import com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; import com.google.cloud.bigquery.reservation.v1.Reservation; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; @@ -156,6 +159,11 @@ public class ReservationServiceStubSettings extends StubSettings searchAssignmentsSettings; + private final PagedCallSettings< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings; private final UnaryCallSettings moveAssignmentSettings; private final UnaryCallSettings getBiReservationSettings; private final UnaryCallSettings @@ -325,6 +333,46 @@ public Iterable extractResources(SearchAssignmentsResponse payload) } }; + private static final PagedListDescriptor< + SearchAllAssignmentsRequest, SearchAllAssignmentsResponse, Assignment> + SEARCH_ALL_ASSIGNMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + SearchAllAssignmentsRequest, SearchAllAssignmentsResponse, Assignment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchAllAssignmentsRequest injectToken( + SearchAllAssignmentsRequest payload, String token) { + return SearchAllAssignmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchAllAssignmentsRequest injectPageSize( + SearchAllAssignmentsRequest payload, int pageSize) { + return SearchAllAssignmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchAllAssignmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchAllAssignmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchAllAssignmentsResponse payload) { + return payload.getAssignmentsList() == null + ? ImmutableList.of() + : payload.getAssignmentsList(); + } + }; + private static final PagedListResponseFactory< ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> LIST_RESERVATIONS_PAGE_STR_FACT = @@ -409,6 +457,29 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + SEARCH_ALL_ASSIGNMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchAllAssignmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, SEARCH_ALL_ASSIGNMENTS_PAGE_STR_DESC, request, context); + return SearchAllAssignmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createReservation. */ public UnaryCallSettings createReservationSettings() { return createReservationSettings; @@ -498,13 +569,27 @@ public UnaryCallSettings deleteAssignmentSetting return deleteAssignmentSettings; } - /** Returns the object with the settings used for calls to searchAssignments. */ + /** + * Returns the object with the settings used for calls to searchAssignments. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public PagedCallSettings< SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> searchAssignmentsSettings() { return searchAssignmentsSettings; } + /** Returns the object with the settings used for calls to searchAllAssignments. */ + public PagedCallSettings< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings() { + return searchAllAssignmentsSettings; + } + /** Returns the object with the settings used for calls to moveAssignment. */ public UnaryCallSettings moveAssignmentSettings() { return moveAssignmentSettings; @@ -613,6 +698,7 @@ protected ReservationServiceStubSettings(Builder settingsBuilder) throws IOExcep listAssignmentsSettings = settingsBuilder.listAssignmentsSettings().build(); deleteAssignmentSettings = settingsBuilder.deleteAssignmentSettings().build(); searchAssignmentsSettings = settingsBuilder.searchAssignmentsSettings().build(); + searchAllAssignmentsSettings = settingsBuilder.searchAllAssignmentsSettings().build(); moveAssignmentSettings = settingsBuilder.moveAssignmentSettings().build(); getBiReservationSettings = settingsBuilder.getBiReservationSettings().build(); updateBiReservationSettings = settingsBuilder.updateBiReservationSettings().build(); @@ -661,6 +747,11 @@ public static class Builder private final PagedCallSettings.Builder< SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> searchAssignmentsSettings; + private final PagedCallSettings.Builder< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings; private final UnaryCallSettings.Builder moveAssignmentSettings; private final UnaryCallSettings.Builder @@ -680,6 +771,7 @@ public static class Builder ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -690,10 +782,10 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) .build(); definitions.put("no_retry_0_params", settings); settings = @@ -707,6 +799,8 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -734,6 +828,8 @@ protected Builder(ClientContext clientContext) { listAssignmentsSettings = PagedCallSettings.newBuilder(LIST_ASSIGNMENTS_PAGE_STR_FACT); deleteAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); searchAssignmentsSettings = PagedCallSettings.newBuilder(SEARCH_ASSIGNMENTS_PAGE_STR_FACT); + searchAllAssignmentsSettings = + PagedCallSettings.newBuilder(SEARCH_ALL_ASSIGNMENTS_PAGE_STR_FACT); moveAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -756,6 +852,7 @@ protected Builder(ClientContext clientContext) { listAssignmentsSettings, deleteAssignmentSettings, searchAssignmentsSettings, + searchAllAssignmentsSettings, moveAssignmentSettings, getBiReservationSettings, updateBiReservationSettings); @@ -781,6 +878,7 @@ protected Builder(ReservationServiceStubSettings settings) { listAssignmentsSettings = settings.listAssignmentsSettings.toBuilder(); deleteAssignmentSettings = settings.deleteAssignmentSettings.toBuilder(); searchAssignmentsSettings = settings.searchAssignmentsSettings.toBuilder(); + searchAllAssignmentsSettings = settings.searchAllAssignmentsSettings.toBuilder(); moveAssignmentSettings = settings.moveAssignmentSettings.toBuilder(); getBiReservationSettings = settings.getBiReservationSettings.toBuilder(); updateBiReservationSettings = settings.updateBiReservationSettings.toBuilder(); @@ -803,6 +901,7 @@ protected Builder(ReservationServiceStubSettings settings) { listAssignmentsSettings, deleteAssignmentSettings, searchAssignmentsSettings, + searchAllAssignmentsSettings, moveAssignmentSettings, getBiReservationSettings, updateBiReservationSettings); @@ -902,6 +1001,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .searchAllAssignmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .moveAssignmentSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) @@ -1028,13 +1132,27 @@ public UnaryCallSettings.Builder deleteAssignmen return deleteAssignmentSettings; } - /** Returns the builder for the settings used for calls to searchAssignments. */ + /** + * Returns the builder for the settings used for calls to searchAssignments. + * + * @deprecated This method is deprecated and will be removed in the next major version update. + */ + @Deprecated public PagedCallSettings.Builder< SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> searchAssignmentsSettings() { return searchAssignmentsSettings; } + /** Returns the builder for the settings used for calls to searchAllAssignments. */ + public PagedCallSettings.Builder< + SearchAllAssignmentsRequest, + SearchAllAssignmentsResponse, + SearchAllAssignmentsPagedResponse> + searchAllAssignmentsSettings() { + return searchAllAssignmentsSettings; + } + /** Returns the builder for the settings used for calls to moveAssignment. */ public UnaryCallSettings.Builder moveAssignmentSettings() { return moveAssignmentSettings; diff --git a/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java b/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java index 94f1d18d..c50ef3e5 100644 --- a/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java +++ b/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java @@ -401,6 +401,28 @@ public void searchAssignments( } } + @Override + public void searchAllAssignments( + SearchAllAssignmentsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchAllAssignmentsResponse) { + requests.add(request); + responseObserver.onNext(((SearchAllAssignmentsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchAllAssignments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchAllAssignmentsResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void moveAssignment( MoveAssignmentRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java b/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java index 76377120..db232c80 100644 --- a/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java +++ b/google-cloud-bigqueryreservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListCapacityCommitmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.ListReservationsPagedResponse; +import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAllAssignmentsPagedResponse; import static com.google.cloud.bigquery.reservation.v1.ReservationServiceClient.SearchAssignmentsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -93,6 +94,8 @@ public void createReservationTest() throws Exception { .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString()) .setSlotCapacity(-1516717605) .setIgnoreIdleSlots(true) + .setCreationTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockReservationService.addResponse(expectedResponse); @@ -139,6 +142,8 @@ public void createReservationTest2() throws Exception { .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString()) .setSlotCapacity(-1516717605) .setIgnoreIdleSlots(true) + .setCreationTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockReservationService.addResponse(expectedResponse); @@ -273,6 +278,8 @@ public void getReservationTest() throws Exception { .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString()) .setSlotCapacity(-1516717605) .setIgnoreIdleSlots(true) + .setCreationTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockReservationService.addResponse(expectedResponse); @@ -313,6 +320,8 @@ public void getReservationTest2() throws Exception { .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString()) .setSlotCapacity(-1516717605) .setIgnoreIdleSlots(true) + .setCreationTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockReservationService.addResponse(expectedResponse); @@ -421,6 +430,8 @@ public void updateReservationTest() throws Exception { .setName(ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]").toString()) .setSlotCapacity(-1516717605) .setIgnoreIdleSlots(true) + .setCreationTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockReservationService.addResponse(expectedResponse); @@ -465,6 +476,7 @@ public void createCapacityCommitmentTest() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -512,6 +524,7 @@ public void createCapacityCommitmentTest2() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -649,6 +662,7 @@ public void getCapacityCommitmentTest() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -695,6 +709,7 @@ public void getCapacityCommitmentTest2() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -811,6 +826,7 @@ public void updateCapacityCommitmentTest() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -949,6 +965,7 @@ public void mergeCapacityCommitmentsTest() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -997,6 +1014,7 @@ public void mergeCapacityCommitmentsTest2() throws Exception { CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]") .toString()) .setSlotCount(-191518834) + .setCommitmentStartTime(Timestamp.newBuilder().build()) .setCommitmentEndTime(Timestamp.newBuilder().build()) .setFailureStatus(Status.newBuilder().build()) .build(); @@ -1377,6 +1395,104 @@ public void searchAssignmentsExceptionTest2() throws Exception { } } + @Test + public void searchAllAssignmentsTest() throws Exception { + Assignment responsesElement = Assignment.newBuilder().build(); + SearchAllAssignmentsResponse expectedResponse = + SearchAllAssignmentsResponse.newBuilder() + .setNextPageToken("") + .addAllAssignments(Arrays.asList(responsesElement)) + .build(); + mockReservationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchAllAssignmentsPagedResponse pagedListResponse = + client.searchAllAssignments(parent, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssignmentsList().get(0), resources.get(0)); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchAllAssignmentsRequest actualRequest = + ((SearchAllAssignmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchAllAssignmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.searchAllAssignments(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchAllAssignmentsTest2() throws Exception { + Assignment responsesElement = Assignment.newBuilder().build(); + SearchAllAssignmentsResponse expectedResponse = + SearchAllAssignmentsResponse.newBuilder() + .setNextPageToken("") + .addAllAssignments(Arrays.asList(responsesElement)) + .build(); + mockReservationService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchAllAssignmentsPagedResponse pagedListResponse = + client.searchAllAssignments(parent, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssignmentsList().get(0), resources.get(0)); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchAllAssignmentsRequest actualRequest = + ((SearchAllAssignmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchAllAssignmentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchAllAssignments(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void moveAssignmentTest() throws Exception { Assignment expectedResponse = diff --git a/grpc-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java b/grpc-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java index 37363b3a..995c039c 100644 --- a/grpc-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java +++ b/grpc-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java @@ -838,6 +838,56 @@ private ReservationServiceGrpc() {} return getSearchAssignmentsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + getSearchAllAssignmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchAllAssignments", + requestType = com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + getSearchAllAssignmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + getSearchAllAssignmentsMethod; + if ((getSearchAllAssignmentsMethod = ReservationServiceGrpc.getSearchAllAssignmentsMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getSearchAllAssignmentsMethod = ReservationServiceGrpc.getSearchAllAssignmentsMethod) + == null) { + ReservationServiceGrpc.getSearchAllAssignmentsMethod = + getSearchAllAssignmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SearchAllAssignments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("SearchAllAssignments")) + .build(); + } + } + } + return getSearchAllAssignmentsMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, com.google.cloud.bigquery.reservation.v1.Assignment> @@ -1265,6 +1315,10 @@ public void mergeCapacityCommitments( * * 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. @@ -1339,7 +1393,7 @@ public void deleteAssignment( * * *

-     * Looks up assignments for a specified resource for a particular region.
+     * 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
@@ -1358,6 +1412,7 @@ public void deleteAssignment(
      * nor locations.
      * 
*/ + @java.lang.Deprecated public void searchAssignments( com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request, io.grpc.stub.StreamObserver< @@ -1367,6 +1422,36 @@ public void searchAssignments( getSearchAssignmentsMethod(), responseObserver); } + /** + * + * + *
+     * 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/*`.
+     * 
+ */ + public void searchAllAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchAllAssignmentsMethod(), responseObserver); + } + /** * * @@ -1532,6 +1617,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse>( this, METHODID_SEARCH_ASSIGNMENTS))) + .addMethod( + getSearchAllAssignmentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse>( + this, METHODID_SEARCH_ALL_ASSIGNMENTS))) .addMethod( getMoveAssignmentMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1832,6 +1924,10 @@ public void mergeCapacityCommitments( * * 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. @@ -1912,7 +2008,7 @@ public void deleteAssignment( * * *
-     * Looks up assignments for a specified resource for a particular region.
+     * 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
@@ -1931,6 +2027,7 @@ public void deleteAssignment(
      * nor locations.
      * 
*/ + @java.lang.Deprecated public void searchAssignments( com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request, io.grpc.stub.StreamObserver< @@ -1942,6 +2039,38 @@ public void searchAssignments( responseObserver); } + /** + * + * + *
+     * 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/*`.
+     * 
+ */ + public void searchAllAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchAllAssignmentsMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -2231,6 +2360,10 @@ public com.google.cloud.bigquery.reservation.v1.CapacityCommitment mergeCapacity * * 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. @@ -2299,7 +2432,7 @@ public com.google.protobuf.Empty deleteAssignment( * * *
-     * Looks up assignments for a specified resource for a particular region.
+     * 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
@@ -2318,12 +2451,41 @@ public com.google.protobuf.Empty deleteAssignment(
      * nor locations.
      * 
*/ + @java.lang.Deprecated public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse searchAssignments( com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getSearchAssignmentsMethod(), getCallOptions(), 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/*`.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + searchAllAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchAllAssignmentsMethod(), getCallOptions(), request); + } + /** * * @@ -2618,6 +2780,10 @@ protected ReservationServiceFutureStub build( * * 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. @@ -2688,7 +2854,7 @@ protected ReservationServiceFutureStub build( * * *
-     * Looks up assignments for a specified resource for a particular region.
+     * 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
@@ -2707,6 +2873,7 @@ protected ReservationServiceFutureStub build(
      * nor locations.
      * 
*/ + @java.lang.Deprecated public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> searchAssignments( @@ -2715,6 +2882,35 @@ protected ReservationServiceFutureStub build( getChannel().newCall(getSearchAssignmentsMethod(), getCallOptions()), 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/*`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse> + searchAllAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchAllAssignmentsMethod(), getCallOptions()), request); + } + /** * * @@ -2783,9 +2979,10 @@ protected ReservationServiceFutureStub build( private static final int METHODID_LIST_ASSIGNMENTS = 13; private static final int METHODID_DELETE_ASSIGNMENT = 14; private static final int METHODID_SEARCH_ASSIGNMENTS = 15; - private static final int METHODID_MOVE_ASSIGNMENT = 16; - private static final int METHODID_GET_BI_RESERVATION = 17; - private static final int METHODID_UPDATE_BI_RESERVATION = 18; + private static final int METHODID_SEARCH_ALL_ASSIGNMENTS = 16; + private static final int METHODID_MOVE_ASSIGNMENT = 17; + private static final int METHODID_GET_BI_RESERVATION = 18; + private static final int METHODID_UPDATE_BI_RESERVATION = 19; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2906,6 +3103,13 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse>) responseObserver); break; + case METHODID_SEARCH_ALL_ASSIGNMENTS: + serviceImpl.searchAllAssignments( + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse>) + responseObserver); + break; case METHODID_MOVE_ASSIGNMENT: serviceImpl.moveAssignment( (com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) request, @@ -3004,6 +3208,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListAssignmentsMethod()) .addMethod(getDeleteAssignmentMethod()) .addMethod(getSearchAssignmentsMethod()) + .addMethod(getSearchAllAssignmentsMethod()) .addMethod(getMoveAssignmentMethod()) .addMethod(getGetBiReservationMethod()) .addMethod(getUpdateBiReservationMethod()) diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java index 76dda0e3..0fec2f11 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java @@ -177,6 +177,17 @@ public enum JobType implements com.google.protobuf.ProtocolMessageEnum { * QUERY = 2; */ QUERY(2), + /** + * + * + *
+     * BigQuery ML jobs that use services external to BigQuery for model
+     * training. These jobs will not utilize idle slots from other reservations.
+     * 
+ * + * ML_EXTERNAL = 3; + */ + ML_EXTERNAL(3), UNRECOGNIZED(-1), ; @@ -211,6 +222,17 @@ public enum JobType implements com.google.protobuf.ProtocolMessageEnum { * QUERY = 2; */ public static final int QUERY_VALUE = 2; + /** + * + * + *
+     * BigQuery ML jobs that use services external to BigQuery for model
+     * training. These jobs will not utilize idle slots from other reservations.
+     * 
+ * + * ML_EXTERNAL = 3; + */ + public static final int ML_EXTERNAL_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -242,6 +264,8 @@ public static JobType forNumber(int value) { return PIPELINE; case 2: return QUERY; + case 3: + return ML_EXTERNAL; default: return null; } diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java index 9e876fca..e29c1676 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java @@ -139,7 +139,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * The resource name of the singleton BI reservation.
    * Reservation names have the form
-   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * `projects/{project_id}/locations/{location_id}/biReservation`.
    * 
* * string name = 1; @@ -164,7 +164,7 @@ public java.lang.String getName() { *
    * The resource name of the singleton BI reservation.
    * Reservation names have the form
-   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * `projects/{project_id}/locations/{location_id}/biReservation`.
    * 
* * string name = 1; @@ -620,7 +620,7 @@ public Builder mergeFrom( *
      * The resource name of the singleton BI reservation.
      * Reservation names have the form
-     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * `projects/{project_id}/locations/{location_id}/biReservation`.
      * 
* * string name = 1; @@ -644,7 +644,7 @@ public java.lang.String getName() { *
      * The resource name of the singleton BI reservation.
      * Reservation names have the form
-     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * `projects/{project_id}/locations/{location_id}/biReservation`.
      * 
* * string name = 1; @@ -668,7 +668,7 @@ public com.google.protobuf.ByteString getNameBytes() { *
      * The resource name of the singleton BI reservation.
      * Reservation names have the form
-     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * `projects/{project_id}/locations/{location_id}/biReservation`.
      * 
* * string name = 1; @@ -691,7 +691,7 @@ public Builder setName(java.lang.String value) { *
      * The resource name of the singleton BI reservation.
      * Reservation names have the form
-     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * `projects/{project_id}/locations/{location_id}/biReservation`.
      * 
* * string name = 1; @@ -710,7 +710,7 @@ public Builder clearName() { *
      * The resource name of the singleton BI reservation.
      * Reservation names have the form
-     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * `projects/{project_id}/locations/{location_id}/biReservation`.
      * 
* * string name = 1; diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java index dd101e49..c9847416 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java @@ -31,7 +31,7 @@ public class BiReservationName implements ResourceName { private static final PathTemplate PROJECT_LOCATION = PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/bireservation"); + "projects/{project}/locations/{location}/biReservation"); private volatile Map fieldValuesMap; private final String project; private final String location; @@ -156,7 +156,7 @@ public int hashCode() { return h; } - /** Builder for projects/{project}/locations/{location}/bireservation. */ + /** Builder for projects/{project}/locations/{location}/biReservation. */ public static class Builder { private String project; private String location; diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java index 03d6f7d9..9e3cde23 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java @@ -29,7 +29,7 @@ public interface BiReservationOrBuilder *
    * The resource name of the singleton BI reservation.
    * Reservation names have the form
-   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * `projects/{project_id}/locations/{location_id}/biReservation`.
    * 
* * string name = 1; @@ -43,7 +43,7 @@ public interface BiReservationOrBuilder *
    * The resource name of the singleton BI reservation.
    * Reservation names have the form
-   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * `projects/{project_id}/locations/{location_id}/biReservation`.
    * 
* * string name = 1; diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java index 3510067b..0e869ce7 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java @@ -140,6 +140,21 @@ private CapacityCommitment( int rawValue = input.readEnum(); renewalPlan_ = rawValue; + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (commitmentStartTime_ != null) { + subBuilder = commitmentStartTime_.toBuilder(); + } + commitmentStartTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commitmentStartTime_); + commitmentStartTime_ = subBuilder.buildPartial(); + } + break; } default: @@ -735,6 +750,63 @@ public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State getStat : result; } + public static final int COMMITMENT_START_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp commitmentStartTime_; + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the commitmentStartTime field is set. + */ + @java.lang.Override + public boolean hasCommitmentStartTime() { + return commitmentStartTime_ != null; + } + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The commitmentStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCommitmentStartTime() { + return commitmentStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentStartTime_; + } + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCommitmentStartTimeOrBuilder() { + return getCommitmentStartTime(); + } + public static final int COMMITMENT_END_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp commitmentEndTime_; /** @@ -930,6 +1002,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(8, renewalPlan_); } + if (commitmentStartTime_ != null) { + output.writeMessage(9, getCommitmentStartTime()); + } unknownFields.writeTo(output); } @@ -968,6 +1043,9 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, renewalPlan_); } + if (commitmentStartTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommitmentStartTime()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -988,6 +1066,10 @@ public boolean equals(final java.lang.Object obj) { if (getSlotCount() != other.getSlotCount()) return false; if (plan_ != other.plan_) return false; if (state_ != other.state_) return false; + if (hasCommitmentStartTime() != other.hasCommitmentStartTime()) return false; + if (hasCommitmentStartTime()) { + if (!getCommitmentStartTime().equals(other.getCommitmentStartTime())) return false; + } if (hasCommitmentEndTime() != other.hasCommitmentEndTime()) return false; if (hasCommitmentEndTime()) { if (!getCommitmentEndTime().equals(other.getCommitmentEndTime())) return false; @@ -1016,6 +1098,10 @@ public int hashCode() { hash = (53 * hash) + plan_; hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + if (hasCommitmentStartTime()) { + hash = (37 * hash) + COMMITMENT_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCommitmentStartTime().hashCode(); + } if (hasCommitmentEndTime()) { hash = (37 * hash) + COMMITMENT_END_TIME_FIELD_NUMBER; hash = (53 * hash) + getCommitmentEndTime().hashCode(); @@ -1187,6 +1273,12 @@ public Builder clear() { state_ = 0; + if (commitmentStartTimeBuilder_ == null) { + commitmentStartTime_ = null; + } else { + commitmentStartTime_ = null; + commitmentStartTimeBuilder_ = null; + } if (commitmentEndTimeBuilder_ == null) { commitmentEndTime_ = null; } else { @@ -1232,6 +1324,11 @@ public com.google.cloud.bigquery.reservation.v1.CapacityCommitment buildPartial( result.slotCount_ = slotCount_; result.plan_ = plan_; result.state_ = state_; + if (commitmentStartTimeBuilder_ == null) { + result.commitmentStartTime_ = commitmentStartTime_; + } else { + result.commitmentStartTime_ = commitmentStartTimeBuilder_.build(); + } if (commitmentEndTimeBuilder_ == null) { result.commitmentEndTime_ = commitmentEndTime_; } else { @@ -1306,6 +1403,9 @@ public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.CapacityCommit if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.hasCommitmentStartTime()) { + mergeCommitmentStartTime(other.getCommitmentStartTime()); + } if (other.hasCommitmentEndTime()) { mergeCommitmentEndTime(other.getCommitmentEndTime()); } @@ -1711,6 +1811,218 @@ public Builder clearState() { return this; } + private com.google.protobuf.Timestamp commitmentStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitmentStartTimeBuilder_; + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the commitmentStartTime field is set. + */ + public boolean hasCommitmentStartTime() { + return commitmentStartTimeBuilder_ != null || commitmentStartTime_ != null; + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The commitmentStartTime. + */ + public com.google.protobuf.Timestamp getCommitmentStartTime() { + if (commitmentStartTimeBuilder_ == null) { + return commitmentStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentStartTime_; + } else { + return commitmentStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCommitmentStartTime(com.google.protobuf.Timestamp value) { + if (commitmentStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitmentStartTime_ = value; + onChanged(); + } else { + commitmentStartTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCommitmentStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitmentStartTimeBuilder_ == null) { + commitmentStartTime_ = builderForValue.build(); + onChanged(); + } else { + commitmentStartTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCommitmentStartTime(com.google.protobuf.Timestamp value) { + if (commitmentStartTimeBuilder_ == null) { + if (commitmentStartTime_ != null) { + commitmentStartTime_ = + com.google.protobuf.Timestamp.newBuilder(commitmentStartTime_) + .mergeFrom(value) + .buildPartial(); + } else { + commitmentStartTime_ = value; + } + onChanged(); + } else { + commitmentStartTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCommitmentStartTime() { + if (commitmentStartTimeBuilder_ == null) { + commitmentStartTime_ = null; + onChanged(); + } else { + commitmentStartTime_ = null; + commitmentStartTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCommitmentStartTimeBuilder() { + + onChanged(); + return getCommitmentStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCommitmentStartTimeOrBuilder() { + if (commitmentStartTimeBuilder_ != null) { + return commitmentStartTimeBuilder_.getMessageOrBuilder(); + } else { + return commitmentStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentStartTime_; + } + } + /** + * + * + *
+     * Output only. The start of the current commitment period. It is applicable only for
+     * ACTIVE capacity commitments.
+     * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitmentStartTimeFieldBuilder() { + if (commitmentStartTimeBuilder_ == null) { + commitmentStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitmentStartTime(), getParentForChildren(), isClean()); + commitmentStartTime_ = null; + } + return commitmentStartTimeBuilder_; + } + private com.google.protobuf.Timestamp commitmentEndTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java index 2fe8915d..c7f94b9f 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java @@ -117,6 +117,50 @@ public interface CapacityCommitmentOrBuilder */ com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State getState(); + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the commitmentStartTime field is set. + */ + boolean hasCommitmentStartTime(); + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The commitmentStartTime. + */ + com.google.protobuf.Timestamp getCommitmentStartTime(); + /** + * + * + *
+   * Output only. The start of the current commitment period. It is applicable only for
+   * ACTIVE capacity commitments.
+   * 
+ * + * + * .google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCommitmentStartTimeOrBuilder(); + /** * * diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java index 8bf3ac9f..7566fcb4 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java @@ -41,6 +41,7 @@ private CreateAssignmentRequest(com.google.protobuf.GeneratedMessageV3.Builder + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. + * + * + * string assignment_id = 4; + * + * @return The assignmentId. + */ + @java.lang.Override + public java.lang.String getAssignmentId() { + java.lang.Object ref = assignmentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assignmentId_ = s; + return s; + } + } + /** + * + * + *
+   * The optional assignment ID. Assignment name will be generated automatically
+   * if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * 
+ * + * string assignment_id = 4; + * + * @return The bytes for assignmentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssignmentIdBytes() { + java.lang.Object ref = assignmentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assignmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -253,6 +316,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (assignment_ != null) { output.writeMessage(2, getAssignment()); } + if (!getAssignmentIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, assignmentId_); + } unknownFields.writeTo(output); } @@ -268,6 +334,9 @@ public int getSerializedSize() { if (assignment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAssignment()); } + if (!getAssignmentIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, assignmentId_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -289,6 +358,7 @@ public boolean equals(final java.lang.Object obj) { if (hasAssignment()) { if (!getAssignment().equals(other.getAssignment())) return false; } + if (!getAssignmentId().equals(other.getAssignmentId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -306,6 +376,8 @@ public int hashCode() { hash = (37 * hash) + ASSIGNMENT_FIELD_NUMBER; hash = (53 * hash) + getAssignment().hashCode(); } + hash = (37 * hash) + ASSIGNMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getAssignmentId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -462,6 +534,8 @@ public Builder clear() { assignment_ = null; assignmentBuilder_ = null; } + assignmentId_ = ""; + return this; } @@ -496,6 +570,7 @@ public com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest buildPar } else { result.assignment_ = assignmentBuilder_.build(); } + result.assignmentId_ = assignmentId_; onBuilt(); return result; } @@ -555,6 +630,10 @@ public Builder mergeFrom( if (other.hasAssignment()) { mergeAssignment(other.getAssignment()); } + if (!other.getAssignmentId().isEmpty()) { + assignmentId_ = other.assignmentId_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -893,6 +972,127 @@ public com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmen return assignmentBuilder_; } + private java.lang.Object assignmentId_ = ""; + /** + * + * + *
+     * The optional assignment ID. Assignment name will be generated automatically
+     * if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * 
+ * + * string assignment_id = 4; + * + * @return The assignmentId. + */ + public java.lang.String getAssignmentId() { + java.lang.Object ref = assignmentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assignmentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The optional assignment ID. Assignment name will be generated automatically
+     * if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * 
+ * + * string assignment_id = 4; + * + * @return The bytes for assignmentId. + */ + public com.google.protobuf.ByteString getAssignmentIdBytes() { + java.lang.Object ref = assignmentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assignmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The optional assignment ID. Assignment name will be generated automatically
+     * if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * 
+ * + * string assignment_id = 4; + * + * @param value The assignmentId to set. + * @return This builder for chaining. + */ + public Builder setAssignmentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assignmentId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The optional assignment ID. Assignment name will be generated automatically
+     * if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * 
+ * + * string assignment_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearAssignmentId() { + + assignmentId_ = getDefaultInstance().getAssignmentId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The optional assignment ID. Assignment name will be generated automatically
+     * if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * 
+ * + * string assignment_id = 4; + * + * @param value The bytes for assignmentId to set. + * @return This builder for chaining. + */ + public Builder setAssignmentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assignmentId_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java index 6515859a..7422d2e0 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java @@ -88,4 +88,35 @@ public interface CreateAssignmentRequestOrBuilder * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; */ com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentOrBuilder(); + + /** + * + * + *
+   * The optional assignment ID. Assignment name will be generated automatically
+   * if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * 
+ * + * string assignment_id = 4; + * + * @return The assignmentId. + */ + java.lang.String getAssignmentId(); + /** + * + * + *
+   * The optional assignment ID. Assignment name will be generated automatically
+   * if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * 
+ * + * string assignment_id = 4; + * + * @return The bytes for assignmentId. + */ + com.google.protobuf.ByteString getAssignmentIdBytes(); } diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequest.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequest.java index c1cdcc3f..3de39968 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequest.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequest.java @@ -40,6 +40,7 @@ private CreateCapacityCommitmentRequest( private CreateCapacityCommitmentRequest() { parent_ = ""; + capacityCommitmentId_ = ""; } @java.lang.Override @@ -100,6 +101,13 @@ private CreateCapacityCommitmentRequest( enforceSingleAdminProjectPerOrg_ = input.readBool(); break; } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + capacityCommitmentId_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -257,6 +265,63 @@ public boolean getEnforceSingleAdminProjectPerOrg() { return enforceSingleAdminProjectPerOrg_; } + public static final int CAPACITY_COMMITMENT_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object capacityCommitmentId_; + /** + * + * + *
+   * The optional capacity commitment ID. Capacity commitment name will be
+   * generated automatically if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+   * 
+ * + * string capacity_commitment_id = 5; + * + * @return The capacityCommitmentId. + */ + @java.lang.Override + public java.lang.String getCapacityCommitmentId() { + java.lang.Object ref = capacityCommitmentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + capacityCommitmentId_ = s; + return s; + } + } + /** + * + * + *
+   * The optional capacity commitment ID. Capacity commitment name will be
+   * generated automatically if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+   * 
+ * + * string capacity_commitment_id = 5; + * + * @return The bytes for capacityCommitmentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCapacityCommitmentIdBytes() { + java.lang.Object ref = capacityCommitmentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + capacityCommitmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -280,6 +345,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (enforceSingleAdminProjectPerOrg_ != false) { output.writeBool(4, enforceSingleAdminProjectPerOrg_); } + if (!getCapacityCommitmentIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, capacityCommitmentId_); + } unknownFields.writeTo(output); } @@ -300,6 +368,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 4, enforceSingleAdminProjectPerOrg_); } + if (!getCapacityCommitmentIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, capacityCommitmentId_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -324,6 +395,7 @@ public boolean equals(final java.lang.Object obj) { } if (getEnforceSingleAdminProjectPerOrg() != other.getEnforceSingleAdminProjectPerOrg()) return false; + if (!getCapacityCommitmentId().equals(other.getCapacityCommitmentId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -345,6 +417,8 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnforceSingleAdminProjectPerOrg()); + hash = (37 * hash) + CAPACITY_COMMITMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getCapacityCommitmentId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -504,6 +578,8 @@ public Builder clear() { } enforceSingleAdminProjectPerOrg_ = false; + capacityCommitmentId_ = ""; + return this; } @@ -541,6 +617,7 @@ public com.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest result.capacityCommitment_ = capacityCommitmentBuilder_.build(); } result.enforceSingleAdminProjectPerOrg_ = enforceSingleAdminProjectPerOrg_; + result.capacityCommitmentId_ = capacityCommitmentId_; onBuilt(); return result; } @@ -605,6 +682,10 @@ public Builder mergeFrom( if (other.getEnforceSingleAdminProjectPerOrg() != false) { setEnforceSingleAdminProjectPerOrg(other.getEnforceSingleAdminProjectPerOrg()); } + if (!other.getCapacityCommitmentId().isEmpty()) { + capacityCommitmentId_ = other.capacityCommitmentId_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1012,6 +1093,132 @@ public Builder clearEnforceSingleAdminProjectPerOrg() { return this; } + private java.lang.Object capacityCommitmentId_ = ""; + /** + * + * + *
+     * The optional capacity commitment ID. Capacity commitment name will be
+     * generated automatically if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+     * 
+ * + * string capacity_commitment_id = 5; + * + * @return The capacityCommitmentId. + */ + public java.lang.String getCapacityCommitmentId() { + java.lang.Object ref = capacityCommitmentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + capacityCommitmentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The optional capacity commitment ID. Capacity commitment name will be
+     * generated automatically if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+     * 
+ * + * string capacity_commitment_id = 5; + * + * @return The bytes for capacityCommitmentId. + */ + public com.google.protobuf.ByteString getCapacityCommitmentIdBytes() { + java.lang.Object ref = capacityCommitmentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + capacityCommitmentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The optional capacity commitment ID. Capacity commitment name will be
+     * generated automatically if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+     * 
+ * + * string capacity_commitment_id = 5; + * + * @param value The capacityCommitmentId to set. + * @return This builder for chaining. + */ + public Builder setCapacityCommitmentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + capacityCommitmentId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The optional capacity commitment ID. Capacity commitment name will be
+     * generated automatically if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+     * 
+ * + * string capacity_commitment_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearCapacityCommitmentId() { + + capacityCommitmentId_ = getDefaultInstance().getCapacityCommitmentId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The optional capacity commitment ID. Capacity commitment name will be
+     * generated automatically if this field is empty.
+     * This field must only contain lower case alphanumeric characters or dash.
+     * Max length is 64 characters.
+     * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+     * 
+ * + * string capacity_commitment_id = 5; + * + * @param value The bytes for capacityCommitmentId to set. + * @return This builder for chaining. + */ + public Builder setCapacityCommitmentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + capacityCommitmentId_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequestOrBuilder.java index 895a1d55..5da0c62a 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequestOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateCapacityCommitmentRequestOrBuilder.java @@ -103,4 +103,37 @@ public interface CreateCapacityCommitmentRequestOrBuilder * @return The enforceSingleAdminProjectPerOrg. */ boolean getEnforceSingleAdminProjectPerOrg(); + + /** + * + * + *
+   * The optional capacity commitment ID. Capacity commitment name will be
+   * generated automatically if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+   * 
+ * + * string capacity_commitment_id = 5; + * + * @return The capacityCommitmentId. + */ + java.lang.String getCapacityCommitmentId(); + /** + * + * + *
+   * The optional capacity commitment ID. Capacity commitment name will be
+   * generated automatically if this field is empty.
+   * This field must only contain lower case alphanumeric characters or dash.
+   * Max length is 64 characters.
+   * NOTE: this ID won't be kept if the capacity commitment is split or merged.
+   * 
+ * + * string capacity_commitment_id = 5; + * + * @return The bytes for capacityCommitmentId. + */ + com.google.protobuf.ByteString getCapacityCommitmentIdBytes(); } diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java index 2e76515d..dc8196b7 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java @@ -78,6 +78,11 @@ private DeleteCapacityCommitmentRequest( name_ = s; break; } + case 24: + { + force_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -167,6 +172,26 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * Can be used to force delete commitments even if assignments exist. Deleting
+   * commitments with assignments may cause queries to fail if they no longer
+   * have access to slots.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -184,6 +209,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (force_ != false) { + output.writeBool(3, force_); + } unknownFields.writeTo(output); } @@ -196,6 +224,9 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -214,6 +245,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) obj; if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -227,6 +259,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -378,6 +412,8 @@ public Builder clear() { super.clear(); name_ = ""; + force_ = false; + return this; } @@ -409,6 +445,7 @@ public com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest result = new com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(this); result.name_ = name_; + result.force_ = force_; onBuilt(); return result; } @@ -467,6 +504,9 @@ public Builder mergeFrom( name_ = other.name_; onChanged(); } + if (other.getForce() != false) { + setForce(other.getForce()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -619,6 +659,64 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private boolean force_; + /** + * + * + *
+     * Can be used to force delete commitments even if assignments exist. Deleting
+     * commitments with assignments may cause queries to fail if they no longer
+     * have access to slots.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Can be used to force delete commitments even if assignments exist. Deleting
+     * commitments with assignments may cause queries to fail if they no longer
+     * have access to slots.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Can be used to force delete commitments even if assignments exist. Deleting
+     * commitments with assignments may cause queries to fail if they no longer
+     * have access to slots.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java index 7be35e39..c5781e9f 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java @@ -53,4 +53,19 @@ public interface DeleteCapacityCommitmentRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Can be used to force delete commitments even if assignments exist. Deleting
+   * commitments with assignments may cause queries to fail if they no longer
+   * have access to slots.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); } diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java index d6b6ff38..fcb817d0 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java @@ -118,7 +118,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. Name of the requested reservation, for example:
-   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * `projects/{project_id}/locations/{location_id}/biReservation`
    * 
* * @@ -144,7 +144,7 @@ public java.lang.String getName() { * *
    * Required. Name of the requested reservation, for example:
-   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * `projects/{project_id}/locations/{location_id}/biReservation`
    * 
* * @@ -495,7 +495,7 @@ public Builder mergeFrom( * *
      * Required. Name of the requested reservation, for example:
-     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * `projects/{project_id}/locations/{location_id}/biReservation`
      * 
* * @@ -520,7 +520,7 @@ public java.lang.String getName() { * *
      * Required. Name of the requested reservation, for example:
-     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * `projects/{project_id}/locations/{location_id}/biReservation`
      * 
* * @@ -545,7 +545,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Required. Name of the requested reservation, for example:
-     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * `projects/{project_id}/locations/{location_id}/biReservation`
      * 
* * @@ -569,7 +569,7 @@ public Builder setName(java.lang.String value) { * *
      * Required. Name of the requested reservation, for example:
-     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * `projects/{project_id}/locations/{location_id}/biReservation`
      * 
* * @@ -589,7 +589,7 @@ public Builder clearName() { * *
      * Required. Name of the requested reservation, for example:
-     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * `projects/{project_id}/locations/{location_id}/biReservation`
      * 
* * diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java index 1d1e119c..f64f9492 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface GetBiReservationRequestOrBuilder * *
    * Required. Name of the requested reservation, for example:
-   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * `projects/{project_id}/locations/{location_id}/biReservation`
    * 
* * @@ -43,7 +43,7 @@ public interface GetBiReservationRequestOrBuilder * *
    * Required. Name of the requested reservation, for example:
-   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * `projects/{project_id}/locations/{location_id}/biReservation`
    * 
* * diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java index 3b9c4993..b9b16203 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java @@ -85,6 +85,36 @@ private Reservation( case 32: { ignoreIdleSlots_ = input.readBool(); + break; + } + case 66: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (creationTime_ != null) { + subBuilder = creationTime_.toBuilder(); + } + creationTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(creationTime_); + creationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + break; } default: @@ -203,9 +233,10 @@ public long getSlotCapacity() { * * *
-   * If false, any query using this reservation will use idle slots from other
-   * reservations within the same admin project. If true, a query using this
-   * reservation will execute with the slot capacity specified above at most.
+   * If false, any query or pipeline job using this reservation will use idle
+   * slots from other reservations within the same admin project. If true, a
+   * query or pipeline job using this reservation will execute with the slot
+   * capacity specified in the slot_capacity field at most.
    * 
* * bool ignore_idle_slots = 4; @@ -217,6 +248,109 @@ public boolean getIgnoreIdleSlots() { return ignoreIdleSlots_; } + public static final int CREATION_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp creationTime_; + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationTime field is set. + */ + @java.lang.Override + public boolean hasCreationTime() { + return creationTime_ != null; + } + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreationTime() { + return creationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationTime_; + } + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() { + return getCreationTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -240,6 +374,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (ignoreIdleSlots_ != false) { output.writeBool(4, ignoreIdleSlots_); } + if (creationTime_ != null) { + output.writeMessage(8, getCreationTime()); + } + if (updateTime_ != null) { + output.writeMessage(9, getUpdateTime()); + } unknownFields.writeTo(output); } @@ -258,6 +398,12 @@ public int getSerializedSize() { if (ignoreIdleSlots_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, ignoreIdleSlots_); } + if (creationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreationTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -277,6 +423,14 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getSlotCapacity() != other.getSlotCapacity()) return false; if (getIgnoreIdleSlots() != other.getIgnoreIdleSlots()) return false; + if (hasCreationTime() != other.hasCreationTime()) return false; + if (hasCreationTime()) { + if (!getCreationTime().equals(other.getCreationTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -294,6 +448,14 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSlotCapacity()); hash = (37 * hash) + IGNORE_IDLE_SLOTS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreIdleSlots()); + if (hasCreationTime()) { + hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreationTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -445,6 +607,18 @@ public Builder clear() { ignoreIdleSlots_ = false; + if (creationTimeBuilder_ == null) { + creationTime_ = null; + } else { + creationTime_ = null; + creationTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } return this; } @@ -475,6 +649,16 @@ public com.google.cloud.bigquery.reservation.v1.Reservation buildPartial() { result.name_ = name_; result.slotCapacity_ = slotCapacity_; result.ignoreIdleSlots_ = ignoreIdleSlots_; + if (creationTimeBuilder_ == null) { + result.creationTime_ = creationTime_; + } else { + result.creationTime_ = creationTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } onBuilt(); return result; } @@ -535,6 +719,12 @@ public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.Reservation ot if (other.getIgnoreIdleSlots() != false) { setIgnoreIdleSlots(other.getIgnoreIdleSlots()); } + if (other.hasCreationTime()) { + mergeCreationTime(other.getCreationTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -754,9 +944,10 @@ public Builder clearSlotCapacity() { * * *
-     * If false, any query using this reservation will use idle slots from other
-     * reservations within the same admin project. If true, a query using this
-     * reservation will execute with the slot capacity specified above at most.
+     * If false, any query or pipeline job using this reservation will use idle
+     * slots from other reservations within the same admin project. If true, a
+     * query or pipeline job using this reservation will execute with the slot
+     * capacity specified in the slot_capacity field at most.
      * 
* * bool ignore_idle_slots = 4; @@ -771,9 +962,10 @@ public boolean getIgnoreIdleSlots() { * * *
-     * If false, any query using this reservation will use idle slots from other
-     * reservations within the same admin project. If true, a query using this
-     * reservation will execute with the slot capacity specified above at most.
+     * If false, any query or pipeline job using this reservation will use idle
+     * slots from other reservations within the same admin project. If true, a
+     * query or pipeline job using this reservation will execute with the slot
+     * capacity specified in the slot_capacity field at most.
      * 
* * bool ignore_idle_slots = 4; @@ -791,9 +983,10 @@ public Builder setIgnoreIdleSlots(boolean value) { * * *
-     * If false, any query using this reservation will use idle slots from other
-     * reservations within the same admin project. If true, a query using this
-     * reservation will execute with the slot capacity specified above at most.
+     * If false, any query or pipeline job using this reservation will use idle
+     * slots from other reservations within the same admin project. If true, a
+     * query or pipeline job using this reservation will execute with the slot
+     * capacity specified in the slot_capacity field at most.
      * 
* * bool ignore_idle_slots = 4; @@ -807,6 +1000,410 @@ public Builder clearIgnoreIdleSlots() { return this; } + private com.google.protobuf.Timestamp creationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + creationTimeBuilder_; + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationTime field is set. + */ + public boolean hasCreationTime() { + return creationTimeBuilder_ != null || creationTime_ != null; + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationTime. + */ + public com.google.protobuf.Timestamp getCreationTime() { + if (creationTimeBuilder_ == null) { + return creationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationTime_; + } else { + return creationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreationTime(com.google.protobuf.Timestamp value) { + if (creationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + creationTime_ = value; + onChanged(); + } else { + creationTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (creationTimeBuilder_ == null) { + creationTime_ = builderForValue.build(); + onChanged(); + } else { + creationTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreationTime(com.google.protobuf.Timestamp value) { + if (creationTimeBuilder_ == null) { + if (creationTime_ != null) { + creationTime_ = + com.google.protobuf.Timestamp.newBuilder(creationTime_) + .mergeFrom(value) + .buildPartial(); + } else { + creationTime_ = value; + } + onChanged(); + } else { + creationTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreationTime() { + if (creationTimeBuilder_ == null) { + creationTime_ = null; + onChanged(); + } else { + creationTime_ = null; + creationTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreationTimeBuilder() { + + onChanged(); + return getCreationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() { + if (creationTimeBuilder_ != null) { + return creationTimeBuilder_.getMessageOrBuilder(); + } else { + return creationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationTime_; + } + } + /** + * + * + *
+     * Output only. Creation time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreationTimeFieldBuilder() { + if (creationTimeBuilder_ == null) { + creationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreationTime(), getParentForChildren(), isClean()); + creationTime_ = null; + } + return creationTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Last update time of the reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java index af84f3fb..0206b18b 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java @@ -74,9 +74,10 @@ public interface ReservationOrBuilder * * *
-   * If false, any query using this reservation will use idle slots from other
-   * reservations within the same admin project. If true, a query using this
-   * reservation will execute with the slot capacity specified above at most.
+   * If false, any query or pipeline job using this reservation will use idle
+   * slots from other reservations within the same admin project. If true, a
+   * query or pipeline job using this reservation will execute with the slot
+   * capacity specified in the slot_capacity field at most.
    * 
* * bool ignore_idle_slots = 4; @@ -84,4 +85,83 @@ public interface ReservationOrBuilder * @return The ignoreIdleSlots. */ boolean getIgnoreIdleSlots(); + + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationTime field is set. + */ + boolean hasCreationTime(); + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationTime. + */ + com.google.protobuf.Timestamp getCreationTime(); + /** + * + * + *
+   * Output only. Creation time of the reservation.
+   * 
+ * + * + * .google.protobuf.Timestamp creation_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Last update time of the reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); } diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java index b00d5947..bf532e50 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java @@ -119,10 +119,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -156,253 +164,272 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "rce.proto\032\033google/protobuf/empty.proto\032 " + "google/protobuf/field_mask.proto\032\037google" + "/protobuf/timestamp.proto\032\027google/rpc/st" - + "atus.proto\"\306\001\n\013Reservation\022\014\n\004name\030\001 \001(\t" + + "atus.proto\"\264\002\n\013Reservation\022\014\n\004name\030\001 \001(\t" + "\022\025\n\rslot_capacity\030\002 \001(\003\022\031\n\021ignore_idle_s" - + "lots\030\004 \001(\010:w\352At\n.bigqueryreservation.goo" - + "gleapis.com/Reservation\022Bprojects/{proje" - + "ct}/locations/{location}/reservations/{r" - + "eservation}\"\353\005\n\022CapacityCommitment\022\021\n\004na" - + "me\030\001 \001(\tB\003\340A\003\022\022\n\nslot_count\030\002 \001(\003\022U\n\004pla" - + "n\030\003 \001(\0162G.google.cloud.bigquery.reservat" - + "ion.v1.CapacityCommitment.CommitmentPlan" - + "\022R\n\005state\030\004 \001(\0162>.google.cloud.bigquery." - + "reservation.v1.CapacityCommitment.StateB" - + "\003\340A\003\022<\n\023commitment_end_time\030\005 \001(\0132\032.goog" - + "le.protobuf.TimestampB\003\340A\003\022/\n\016failure_st" - + "atus\030\007 \001(\0132\022.google.rpc.StatusB\003\340A\003\022]\n\014r" - + "enewal_plan\030\010 \001(\0162G.google.cloud.bigquer" - + "y.reservation.v1.CapacityCommitment.Comm" - + "itmentPlan\"_\n\016CommitmentPlan\022\037\n\033COMMITME" - + "NT_PLAN_UNSPECIFIED\020\000\022\010\n\004FLEX\020\003\022\t\n\005TRIAL" - + "\020\005\022\013\n\007MONTHLY\020\002\022\n\n\006ANNUAL\020\004\"C\n\005State\022\025\n\021" - + "STATE_UNSPECIFIED\020\000\022\013\n\007PENDING\020\001\022\n\n\006ACTI" - + "VE\020\002\022\n\n\006FAILED\020\003:\216\001\352A\212\001\n5bigqueryreserva" - + "tion.googleapis.com/CapacityCommitment\022Q" - + "projects/{project}/locations/{location}/" - + "capacityCommitments/{capacity_commitment" - + "}\"\302\001\n\030CreateReservationRequest\022F\n\006parent" - + "\030\001 \001(\tB6\340A\002\372A0\022.bigqueryreservation.goog" - + "leapis.com/Reservation\022\026\n\016reservation_id" - + "\030\002 \001(\t\022F\n\013reservation\030\003 \001(\01321.google.clo" - + "ud.bigquery.reservation.v1.Reservation\"\210" - + "\001\n\027ListReservationsRequest\022F\n\006parent\030\001 \001" - + "(\tB6\340A\002\372A0\022.bigqueryreservation.googleap" - + "is.com/Reservation\022\021\n\tpage_size\030\002 \001(\005\022\022\n" - + "\npage_token\030\003 \001(\t\"|\n\030ListReservationsRes" - + "ponse\022G\n\014reservations\030\001 \003(\01321.google.clo" - + "ud.bigquery.reservation.v1.Reservation\022\027" - + "\n\017next_page_token\030\002 \001(\t\"]\n\025GetReservatio" - + "nRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.bigquery" - + "reservation.googleapis.com/Reservation\"`" - + "\n\030DeleteReservationRequest\022D\n\004name\030\001 \001(\t" - + "B6\340A\002\372A0\n.bigqueryreservation.googleapis" - + ".com/Reservation\"\223\001\n\030UpdateReservationRe" - + "quest\022F\n\013reservation\030\001 \001(\01321.google.clou" - + "d.bigquery.reservation.v1.Reservation\022/\n" - + "\013update_mask\030\002 \001(\0132\032.google.protobuf.Fie" - + "ldMask\"\365\001\n\037CreateCapacityCommitmentReque" - + "st\022M\n\006parent\030\001 \001(\tB=\340A\002\372A7\0225bigqueryrese" - + "rvation.googleapis.com/CapacityCommitmen" - + "t\022U\n\023capacity_commitment\030\002 \001(\01328.google." - + "cloud.bigquery.reservation.v1.CapacityCo" - + "mmitment\022,\n$enforce_single_admin_project" - + "_per_org\030\004 \001(\010\"\226\001\n\036ListCapacityCommitmen" - + "tsRequest\022M\n\006parent\030\001 \001(\tB=\340A\002\372A7\0225bigqu" - + "eryreservation.googleapis.com/CapacityCo" - + "mmitment\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" - + "n\030\003 \001(\t\"\222\001\n\037ListCapacityCommitmentsRespo" - + "nse\022V\n\024capacity_commitments\030\001 \003(\01328.goog" + + "lots\030\004 \001(\010\0226\n\rcreation_time\030\010 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + ":w\352At\n.bigqueryreservation.googleapis.co" + + "m/Reservation\022Bprojects/{project}/locati" + + "ons/{location}/reservations/{reservation" + + "}\"\253\006\n\022CapacityCommitment\022\021\n\004name\030\001 \001(\tB\003" + + "\340A\003\022\022\n\nslot_count\030\002 \001(\003\022U\n\004plan\030\003 \001(\0162G." + + "google.cloud.bigquery.reservation.v1.Cap" + + "acityCommitment.CommitmentPlan\022R\n\005state\030" + + "\004 \001(\0162>.google.cloud.bigquery.reservatio" + + "n.v1.CapacityCommitment.StateB\003\340A\003\022>\n\025co" + + "mmitment_start_time\030\t \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\022<\n\023commitment_end_tim" + + "e\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022/\n\016failure_status\030\007 \001(\0132\022.google.rpc.St" + + "atusB\003\340A\003\022]\n\014renewal_plan\030\010 \001(\0162G.google" + + ".cloud.bigquery.reservation.v1.CapacityC" + + "ommitment.CommitmentPlan\"_\n\016CommitmentPl" + + "an\022\037\n\033COMMITMENT_PLAN_UNSPECIFIED\020\000\022\010\n\004F" + + "LEX\020\003\022\t\n\005TRIAL\020\005\022\013\n\007MONTHLY\020\002\022\n\n\006ANNUAL\020" + + "\004\"C\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PEN" + + "DING\020\001\022\n\n\006ACTIVE\020\002\022\n\n\006FAILED\020\003:\216\001\352A\212\001\n5b" + + "igqueryreservation.googleapis.com/Capaci" + + "tyCommitment\022Qprojects/{project}/locatio" + + "ns/{location}/capacityCommitments/{capac" + + "ity_commitment}\"\302\001\n\030CreateReservationReq" + + "uest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.bigqueryre" + + "servation.googleapis.com/Reservation\022\026\n\016" + + "reservation_id\030\002 \001(\t\022F\n\013reservation\030\003 \001(" + + "\01321.google.cloud.bigquery.reservation.v1" + + ".Reservation\"\210\001\n\027ListReservationsRequest" + + "\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.bigqueryreserv" + + "ation.googleapis.com/Reservation\022\021\n\tpage" + + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"|\n\030ListR" + + "eservationsResponse\022G\n\014reservations\030\001 \003(" + + "\01321.google.cloud.bigquery.reservation.v1" + + ".Reservation\022\027\n\017next_page_token\030\002 \001(\t\"]\n" + + "\025GetReservationRequest\022D\n\004name\030\001 \001(\tB6\340A" + + "\002\372A0\n.bigqueryreservation.googleapis.com" + + "/Reservation\"`\n\030DeleteReservationRequest" + + "\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.bigqueryreservat" + + "ion.googleapis.com/Reservation\"\223\001\n\030Updat" + + "eReservationRequest\022F\n\013reservation\030\001 \001(\013" + + "21.google.cloud.bigquery.reservation.v1." + + "Reservation\022/\n\013update_mask\030\002 \001(\0132\032.googl" + + "e.protobuf.FieldMask\"\225\002\n\037CreateCapacityC" + + "ommitmentRequest\022M\n\006parent\030\001 \001(\tB=\340A\002\372A7" + + "\0225bigqueryreservation.googleapis.com/Cap" + + "acityCommitment\022U\n\023capacity_commitment\030\002" + + " \001(\01328.google.cloud.bigquery.reservation" + + ".v1.CapacityCommitment\022,\n$enforce_single" + + "_admin_project_per_org\030\004 \001(\010\022\036\n\026capacity" + + "_commitment_id\030\005 \001(\t\"\226\001\n\036ListCapacityCom" + + "mitmentsRequest\022M\n\006parent\030\001 \001(\tB=\340A\002\372A7\022" + + "5bigqueryreservation.googleapis.com/Capa" + + "cityCommitment\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"\222\001\n\037ListCapacityCommitment" + + "sResponse\022V\n\024capacity_commitments\030\001 \003(\0132" + + "8.google.cloud.bigquery.reservation.v1.C" + + "apacityCommitment\022\027\n\017next_page_token\030\002 \001" + + "(\t\"k\n\034GetCapacityCommitmentRequest\022K\n\004na" + + "me\030\001 \001(\tB=\340A\002\372A7\n5bigqueryreservation.go" + + "ogleapis.com/CapacityCommitment\"}\n\037Delet" + + "eCapacityCommitmentRequest\022K\n\004name\030\001 \001(\t" + + "B=\340A\002\372A7\n5bigqueryreservation.googleapis" + + ".com/CapacityCommitment\022\r\n\005force\030\003 \001(\010\"\251" + + "\001\n\037UpdateCapacityCommitmentRequest\022U\n\023ca" + + "pacity_commitment\030\001 \001(\01328.google.cloud.b" + + "igquery.reservation.v1.CapacityCommitmen" + + "t\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf" + + ".FieldMask\"\201\001\n\036SplitCapacityCommitmentRe" + + "quest\022K\n\004name\030\001 \001(\tB=\340A\002\372A7\n5bigqueryres" + + "ervation.googleapis.com/CapacityCommitme" + + "nt\022\022\n\nslot_count\030\002 \001(\003\"\264\001\n\037SplitCapacity" + + "CommitmentResponse\022G\n\005first\030\001 \001(\01328.goog" + "le.cloud.bigquery.reservation.v1.Capacit" - + "yCommitment\022\027\n\017next_page_token\030\002 \001(\t\"k\n\034" - + "GetCapacityCommitmentRequest\022K\n\004name\030\001 \001" - + "(\tB=\340A\002\372A7\n5bigqueryreservation.googleap" - + "is.com/CapacityCommitment\"n\n\037DeleteCapac" - + "ityCommitmentRequest\022K\n\004name\030\001 \001(\tB=\340A\002\372" - + "A7\n5bigqueryreservation.googleapis.com/C" - + "apacityCommitment\"\251\001\n\037UpdateCapacityComm" - + "itmentRequest\022U\n\023capacity_commitment\030\001 \001" - + "(\01328.google.cloud.bigquery.reservation.v" - + "1.CapacityCommitment\022/\n\013update_mask\030\002 \001(" - + "\0132\032.google.protobuf.FieldMask\"\201\001\n\036SplitC" - + "apacityCommitmentRequest\022K\n\004name\030\001 \001(\tB=" - + "\340A\002\372A7\n5bigqueryreservation.googleapis.c" - + "om/CapacityCommitment\022\022\n\nslot_count\030\002 \001(" - + "\003\"\264\001\n\037SplitCapacityCommitmentResponse\022G\n" - + "\005first\030\001 \001(\01328.google.cloud.bigquery.res" - + "ervation.v1.CapacityCommitment\022H\n\006second" - + "\030\002 \001(\01328.google.cloud.bigquery.reservati" - + "on.v1.CapacityCommitment\"\216\001\n\037MergeCapaci" - + "tyCommitmentsRequest\022J\n\006parent\030\001 \001(\tB:\372A" - + "7\0225bigqueryreservation.googleapis.com/Ca" - + "pacityCommitment\022\037\n\027capacity_commitment_" - + "ids\030\002 \003(\t\"\323\003\n\nAssignment\022\021\n\004name\030\001 \001(\tB\003" - + "\340A\003\022\020\n\010assignee\030\004 \001(\t\022J\n\010job_type\030\003 \001(\0162" - + "8.google.cloud.bigquery.reservation.v1.A" - + "ssignment.JobType\022J\n\005state\030\006 \001(\01626.googl" - + "e.cloud.bigquery.reservation.v1.Assignme" - + "nt.StateB\003\340A\003\"<\n\007JobType\022\030\n\024JOB_TYPE_UNS" - + "PECIFIED\020\000\022\014\n\010PIPELINE\020\001\022\t\n\005QUERY\020\002\"7\n\005S" - + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PENDING\020\001" - + "\022\n\n\006ACTIVE\020\002:\220\001\352A\214\001\n-bigqueryreservation" - + ".googleapis.com/Assignment\022[projects/{pr" - + "oject}/locations/{location}/reservations" - + "/{reservation}/assignments/{assignment}\"" - + "\246\001\n\027CreateAssignmentRequest\022E\n\006parent\030\001 " - + "\001(\tB5\340A\002\372A/\022-bigqueryreservation.googlea" - + "pis.com/Assignment\022D\n\nassignment\030\002 \001(\01320" - + ".google.cloud.bigquery.reservation.v1.As" - + "signment\"\206\001\n\026ListAssignmentsRequest\022E\n\006p" - + "arent\030\001 \001(\tB5\340A\002\372A/\022-bigqueryreservation" - + ".googleapis.com/Assignment\022\021\n\tpage_size\030" - + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"y\n\027ListAssignm" - + "entsResponse\022E\n\013assignments\030\001 \003(\01320.goog" - + "le.cloud.bigquery.reservation.v1.Assignm" - + "ent\022\027\n\017next_page_token\030\002 \001(\t\"^\n\027DeleteAs" - + "signmentRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-b" - + "igqueryreservation.googleapis.com/Assign" - + "ment\"\213\001\n\030SearchAssignmentsRequest\0229\n\006par" - + "ent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis." - + "com/Location\022\r\n\005query\030\002 \001(\t\022\021\n\tpage_size" - + "\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"{\n\031SearchAssi" - + "gnmentsResponse\022E\n\013assignments\030\001 \003(\01320.g" - + "oogle.cloud.bigquery.reservation.v1.Assi" - + "gnment\022\027\n\017next_page_token\030\002 \001(\t\"\250\001\n\025Move" - + "AssignmentRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n" - + "-bigqueryreservation.googleapis.com/Assi" - + "gnment\022J\n\016destination_id\030\003 \001(\tB2\372A/\022-big" - + "queryreservation.googleapis.com/Assignme" - + "nt\"\317\001\n\rBiReservation\022\014\n\004name\030\001 \001(\t\0224\n\013up" - + "date_time\030\003 \001(\0132\032.google.protobuf.Timest" - + "ampB\003\340A\003\022\014\n\004size\030\004 \001(\003:l\352Ai\n0bigqueryres" - + "ervation.googleapis.com/BiReservation\0225p" - + "rojects/{project}/locations/{location}/b" - + "ireservation\"a\n\027GetBiReservationRequest\022" - + "F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0bigqueryreservati" - + "on.googleapis.com/BiReservation\"\232\001\n\032Upda" - + "teBiReservationRequest\022K\n\016bi_reservation" - + "\030\001 \001(\01323.google.cloud.bigquery.reservati" - + "on.v1.BiReservation\022/\n\013update_mask\030\002 \001(\013" - + "2\032.google.protobuf.FieldMask2\317#\n\022Reserva" - + "tionService\022\361\001\n\021CreateReservation\022>.goog" - + "le.cloud.bigquery.reservation.v1.CreateR" - + "eservationRequest\0321.google.cloud.bigquer" - + "y.reservation.v1.Reservation\"i\202\323\344\223\002?\"0/v" - + "1/{parent=projects/*/locations/*}/reserv" - + "ations:\013reservation\332A!parent,reservation" - + ",reservation_id\022\324\001\n\020ListReservations\022=.g" - + "oogle.cloud.bigquery.reservation.v1.List" - + "ReservationsRequest\032>.google.cloud.bigqu" - + "ery.reservation.v1.ListReservationsRespo" - + "nse\"A\202\323\344\223\0022\0220/v1/{parent=projects/*/loca" - + "tions/*}/reservations\332A\006parent\022\301\001\n\016GetRe" - + "servation\022;.google.cloud.bigquery.reserv" - + "ation.v1.GetReservationRequest\0321.google." - + "cloud.bigquery.reservation.v1.Reservatio" - + "n\"?\202\323\344\223\0022\0220/v1/{name=projects/*/location" - + "s/*/reservations/*}\332A\004name\022\254\001\n\021DeleteRes" - + "ervation\022>.google.cloud.bigquery.reserva" - + "tion.v1.DeleteReservationRequest\032\026.googl" - + "e.protobuf.Empty\"?\202\323\344\223\0022*0/v1/{name=proj" - + "ects/*/locations/*/reservations/*}\332A\004nam" - + "e\022\363\001\n\021UpdateReservation\022>.google.cloud.b" - + "igquery.reservation.v1.UpdateReservation" - + "Request\0321.google.cloud.bigquery.reservat" - + "ion.v1.Reservation\"k\202\323\344\223\002K2.google.cloud.bigquery.reservat" + + "ion.v1.CreateReservationRequest\0321.google" + + ".cloud.bigquery.reservation.v1.Reservati" + + "on\"i\202\323\344\223\002?\"0/v1/{parent=projects/*/locat" + + "ions/*}/reservations:\013reservation\332A!pare" + + "nt,reservation,reservation_id\022\324\001\n\020ListRe" + + "servations\022=.google.cloud.bigquery.reser" + + "vation.v1.ListReservationsRequest\032>.goog" + + "le.cloud.bigquery.reservation.v1.ListRes" + + "ervationsResponse\"A\202\323\344\223\0022\0220/v1/{parent=p" + + "rojects/*/locations/*}/reservations\332A\006pa" + + "rent\022\301\001\n\016GetReservation\022;.google.cloud.b" + + "igquery.reservation.v1.GetReservationReq" + + "uest\0321.google.cloud.bigquery.reservation" + + ".v1.Reservation\"?\202\323\344\223\0022\0220/v1/{name=proje" + + "cts/*/locations/*/reservations/*}\332A\004name" + + "\022\254\001\n\021DeleteReservation\022>.google.cloud.bi" + + "gquery.reservation.v1.DeleteReservationR" + + "equest\032\026.google.protobuf.Empty\"?\202\323\344\223\0022*0" + + "/v1/{name=projects/*/locations/*/reserva" + + "tions/*}\332A\004name\022\363\001\n\021UpdateReservation\022>." + + "google.cloud.bigquery.reservation.v1.Upd" + + "ateReservationRequest\0321.google.cloud.big" + + "query.reservation.v1.Reservation\"k\202\323\344\223\002K" + + "2/v1/{par" - + "ent=projects/*/locations/*/reservations/" - + "*}/assignments:\nassignment\332A\021parent,assi" - + "gnment\022\337\001\n\017ListAssignments\022<.google.clou" - + "d.bigquery.reservation.v1.ListAssignment" - + "sRequest\032=.google.cloud.bigquery.reserva" - + "tion.v1.ListAssignmentsResponse\"O\202\323\344\223\002@\022" - + ">/v1/{parent=projects/*/locations/*/rese" - + "rvations/*}/assignments\332A\006parent\022\270\001\n\020Del" - + "eteAssignment\022=.google.cloud.bigquery.re" - + "servation.v1.DeleteAssignmentRequest\032\026.g" - + "oogle.protobuf.Empty\"M\202\323\344\223\002@*>/v1/{name=" - + "projects/*/locations/*/reservations/*/as" - + "signments/*}\332A\004name\022\342\001\n\021SearchAssignment" - + "s\022>.google.cloud.bigquery.reservation.v1" - + ".SearchAssignmentsRequest\032?.google.cloud" - + ".bigquery.reservation.v1.SearchAssignmen" - + "tsResponse\"L\202\323\344\223\0027\0225/v1/{parent=projects" - + "/*/locations/*}:searchAssignments\332A\014pare" - + "nt,query\022\345\001\n\016MoveAssignment\022;.google.clo" - + "ud.bigquery.reservation.v1.MoveAssignmen" - + "tRequest\0320.google.cloud.bigquery.reserva" - + "tion.v1.Assignment\"d\202\323\344\223\002H\"C/v1/{name=pr" - + "ojects/*/locations/*/reservations/*/assi" - + "gnments/*}:move:\001*\332A\023name,destination_id" - + "\022\306\001\n\020GetBiReservation\022=.google.cloud.big" - + "query.reservation.v1.GetBiReservationReq" - + "uest\0323.google.cloud.bigquery.reservation" - + ".v1.BiReservation\">\202\323\344\223\0021\022//v1/{name=pro" - + "jects/*/locations/*/biReservation}\332A\004nam" - + "e\022\201\002\n\023UpdateBiReservation\022@.google.cloud" - + ".bigquery.reservation.v1.UpdateBiReserva" - + "tionRequest\0323.google.cloud.bigquery.rese" - + "rvation.v1.BiReservation\"s\202\323\344\223\002P2>/v1/{b" - + "i_reservation.name=projects/*/locations/" - + "*/biReservation}:\016bi_reservation\332A\032bi_re" - + "servation,update_mask\032\177\312A\"bigqueryreserv" - + "ation.googleapis.com\322AWhttps://www.googl" - + "eapis.com/auth/bigquery,https://www.goog" - + "leapis.com/auth/cloud-platformB\335\001\n(com.g" - + "oogle.cloud.bigquery.reservation.v1B\020Res" - + "ervationProtoP\001ZOgoogle.golang.org/genpr" - + "oto/googleapis/cloud/bigquery/reservatio" - + "n/v1;reservation\252\002$Google.Cloud.BigQuery" - + ".Reservation.V1\312\002$Google\\Cloud\\BigQuery\\" - + "Reservation\\V1b\006proto3" + + "y.reservation.v1.CapacityCommitment\"\212\001\202\323" + + "\344\223\002b2K/v1/{capacity_commitment.name=proj" + + "ects/*/locations/*/capacityCommitments/*" + + "}:\023capacity_commitment\332A\037capacity_commit" + + "ment,update_mask\022\202\002\n\027SplitCapacityCommit" + + "ment\022D.google.cloud.bigquery.reservation" + + ".v1.SplitCapacityCommitmentRequest\032E.goo" + + "gle.cloud.bigquery.reservation.v1.SplitC" + + "apacityCommitmentResponse\"Z\202\323\344\223\002B\"=/v1/{" + + "name=projects/*/locations/*/capacityComm" + + "itments/*}:split:\001*\332A\017name,slot_count\022\206\002" + + "\n\030MergeCapacityCommitments\022E.google.clou" + + "d.bigquery.reservation.v1.MergeCapacityC" + + "ommitmentsRequest\0328.google.cloud.bigquer" + + "y.reservation.v1.CapacityCommitment\"i\202\323\344" + + "\223\002B\"=/v1/{parent=projects/*/locations/*}" + + "/capacityCommitments:merge:\001*\332A\036parent,c" + + "apacity_commitment_ids\022\353\001\n\020CreateAssignm" + + "ent\022=.google.cloud.bigquery.reservation." + + "v1.CreateAssignmentRequest\0320.google.clou" + + "d.bigquery.reservation.v1.Assignment\"f\202\323" + + "\344\223\002L\">/v1/{parent=projects/*/locations/*" + + "/reservations/*}/assignments:\nassignment" + + "\332A\021parent,assignment\022\337\001\n\017ListAssignments" + + "\022<.google.cloud.bigquery.reservation.v1." + + "ListAssignmentsRequest\032=.google.cloud.bi" + + "gquery.reservation.v1.ListAssignmentsRes" + + "ponse\"O\202\323\344\223\002@\022>/v1/{parent=projects/*/lo" + + "cations/*/reservations/*}/assignments\332A\006" + + "parent\022\270\001\n\020DeleteAssignment\022=.google.clo" + + "ud.bigquery.reservation.v1.DeleteAssignm" + + "entRequest\032\026.google.protobuf.Empty\"M\202\323\344\223" + + "\002@*>/v1/{name=projects/*/locations/*/res" + + "ervations/*/assignments/*}\332A\004name\022\345\001\n\021Se" + + "archAssignments\022>.google.cloud.bigquery." + + "reservation.v1.SearchAssignmentsRequest\032" + + "?.google.cloud.bigquery.reservation.v1.S" + + "earchAssignmentsResponse\"O\210\002\001\202\323\344\223\0027\0225/v1" + + "/{parent=projects/*/locations/*}:searchA" + + "ssignments\332A\014parent,query\022\356\001\n\024SearchAllA" + + "ssignments\022A.google.cloud.bigquery.reser" + + "vation.v1.SearchAllAssignmentsRequest\032B." + + "google.cloud.bigquery.reservation.v1.Sea" + + "rchAllAssignmentsResponse\"O\202\323\344\223\002:\0228/v1/{" + + "parent=projects/*/locations/*}:searchAll" + + "Assignments\332A\014parent,query\022\345\001\n\016MoveAssig" + + "nment\022;.google.cloud.bigquery.reservatio" + + "n.v1.MoveAssignmentRequest\0320.google.clou" + + "d.bigquery.reservation.v1.Assignment\"d\202\323" + + "\344\223\002H\"C/v1/{name=projects/*/locations/*/r" + + "eservations/*/assignments/*}:move:\001*\332A\023n" + + "ame,destination_id\022\306\001\n\020GetBiReservation\022" + + "=.google.cloud.bigquery.reservation.v1.G" + + "etBiReservationRequest\0323.google.cloud.bi" + + "gquery.reservation.v1.BiReservation\">\202\323\344" + + "\223\0021\022//v1/{name=projects/*/locations/*/bi" + + "Reservation}\332A\004name\022\201\002\n\023UpdateBiReservat" + + "ion\022@.google.cloud.bigquery.reservation." + + "v1.UpdateBiReservationRequest\0323.google.c" + + "loud.bigquery.reservation.v1.BiReservati" + + "on\"s\202\323\344\223\002P2>/v1/{bi_reservation.name=pro" + + "jects/*/locations/*/biReservation}:\016bi_r" + + "eservation\332A\032bi_reservation,update_mask\032" + + "\177\312A\"bigqueryreservation.googleapis.com\322A" + + "Whttps://www.googleapis.com/auth/bigquer" + + "y,https://www.googleapis.com/auth/cloud-" + + "platformB\335\001\n(com.google.cloud.bigquery.r" + + "eservation.v1B\020ReservationProtoP\001ZOgoogl" + + "e.golang.org/genproto/googleapis/cloud/b" + + "igquery/reservation/v1;reservation\252\002$Goo" + + "gle.Cloud.BigQuery.Reservation.V1\312\002$Goog" + + "le\\Cloud\\BigQuery\\Reservation\\V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -423,7 +450,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_Reservation_descriptor, new java.lang.String[] { - "Name", "SlotCapacity", "IgnoreIdleSlots", + "Name", "SlotCapacity", "IgnoreIdleSlots", "CreationTime", "UpdateTime", }); internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_descriptor = getDescriptor().getMessageTypes().get(1); @@ -435,6 +462,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SlotCount", "Plan", "State", + "CommitmentStartTime", "CommitmentEndTime", "FailureStatus", "RenewalPlan", @@ -493,7 +521,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_CreateCapacityCommitmentRequest_descriptor, new java.lang.String[] { - "Parent", "CapacityCommitment", "EnforceSingleAdminProjectPerOrg", + "Parent", + "CapacityCommitment", + "EnforceSingleAdminProjectPerOrg", + "CapacityCommitmentId", }); internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_descriptor = getDescriptor().getMessageTypes().get(9); @@ -525,7 +556,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_descriptor, new java.lang.String[] { - "Name", + "Name", "Force", }); internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_descriptor = getDescriptor().getMessageTypes().get(13); @@ -573,7 +604,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_descriptor, new java.lang.String[] { - "Parent", "Assignment", + "Parent", "Assignment", "AssignmentId", }); internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_descriptor = getDescriptor().getMessageTypes().get(19); @@ -607,16 +638,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Parent", "Query", "PageSize", "PageToken", }); - internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_descriptor = + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor = getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "Query", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_descriptor, new java.lang.String[] { "Assignments", "NextPageToken", }); + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor, + new java.lang.String[] { + "Assignments", "NextPageToken", + }); internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_descriptor, @@ -624,7 +671,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "DestinationId", }); internal_static_google_cloud_bigquery_reservation_v1_BiReservation_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_bigquery_reservation_v1_BiReservation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_BiReservation_descriptor, @@ -632,7 +679,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "UpdateTime", "Size", }); internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_descriptor, @@ -640,7 +687,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_descriptor, diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequest.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequest.java new file mode 100644 index 00000000..d0d5a9ba --- /dev/null +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequest.java @@ -0,0 +1,1158 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/reservation/v1/reservation.proto + +package com.google.cloud.bigquery.reservation.v1; + +/** + * + * + *
+ * The request for
+ * [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
+ * Note: "bigquery.reservationAssignments.search" permission is required on the
+ * related assignee.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} + */ +public final class SearchAllAssignmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + SearchAllAssignmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchAllAssignmentsRequest.newBuilder() to construct. + private SearchAllAssignmentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchAllAssignmentsRequest() { + parent_ = ""; + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchAllAssignmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchAllAssignmentsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name with location (project name could be the wildcard '-'),
+   * e.g.:
+   *   `projects/-/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name with location (project name could be the wildcard '-'),
+   * e.g.:
+   *   `projects/-/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Please specify resource name as assignee in the query.
+   * Examples:
+   * * `assignee=projects/myproject`
+   * * `assignee=folders/123`
+   * * `assignee=organizations/456`
+   * 
+ * + * string query = 2; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Please specify resource name as assignee in the query.
+   * Examples:
+   * * `assignee=projects/myproject`
+   * * `assignee=folders/123`
+   * * `assignee=organizations/456`
+   * 
+ * + * string query = 2; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return per page.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest other = + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for
+   * [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
+   * Note: "bigquery.reservationAssignments.search" permission is required on the
+   * related assignee.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + query_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest build() { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest result = + new com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(this); + result.parent_ = parent_; + result.query_ = query_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name with location (project name could be the wildcard '-'),
+     * e.g.:
+     *   `projects/-/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name with location (project name could be the wildcard '-'),
+     * e.g.:
+     *   `projects/-/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name with location (project name could be the wildcard '-'),
+     * e.g.:
+     *   `projects/-/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name with location (project name could be the wildcard '-'),
+     * e.g.:
+     *   `projects/-/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name with location (project name could be the wildcard '-'),
+     * e.g.:
+     *   `projects/-/locations/US`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Please specify resource name as assignee in the query.
+     * Examples:
+     * * `assignee=projects/myproject`
+     * * `assignee=folders/123`
+     * * `assignee=organizations/456`
+     * 
+ * + * string query = 2; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Please specify resource name as assignee in the query.
+     * Examples:
+     * * `assignee=projects/myproject`
+     * * `assignee=folders/123`
+     * * `assignee=organizations/456`
+     * 
+ * + * string query = 2; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Please specify resource name as assignee in the query.
+     * Examples:
+     * * `assignee=projects/myproject`
+     * * `assignee=folders/123`
+     * * `assignee=organizations/456`
+     * 
+ * + * string query = 2; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Please specify resource name as assignee in the query.
+     * Examples:
+     * * `assignee=projects/myproject`
+     * * `assignee=folders/123`
+     * * `assignee=organizations/456`
+     * 
+ * + * string query = 2; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Please specify resource name as assignee in the query.
+     * Examples:
+     * * `assignee=projects/myproject`
+     * * `assignee=folders/123`
+     * * `assignee=organizations/456`
+     * 
+ * + * string query = 2; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return per page.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return per page.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return per page.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + private static final com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchAllAssignmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchAllAssignmentsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequestOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequestOrBuilder.java new file mode 100644 index 00000000..21de1838 --- /dev/null +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/reservation/v1/reservation.proto + +package com.google.cloud.bigquery.reservation.v1; + +public interface SearchAllAssignmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name with location (project name could be the wildcard '-'),
+   * e.g.:
+   *   `projects/-/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name with location (project name could be the wildcard '-'),
+   * e.g.:
+   *   `projects/-/locations/US`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Please specify resource name as assignee in the query.
+   * Examples:
+   * * `assignee=projects/myproject`
+   * * `assignee=folders/123`
+   * * `assignee=organizations/456`
+   * 
+ * + * string query = 2; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Please specify resource name as assignee in the query.
+   * Examples:
+   * * `assignee=projects/myproject`
+   * * `assignee=folders/123`
+   * * `assignee=organizations/456`
+   * 
+ * + * string query = 2; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The maximum number of items to return per page.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponse.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponse.java new file mode 100644 index 00000000..200aa287 --- /dev/null +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponse.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/reservation/v1/reservation.proto + +package com.google.cloud.bigquery.reservation.v1; + +/** + * + * + *
+ * The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} + */ +public final class SearchAllAssignmentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + SearchAllAssignmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchAllAssignmentsResponse.newBuilder() to construct. + private SearchAllAssignmentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchAllAssignmentsResponse() { + assignments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchAllAssignmentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchAllAssignmentsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + assignments_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + assignments_.add( + input.readMessage( + com.google.cloud.bigquery.reservation.v1.Assignment.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + assignments_ = java.util.Collections.unmodifiableList(assignments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.Builder.class); + } + + public static final int ASSIGNMENTS_FIELD_NUMBER = 1; + private java.util.List assignments_; + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + @java.lang.Override + public java.util.List getAssignmentsList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + @java.lang.Override + public java.util.List + getAssignmentsOrBuilderList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + @java.lang.Override + public int getAssignmentsCount() { + return assignments_.size(); + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Assignment getAssignments(int index) { + return assignments_.get(index); + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentsOrBuilder( + int index) { + return assignments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < assignments_.size(); i++) { + output.writeMessage(1, assignments_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < assignments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, assignments_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse other = + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) obj; + + if (!getAssignmentsList().equals(other.getAssignmentsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAssignmentsCount() > 0) { + hash = (37 * hash) + ASSIGNMENTS_FIELD_NUMBER; + hash = (53 * hash) + getAssignmentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAssignmentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (assignmentsBuilder_ == null) { + assignments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + assignmentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAllAssignmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse build() { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse result = + new com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(this); + int from_bitField0_ = bitField0_; + if (assignmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + assignments_ = java.util.Collections.unmodifiableList(assignments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.assignments_ = assignments_; + } else { + result.assignments_ = assignmentsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + .getDefaultInstance()) return this; + if (assignmentsBuilder_ == null) { + if (!other.assignments_.isEmpty()) { + if (assignments_.isEmpty()) { + assignments_ = other.assignments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssignmentsIsMutable(); + assignments_.addAll(other.assignments_); + } + onChanged(); + } + } else { + if (!other.assignments_.isEmpty()) { + if (assignmentsBuilder_.isEmpty()) { + assignmentsBuilder_.dispose(); + assignmentsBuilder_ = null; + assignments_ = other.assignments_; + bitField0_ = (bitField0_ & ~0x00000001); + assignmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAssignmentsFieldBuilder() + : null; + } else { + assignmentsBuilder_.addAllMessages(other.assignments_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List assignments_ = + java.util.Collections.emptyList(); + + private void ensureAssignmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + assignments_ = + new java.util.ArrayList( + assignments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder> + assignmentsBuilder_; + + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public java.util.List + getAssignmentsList() { + if (assignmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(assignments_); + } else { + return assignmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public int getAssignmentsCount() { + if (assignmentsBuilder_ == null) { + return assignments_.size(); + } else { + return assignmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Assignment getAssignments(int index) { + if (assignmentsBuilder_ == null) { + return assignments_.get(index); + } else { + return assignmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder setAssignments( + int index, com.google.cloud.bigquery.reservation.v1.Assignment value) { + if (assignmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssignmentsIsMutable(); + assignments_.set(index, value); + onChanged(); + } else { + assignmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder setAssignments( + int index, com.google.cloud.bigquery.reservation.v1.Assignment.Builder builderForValue) { + if (assignmentsBuilder_ == null) { + ensureAssignmentsIsMutable(); + assignments_.set(index, builderForValue.build()); + onChanged(); + } else { + assignmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder addAssignments(com.google.cloud.bigquery.reservation.v1.Assignment value) { + if (assignmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssignmentsIsMutable(); + assignments_.add(value); + onChanged(); + } else { + assignmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder addAssignments( + int index, com.google.cloud.bigquery.reservation.v1.Assignment value) { + if (assignmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssignmentsIsMutable(); + assignments_.add(index, value); + onChanged(); + } else { + assignmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder addAssignments( + com.google.cloud.bigquery.reservation.v1.Assignment.Builder builderForValue) { + if (assignmentsBuilder_ == null) { + ensureAssignmentsIsMutable(); + assignments_.add(builderForValue.build()); + onChanged(); + } else { + assignmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder addAssignments( + int index, com.google.cloud.bigquery.reservation.v1.Assignment.Builder builderForValue) { + if (assignmentsBuilder_ == null) { + ensureAssignmentsIsMutable(); + assignments_.add(index, builderForValue.build()); + onChanged(); + } else { + assignmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder addAllAssignments( + java.lang.Iterable values) { + if (assignmentsBuilder_ == null) { + ensureAssignmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, assignments_); + onChanged(); + } else { + assignmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder clearAssignments() { + if (assignmentsBuilder_ == null) { + assignments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + assignmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public Builder removeAssignments(int index) { + if (assignmentsBuilder_ == null) { + ensureAssignmentsIsMutable(); + assignments_.remove(index); + onChanged(); + } else { + assignmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.Builder getAssignmentsBuilder( + int index) { + return getAssignmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentsOrBuilder( + int index) { + if (assignmentsBuilder_ == null) { + return assignments_.get(index); + } else { + return assignmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public java.util.List + getAssignmentsOrBuilderList() { + if (assignmentsBuilder_ != null) { + return assignmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(assignments_); + } + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.Builder addAssignmentsBuilder() { + return getAssignmentsFieldBuilder() + .addBuilder(com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance()); + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.Builder addAssignmentsBuilder( + int index) { + return getAssignmentsFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance()); + } + /** + * + * + *
+     * List of assignments visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public java.util.List + getAssignmentsBuilderList() { + return getAssignmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder> + getAssignmentsFieldBuilder() { + if (assignmentsBuilder_ == null) { + assignmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder>( + assignments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + assignments_ = null; + } + return assignmentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + private static final com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchAllAssignmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchAllAssignmentsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponseOrBuilder.java b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponseOrBuilder.java new file mode 100644 index 00000000..8949edfc --- /dev/null +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/reservation/v1/reservation.proto + +package com.google.cloud.bigquery.reservation.v1; + +public interface SearchAllAssignmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + java.util.List getAssignmentsList(); + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + com.google.cloud.bigquery.reservation.v1.Assignment getAssignments(int index); + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + int getAssignmentsCount(); + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + java.util.List + getAssignmentsOrBuilderList(); + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-bigqueryreservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto b/proto-google-cloud-bigqueryreservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto index 4b90ffdd..d631978f 100644 --- a/proto-google-cloud-bigqueryreservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto +++ b/proto-google-cloud-bigqueryreservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -202,6 +202,11 @@ service ReservationService { // `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. @@ -266,7 +271,7 @@ service ReservationService { option (google.api.method_signature) = "name"; } - // Looks up assignments for a specified resource for a particular region. + // 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. @@ -290,12 +295,40 @@ service ReservationService { // **Note** "-" cannot be used for projects // nor locations. rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) { + option deprecated = true; option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}:searchAssignments" }; option (google.api.method_signature) = "parent,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/*`. + rpc SearchAllAssignments(SearchAllAssignmentsRequest) returns (SearchAllAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAllAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + // Moves an assignment under a new reservation. // // This differs from removing an existing assignment and recreating a new one @@ -357,10 +390,17 @@ message Reservation { // `google.rpc.Code.RESOURCE_EXHAUSTED`. int64 slot_capacity = 2; - // If false, any query using this reservation will use idle slots from other - // reservations within the same admin project. If true, a query using this - // reservation will execute with the slot capacity specified above at most. + // If false, any query or pipeline job using this reservation will use idle + // slots from other reservations within the same admin project. If true, a + // query or pipeline job using this reservation will execute with the slot + // capacity specified in the slot_capacity field at most. bool ignore_idle_slots = 4; + + // Output only. Creation time of the reservation. + google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of the reservation. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Capacity commitment is a way to purchase compute capacity for BigQuery jobs @@ -439,6 +479,10 @@ message CapacityCommitment { // Output only. State of the commitment. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The start of the current commitment period. It is applicable only for + // ACTIVE capacity commitments. + google.protobuf.Timestamp commitment_start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The end of the current commitment period. It is applicable only for ACTIVE // capacity commitments. google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -549,6 +593,13 @@ message CreateCapacityCommitmentRequest { // If true, fail the request if another project in the organization has a // capacity commitment. bool enforce_single_admin_project_per_org = 4; + + // The optional capacity commitment ID. Capacity commitment name will be + // generated automatically if this field is empty. + // This field must only contain lower case alphanumeric characters or dash. + // Max length is 64 characters. + // NOTE: this ID won't be kept if the capacity commitment is split or merged. + string capacity_commitment_id = 5; } // The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. @@ -601,6 +652,11 @@ message DeleteCapacityCommitmentRequest { type: "bigqueryreservation.googleapis.com/CapacityCommitment" } ]; + + // Can be used to force delete commitments even if assignments exist. Deleting + // commitments with assignments may cause queries to fail if they no longer + // have access to slots. + bool force = 3; } // The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment]. @@ -671,6 +727,10 @@ message Assignment { // Query jobs from the project will use the reservation. QUERY = 2; + + // BigQuery ML jobs that use services external to BigQuery for model + // training. These jobs will not utilize idle slots from other reservations. + ML_EXTERNAL = 3; } // Assignment will remain in PENDING state if no active capacity commitment is @@ -718,6 +778,12 @@ message CreateAssignmentRequest { // Assignment resource to create. Assignment assignment = 2; + + // The optional assignment ID. Assignment name will be generated automatically + // if this field is empty. + // This field must only contain lower case alphanumeric characters or dash. + // Max length is 64 characters. + string assignment_id = 4; } // The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. @@ -798,6 +864,37 @@ message SearchAssignmentsRequest { string page_token = 4; } +// The request for +// [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAllAssignmentsRequest { + // Required. The resource name with location (project name could be the wildcard '-'), + // e.g.: + // `projects/-/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Please specify resource name as assignee in the query. + // + // Examples: + // + // * `assignee=projects/myproject` + // * `assignee=folders/123` + // * `assignee=organizations/456` + string query = 2; + + // The maximum number of items to return per page. + int32 page_size = 3; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 4; +} + // The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. message SearchAssignmentsResponse { // List of assignments visible to the user. @@ -808,6 +905,16 @@ message SearchAssignmentsResponse { string next_page_token = 2; } +// The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +message SearchAllAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + // The request for // [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment]. // @@ -839,12 +946,12 @@ message MoveAssignmentRequest { message BiReservation { option (google.api.resource) = { type: "bigqueryreservation.googleapis.com/BiReservation" - pattern: "projects/{project}/locations/{location}/bireservation" + pattern: "projects/{project}/locations/{location}/biReservation" }; // The resource name of the singleton BI reservation. // Reservation names have the form - // `projects/{project_id}/locations/{location_id}/bireservation`. + // `projects/{project_id}/locations/{location_id}/biReservation`. string name = 1; // Output only. The last update timestamp of a reservation. @@ -857,7 +964,7 @@ message BiReservation { // A request to get a singleton BI reservation. message GetBiReservationRequest { // Required. Name of the requested reservation, for example: - // `projects/{project_id}/locations/{location_id}/bireservation` + // `projects/{project_id}/locations/{location_id}/biReservation` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/synth.metadata b/synth.metadata index 4bc394af..d061ab15 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigqueryreservation.git", - "sha": "0a9eff31a9bab6e4213587ae03644f89768bf145" + "sha": "448c9d355a09727d46b137bff63ef0987223d818" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e1738ee972b49fd0c4d4718b035444495142b781", - "internalRef": "391407209" + "sha": "2c7f233a072ce7acf72a1db871a94a7c3e8ad36e", + "internalRef": "394129271" } }, { @@ -166,6 +166,10 @@ "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationName.java", "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java", "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java", + "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequest.java", + "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsRequestOrBuilder.java", + "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponse.java", + "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAllAssignmentsResponseOrBuilder.java", "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequest.java", "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequestOrBuilder.java", "proto-google-cloud-bigqueryreservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponse.java",