From 0c211ed2de16c95b93ae2e45a6bf9ebbe0e1053e Mon Sep 17 00:00:00 2001 From: stephwang Date: Tue, 21 Apr 2020 16:59:36 -0400 Subject: [PATCH] feat: initial code generation --- .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/release-please.yml | 2 + .github/trusted-contribution.yml | 2 + .gitignore | 15 + .kokoro/build.bat | 3 + .kokoro/build.sh | 113 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 59 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/dependencies.cfg | 12 + .kokoro/continuous/integration.cfg | 7 + .kokoro/continuous/java11.cfg | 7 + .kokoro/continuous/java7.cfg | 7 + .kokoro/continuous/java8-osx.cfg | 3 + .kokoro/continuous/java8-win.cfg | 3 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/lint.cfg | 13 + .kokoro/continuous/propose_release.cfg | 53 + .kokoro/continuous/samples.cfg | 31 + .kokoro/dependencies.sh | 86 + .kokoro/linkage-monitor.sh | 46 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/dependencies.cfg | 12 + .kokoro/nightly/integration.cfg | 41 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/lint.cfg | 13 + .kokoro/nightly/samples.cfg | 42 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 37 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 37 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 19 + .kokoro/release/publish_javadoc.sh | 55 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 44 + .kokoro/release/stage.sh | 42 + .kokoro/trampoline.sh | 24 + .repo-metadata.json | 15 + CODE_OF_CONDUCT.md | 93 + CONTRIBUTING.md | 130 + LICENSE | 202 ++ README.md | 165 + codecov.yaml | 4 + .../v1/ReservationServiceClient.java | 2556 +++++++++++++++ .../v1/ReservationServiceSettings.java | 394 +++ .../bigquery/reservation/v1/package-info.java | 52 + ...GrpcReservationServiceCallableFactory.java | 115 + .../v1/stub/GrpcReservationServiceStub.java | 823 +++++ .../v1/stub/ReservationServiceStub.java | 168 + .../stub/ReservationServiceStubSettings.java | 1033 ++++++ .../v1/MockReservationService.java | 57 + .../v1/MockReservationServiceImpl.java | 334 ++ .../v1/ReservationServiceClientTest.java | 906 ++++++ google-cloud-bigqueryreservations-bom/pom.xml | 93 + .../.flattened-pom.xml | 834 +++++ google-cloud-bigqueryreservations/pom.xml | 110 + .../v1/ReservationServiceGrpc.java | 2823 +++++++++++++++++ .../.flattened-pom.xml | 335 ++ .../pom.xml | 65 + java.header | 15 + license-checks.xml | 10 + pom.xml | 186 ++ .../bigquery/reservation/v1/Assignment.java | 1463 +++++++++ .../reservation/v1/AssignmentName.java | 251 ++ .../reservation/v1/AssignmentOrBuilder.java | 133 + .../reservation/v1/BiReservation.java | 1027 ++++++ .../reservation/v1/BiReservationName.java | 183 ++ .../v1/BiReservationOrBuilder.java | 105 + .../reservation/v1/CapacityCommitment.java | 2208 +++++++++++++ .../v1/CapacityCommitmentName.java | 217 ++ .../v1/CapacityCommitmentOrBuilder.java | 232 ++ .../v1/CreateAssignmentRequest.java | 943 ++++++ .../v1/CreateAssignmentRequestOrBuilder.java | 91 + .../v1/CreateReservationRequest.java | 1125 +++++++ .../v1/CreateReservationRequestOrBuilder.java | 118 + .../v1/DeleteAssignmentRequest.java | 667 ++++ .../v1/DeleteAssignmentRequestOrBuilder.java | 56 + .../v1/DeleteCapacityCommitmentRequest.java | 673 ++++ ...eteCapacityCommitmentRequestOrBuilder.java | 56 + .../v1/DeleteReservationRequest.java | 665 ++++ .../v1/DeleteReservationRequestOrBuilder.java | 56 + .../v1/GetBiReservationRequest.java | 663 ++++ .../v1/GetBiReservationRequestOrBuilder.java | 56 + .../v1/GetCapacityCommitmentRequest.java | 667 ++++ ...GetCapacityCommitmentRequestOrBuilder.java | 56 + .../reservation/v1/GetReservationRequest.java | 662 ++++ .../v1/GetReservationRequestOrBuilder.java | 56 + .../v1/ListAssignmentsRequest.java | 942 ++++++ .../v1/ListAssignmentsRequestOrBuilder.java | 98 + .../v1/ListAssignmentsResponse.java | 1149 +++++++ .../v1/ListAssignmentsResponseOrBuilder.java | 104 + .../v1/ListCapacityCommitmentsRequest.java | 937 ++++++ ...stCapacityCommitmentsRequestOrBuilder.java | 94 + .../v1/ListCapacityCommitmentsResponse.java | 1223 +++++++ ...tCapacityCommitmentsResponseOrBuilder.java | 116 + .../v1/ListReservationsRequest.java | 928 ++++++ .../v1/ListReservationsRequestOrBuilder.java | 94 + .../v1/ListReservationsResponse.java | 1152 +++++++ .../v1/ListReservationsResponseOrBuilder.java | 104 + .../bigquery/reservation/v1/LocationName.java | 182 ++ .../v1/MergeCapacityCommitmentsRequest.java | 967 ++++++ ...geCapacityCommitmentsRequestOrBuilder.java | 111 + .../reservation/v1/MoveAssignmentRequest.java | 863 +++++ .../v1/MoveAssignmentRequestOrBuilder.java | 85 + .../bigquery/reservation/v1/Reservation.java | 853 +++++ .../reservation/v1/ReservationName.java | 215 ++ .../reservation/v1/ReservationOrBuilder.java | 87 + .../reservation/v1/ReservationProto.java | 644 ++++ .../v1/SearchAssignmentsRequest.java | 1141 +++++++ .../v1/SearchAssignmentsRequestOrBuilder.java | 127 + .../v1/SearchAssignmentsResponse.java | 1153 +++++++ .../SearchAssignmentsResponseOrBuilder.java | 104 + .../v1/SplitCapacityCommitmentRequest.java | 760 +++++ ...litCapacityCommitmentRequestOrBuilder.java | 69 + .../v1/SplitCapacityCommitmentResponse.java | 1028 ++++++ ...itCapacityCommitmentResponseOrBuilder.java | 95 + .../v1/UpdateBiReservationRequest.java | 1017 ++++++ .../UpdateBiReservationRequestOrBuilder.java | 95 + .../v1/UpdateCapacityCommitmentRequest.java | 1034 ++++++ ...ateCapacityCommitmentRequestOrBuilder.java | 96 + .../v1/UpdateReservationRequest.java | 1011 ++++++ .../v1/UpdateReservationRequestOrBuilder.java | 95 + .../bigquery/reservation/v1/reservation.proto | 779 +++++ .../.flattened-pom.xml | 190 ++ .../pom.xml | 42 + renovate.json | 80 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 60 + synth.metadata | 37 + synth.py | 33 + versions.txt | 6 + 157 files changed, 45614 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/release-please.yml create mode 100644 .github/trusted-contribution.yml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/common.sh create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/dependencies.cfg create mode 100644 .kokoro/continuous/integration.cfg create mode 100644 .kokoro/continuous/java11.cfg create mode 100644 .kokoro/continuous/java7.cfg create mode 100644 .kokoro/continuous/java8-osx.cfg create mode 100644 .kokoro/continuous/java8-win.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/continuous/lint.cfg create mode 100644 .kokoro/continuous/propose_release.cfg create mode 100644 .kokoro/continuous/samples.cfg create mode 100755 .kokoro/dependencies.sh create mode 100755 .kokoro/linkage-monitor.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/dependencies.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/lint.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 codecov.yaml create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceCallableFactory.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java create mode 100644 google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java create mode 100644 google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationService.java create mode 100644 google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java create mode 100644 google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java create mode 100644 google-cloud-bigqueryreservations-bom/pom.xml create mode 100644 google-cloud-bigqueryreservations/.flattened-pom.xml create mode 100644 google-cloud-bigqueryreservations/pom.xml create mode 100644 grpc-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java create mode 100644 grpc-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml create mode 100644 grpc-google-cloud-bigqueryreservations-v1beta1/pom.xml create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 pom.xml create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentName.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentName.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponse.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponse.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponse.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/LocationName.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationName.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponse.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponse.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequest.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquery-reservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto create mode 100644 proto-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml create mode 100644 proto-google-cloud-bigqueryreservations-v1beta1/pom.xml create mode 100644 renovate.json create mode 100644 samples/install-without-bom/pom.xml create mode 100644 samples/pom.xml create mode 100644 samples/snapshot/pom.xml create mode 100644 samples/snippets/pom.xml create mode 100644 synth.metadata create mode 100644 synth.py create mode 100644 versions.txt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..4aefa702 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-bigqueryreservations/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. bigqueryreservations version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..d9b47f12 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-bigqueryreservations/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..bbec058d --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..99457abf --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/java-bigqueryreservations/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..20f528ba --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-bigqueryreservations +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..cb9397b2 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..a8d0ea04 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# 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 +# +# http://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. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + echo "${command}" + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..d4403265 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg new file mode 100644 index 00000000..7ddf999e --- /dev/null +++ b/.kokoro/continuous/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/continuous/java7.cfg b/.kokoro/continuous/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg new file mode 100644 index 00000000..6e1c3966 --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 00000000..59c286bd --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/continuous/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg new file mode 100644 index 00000000..7688da74 --- /dev/null +++ b/.kokoro/continuous/propose_release.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/continuous/propose_release.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..cf3bb434 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | grep -v ':test$' >.org-list.txt + + # Output dep list generated using the flattened pom (test scope deps are ommitted) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..759ab4e2 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail +# Display commands being run. +set -x + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..d4403265 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg new file mode 100644 index 00000000..7ddf999e --- /dev/null +++ b/.kokoro/nightly/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..40c4abb7 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,41 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..6e1c3966 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..59c286bd --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/nightly/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..20aabd55 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..f19a9fcb --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..7ddf999e --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..522e5b10 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..6e1c3966 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..59c286bd --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-bigqueryreservations/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..9b50be30 --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..1171aead --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..a15d69a3 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..b6f7ac6b --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-bigqueryreservations/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..ffa06c59 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..27ec96dc --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..b63d2395 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/publish_javadoc.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..f00e8769 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-cloud-bigqueryreservations +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..846b7ad0 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..0e652877 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,44 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigqueryreservations/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-bigqueryreservations/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-bigqueryreservations" + } +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..ba17ce01 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..9fbd8f3e --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "bigqueryreservations", + "name_pretty": "Cloud BigQuery Reservations", + "product_documentation": "https://cloud.google.com", + "api_description": "is about", + "client_documentation": "https://googleapis.dev/java/google-cloud-bigqueryreservations/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-bigqueryreservations", + "repo_short": "java-bigqueryreservations", + "distribution_name": "com.google.cloud:google-cloud-bigqueryreservations", + "api_id": "bigqueryreservations.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..085021dd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,130 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/README.md b/README.md new file mode 100644 index 00000000..8d768ebe --- /dev/null +++ b/README.md @@ -0,0 +1,165 @@ +# Google Cloud BigQuery Reservations Client for Java + +Java idiomatic client for [Cloud BigQuery Reservations][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file +```xml + + + + com.google.cloud + libraries-bom + 5.1.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigqueryreservations + + +``` + +If you are using Maven without BOM, add this to your dependencies: + +```xml + + com.google.cloud + google-cloud-bigqueryreservations + 0.0.0 + + +``` + +[//]: # ({x-version-update-start:google-cloud-bigqueryreservations:released}) + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-bigqueryreservations:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-bigqueryreservations" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud BigQuery Reservations [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud BigQuery Reservations. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-bigqueryreservations` library. See the [Quickstart](#quickstart) section +to add `google-cloud-bigqueryreservations` as a dependency in your code. + +## About Cloud BigQuery Reservations + + +[Cloud BigQuery Reservations][product-docs] is about + +See the [Cloud BigQuery Reservations client library docs][javadocs] to learn how to +use this Cloud BigQuery Reservations Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud BigQuery Reservations uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +[product-docs]: https://cloud.google.com +[javadocs]: https://googleapis.dev/java/google-cloud-bigqueryreservations/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigqueryreservations/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigqueryreservations.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigqueryreservations&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-bigqueryreservations/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-bigqueryreservations/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-bigqueryreservations/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservations.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java new file mode 100644 index 00000000..11a4eda2 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClient.java @@ -0,0 +1,2556 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStub; +import com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: This API allows users to manage their flat-rate BigQuery reservations. + * + *

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

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

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+ *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+ *   reservationServiceClient.deleteReservation(name);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the reservationServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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

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

To customize credentials: + * + *

+ * 
+ * ReservationServiceSettings reservationServiceSettings =
+ *     ReservationServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ReservationServiceClient reservationServiceClient =
+ *     ReservationServiceClient.create(reservationServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ReservationServiceSettings reservationServiceSettings =
+ *     ReservationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ReservationServiceClient reservationServiceClient =
+ *     ReservationServiceClient.create(reservationServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ReservationServiceClient implements BackgroundResource { + private final ReservationServiceSettings settings; + private final ReservationServiceStub stub; + + /** Constructs an instance of ReservationServiceClient with default settings. */ + public static final ReservationServiceClient create() throws IOException { + return create(ReservationServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ReservationServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ReservationServiceClient create(ReservationServiceSettings settings) + throws IOException { + return new ReservationServiceClient(settings); + } + + /** + * Constructs an instance of ReservationServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use ReservationServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ReservationServiceClient create(ReservationServiceStub stub) { + return new ReservationServiceClient(stub); + } + + /** + * Constructs an instance of ReservationServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ReservationServiceClient(ReservationServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ReservationServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ReservationServiceClient(ReservationServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ReservationServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ReservationServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   reservationServiceClient.deleteReservation(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the reservation to retrieve. E.g., + * projects/myproject/locations/US/reservations/team1-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReservation(ReservationName name) { + DeleteReservationRequest request = + DeleteReservationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   reservationServiceClient.deleteReservation(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the reservation to retrieve. E.g., + * projects/myproject/locations/US/reservations/team1-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReservation(String name) { + DeleteReservationRequest request = DeleteReservationRequest.newBuilder().setName(name).build(); + deleteReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   DeleteReservationRequest request = DeleteReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   reservationServiceClient.deleteReservation(request);
+   * }
+   * 
+ * + * @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 void deleteReservation(DeleteReservationRequest request) { + deleteReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   DeleteReservationRequest request = DeleteReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = reservationServiceClient.deleteReservationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteReservationCallable() { + return stub.deleteReservationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment before its + * commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   reservationServiceClient.deleteCapacityCommitment(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the capacity commitment to delete. E.g., + * projects/myproject/locations/US/capacityCommitments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCapacityCommitment(CapacityCommitmentName name) { + DeleteCapacityCommitmentRequest request = + DeleteCapacityCommitmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment before its + * commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   reservationServiceClient.deleteCapacityCommitment(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the capacity commitment to delete. E.g., + * projects/myproject/locations/US/capacityCommitments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCapacityCommitment(String name) { + DeleteCapacityCommitmentRequest request = + DeleteCapacityCommitmentRequest.newBuilder().setName(name).build(); + deleteCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment before its + * commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   DeleteCapacityCommitmentRequest request = DeleteCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   reservationServiceClient.deleteCapacityCommitment(request);
+   * }
+   * 
+ * + * @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 void deleteCapacityCommitment(DeleteCapacityCommitmentRequest request) { + deleteCapacityCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment before its + * commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   DeleteCapacityCommitmentRequest request = DeleteCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = reservationServiceClient.deleteCapacityCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteCapacityCommitmentCallable() { + return stub.deleteCapacityCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and + * project2. Reservation res1 exists. CreateAssignment was invoked previously and following + * assignments were created explicitly: <organizationA, res1> <project1, res1> Then + * deletion of <organizationA, res1> won't affect <project1, res1>. After deletion of + * <organizationA, res1>, queries from project1 will still use res1, while queries from + * project2 will use on-demand mode. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   reservationServiceClient.deleteAssignment(name);
+   * }
+   * 
+ * + * @param name Required. Name of the resource, e.g.: + * projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAssignment(AssignmentName name) { + DeleteAssignmentRequest request = + DeleteAssignmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and + * project2. Reservation res1 exists. CreateAssignment was invoked previously and following + * assignments were created explicitly: <organizationA, res1> <project1, res1> Then + * deletion of <organizationA, res1> won't affect <project1, res1>. After deletion of + * <organizationA, res1>, queries from project1 will still use res1, while queries from + * project2 will use on-demand mode. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   reservationServiceClient.deleteAssignment(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the resource, e.g.: + * projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAssignment(String name) { + DeleteAssignmentRequest request = DeleteAssignmentRequest.newBuilder().setName(name).build(); + deleteAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and + * project2. Reservation res1 exists. CreateAssignment was invoked previously and following + * assignments were created explicitly: <organizationA, res1> <project1, res1> Then + * deletion of <organizationA, res1> won't affect <project1, res1>. After deletion of + * <organizationA, res1>, queries from project1 will still use res1, while queries from + * project2 will use on-demand mode. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   DeleteAssignmentRequest request = DeleteAssignmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   reservationServiceClient.deleteAssignment(request);
+   * }
+   * 
+ * + * @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 void deleteAssignment(DeleteAssignmentRequest request) { + deleteAssignmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and + * project2. Reservation res1 exists. CreateAssignment was invoked previously and following + * assignments were created explicitly: <organizationA, res1> <project1, res1> Then + * deletion of <organizationA, res1> won't affect <project1, res1>. After deletion of + * <organizationA, res1>, queries from project1 will still use res1, while queries from + * project2 will use on-demand mode. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   DeleteAssignmentRequest request = DeleteAssignmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = reservationServiceClient.deleteAssignmentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteAssignmentCallable() { + return stub.deleteAssignmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Reservation reservation = Reservation.newBuilder().build();
+   *   String reservationId = "";
+   *   Reservation response = reservationServiceClient.createReservation(parent, reservation, reservationId);
+   * }
+   * 
+ * + * @param parent Required. Project, location. E.g., projects/myproject/locations/US + * @param reservation Content of the new reservation to create. + * @param reservationId The reservation ID. This field must only contain lower case alphanumeric + * characters or dash. Max length is 64 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reservation createReservation( + LocationName parent, Reservation reservation, String reservationId) { + CreateReservationRequest request = + CreateReservationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setReservation(reservation) + .setReservationId(reservationId) + .build(); + return createReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Reservation reservation = Reservation.newBuilder().build();
+   *   String reservationId = "";
+   *   Reservation response = reservationServiceClient.createReservation(parent.toString(), reservation, reservationId);
+   * }
+   * 
+ * + * @param parent Required. Project, location. E.g., projects/myproject/locations/US + * @param reservation Content of the new reservation to create. + * @param reservationId The reservation ID. This field must only contain lower case alphanumeric + * characters or dash. Max length is 64 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reservation createReservation( + String parent, Reservation reservation, String reservationId) { + CreateReservationRequest request = + CreateReservationRequest.newBuilder() + .setParent(parent) + .setReservation(reservation) + .setReservationId(reservationId) + .build(); + return createReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CreateReservationRequest request = CreateReservationRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   Reservation response = reservationServiceClient.createReservation(request);
+   * }
+   * 
+ * + * @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 Reservation createReservation(CreateReservationRequest request) { + return createReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CreateReservationRequest request = CreateReservationRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<Reservation> future = reservationServiceClient.createReservationCallable().futureCall(request);
+   *   // Do something
+   *   Reservation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createReservationCallable() { + return stub.createReservationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the reservations for the project in the specified location. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Reservation element : reservationServiceClient.listReservations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name containing project and location, e.g.: + * "projects/myproject/locations/US" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReservationsPagedResponse listReservations(LocationName parent) { + ListReservationsRequest request = + ListReservationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReservations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the reservations for the project in the specified location. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Reservation element : reservationServiceClient.listReservations(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name containing project and location, e.g.: + * "projects/myproject/locations/US" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReservationsPagedResponse listReservations(String parent) { + ListReservationsRequest request = + ListReservationsRequest.newBuilder().setParent(parent).build(); + return listReservations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the reservations for the project in the specified location. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListReservationsRequest request = ListReservationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Reservation element : reservationServiceClient.listReservations(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 ListReservationsPagedResponse listReservations(ListReservationsRequest request) { + return listReservationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the reservations for the project in the specified location. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListReservationsRequest request = ListReservationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListReservationsPagedResponse> future = reservationServiceClient.listReservationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Reservation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listReservationsPagedCallable() { + return stub.listReservationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the reservations for the project in the specified location. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListReservationsRequest request = ListReservationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListReservationsResponse response = reservationServiceClient.listReservationsCallable().call(request);
+   *     for (Reservation element : response.getReservationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listReservationsCallable() { + return stub.listReservationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   Reservation response = reservationServiceClient.getReservation(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the reservation to retrieve. E.g., + * projects/myproject/locations/US/reservations/team1-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reservation getReservation(ReservationName name) { + GetReservationRequest request = + GetReservationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   Reservation response = reservationServiceClient.getReservation(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the reservation to retrieve. E.g., + * projects/myproject/locations/US/reservations/team1-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reservation getReservation(String name) { + GetReservationRequest request = GetReservationRequest.newBuilder().setName(name).build(); + return getReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   GetReservationRequest request = GetReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Reservation response = reservationServiceClient.getReservation(request);
+   * }
+   * 
+ * + * @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 Reservation getReservation(GetReservationRequest request) { + return getReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   GetReservationRequest request = GetReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Reservation> future = reservationServiceClient.getReservationCallable().futureCall(request);
+   *   // Do something
+   *   Reservation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getReservationCallable() { + return stub.getReservationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   Reservation reservation = Reservation.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Reservation response = reservationServiceClient.updateReservation(reservation, updateMask);
+   * }
+   * 
+ * + * @param reservation Content of the reservation to update. + * @param updateMask Standard field mask for the set of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Reservation updateReservation(Reservation reservation, FieldMask updateMask) { + UpdateReservationRequest request = + UpdateReservationRequest.newBuilder() + .setReservation(reservation) + .setUpdateMask(updateMask) + .build(); + return updateReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateReservationRequest request = UpdateReservationRequest.newBuilder().build();
+   *   Reservation response = reservationServiceClient.updateReservation(request);
+   * }
+   * 
+ * + * @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 Reservation updateReservation(UpdateReservationRequest request) { + return updateReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing reservation resource. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateReservationRequest request = UpdateReservationRequest.newBuilder().build();
+   *   ApiFuture<Reservation> future = reservationServiceClient.updateReservationCallable().futureCall(request);
+   *   // Do something
+   *   Reservation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateReservationCallable() { + return stub.updateReservationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the capacity commitments for the admin project. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (CapacityCommitment element : reservationServiceClient.listCapacityCommitments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. Resource name of the parent reservation. E.g., + * projects/myproject/locations/US + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCapacityCommitmentsPagedResponse listCapacityCommitments(LocationName parent) { + ListCapacityCommitmentsRequest request = + ListCapacityCommitmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCapacityCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the capacity commitments for the admin project. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (CapacityCommitment element : reservationServiceClient.listCapacityCommitments(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. Resource name of the parent reservation. E.g., + * projects/myproject/locations/US + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCapacityCommitmentsPagedResponse listCapacityCommitments(String parent) { + ListCapacityCommitmentsRequest request = + ListCapacityCommitmentsRequest.newBuilder().setParent(parent).build(); + return listCapacityCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the capacity commitments for the admin project. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListCapacityCommitmentsRequest request = ListCapacityCommitmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (CapacityCommitment element : reservationServiceClient.listCapacityCommitments(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 ListCapacityCommitmentsPagedResponse listCapacityCommitments( + ListCapacityCommitmentsRequest request) { + return listCapacityCommitmentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the capacity commitments for the admin project. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListCapacityCommitmentsRequest request = ListCapacityCommitmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListCapacityCommitmentsPagedResponse> future = reservationServiceClient.listCapacityCommitmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (CapacityCommitment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCapacityCommitmentsPagedCallable() { + return stub.listCapacityCommitmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the capacity commitments for the admin project. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListCapacityCommitmentsRequest request = ListCapacityCommitmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListCapacityCommitmentsResponse response = reservationServiceClient.listCapacityCommitmentsCallable().call(request);
+   *     for (CapacityCommitment element : response.getCapacityCommitmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCapacityCommitmentsCallable() { + return stub.listCapacityCommitmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the capacity commitment. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   CapacityCommitment response = reservationServiceClient.getCapacityCommitment(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the capacity commitment to retrieve. E.g., + * projects/myproject/locations/US/capacityCommitments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CapacityCommitment getCapacityCommitment(CapacityCommitmentName name) { + GetCapacityCommitmentRequest request = + GetCapacityCommitmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the capacity commitment. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   CapacityCommitment response = reservationServiceClient.getCapacityCommitment(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the capacity commitment to retrieve. E.g., + * projects/myproject/locations/US/capacityCommitments/123 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CapacityCommitment getCapacityCommitment(String name) { + GetCapacityCommitmentRequest request = + GetCapacityCommitmentRequest.newBuilder().setName(name).build(); + return getCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the capacity commitment. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   GetCapacityCommitmentRequest request = GetCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   CapacityCommitment response = reservationServiceClient.getCapacityCommitment(request);
+   * }
+   * 
+ * + * @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 CapacityCommitment getCapacityCommitment(GetCapacityCommitmentRequest request) { + return getCapacityCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns information about the capacity commitment. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   GetCapacityCommitmentRequest request = GetCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<CapacityCommitment> future = reservationServiceClient.getCapacityCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   CapacityCommitment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getCapacityCommitmentCallable() { + return stub.getCapacityCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing capacity commitment. + * + *

Only plan and renewal_plan fields can be updated. Plan can only be changed to a plan of a + * longer commitment period. Attempting to change to a plan with shorter commitment period will + * fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   CapacityCommitment response = reservationServiceClient.updateCapacityCommitment(capacityCommitment, updateMask);
+   * }
+   * 
+ * + * @param capacityCommitment Content of the capacity commitment to update. + * @param updateMask Standard field mask for the set of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CapacityCommitment updateCapacityCommitment( + CapacityCommitment capacityCommitment, FieldMask updateMask) { + UpdateCapacityCommitmentRequest request = + UpdateCapacityCommitmentRequest.newBuilder() + .setCapacityCommitment(capacityCommitment) + .setUpdateMask(updateMask) + .build(); + return updateCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing capacity commitment. + * + *

Only plan and renewal_plan fields can be updated. Plan can only be changed to a plan of a + * longer commitment period. Attempting to change to a plan with shorter commitment period will + * fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateCapacityCommitmentRequest request = UpdateCapacityCommitmentRequest.newBuilder().build();
+   *   CapacityCommitment response = reservationServiceClient.updateCapacityCommitment(request);
+   * }
+   * 
+ * + * @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 CapacityCommitment updateCapacityCommitment( + UpdateCapacityCommitmentRequest request) { + return updateCapacityCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing capacity commitment. + * + *

Only plan and renewal_plan fields can be updated. Plan can only be changed to a plan of a + * longer commitment period. Attempting to change to a plan with shorter commitment period will + * fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateCapacityCommitmentRequest request = UpdateCapacityCommitmentRequest.newBuilder().build();
+   *   ApiFuture<CapacityCommitment> future = reservationServiceClient.updateCapacityCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   CapacityCommitment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateCapacityCommitmentCallable() { + return stub.updateCapacityCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits capacity commitment to two commitments of the same plan and commitment_end_time. A + * common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 + * slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of + * the first one to flex and then delete it. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   long slotCount = 0L;
+   *   SplitCapacityCommitmentResponse response = reservationServiceClient.splitCapacityCommitment(name, slotCount);
+   * }
+   * 
+ * + * @param name Required. The resource name e.g.,: + * projects/myproject/locations/US/capacityCommitments/123 + * @param slotCount Number of slots in the capacity commitment after the split. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SplitCapacityCommitmentResponse splitCapacityCommitment( + CapacityCommitmentName name, long slotCount) { + SplitCapacityCommitmentRequest request = + SplitCapacityCommitmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSlotCount(slotCount) + .build(); + return splitCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits capacity commitment to two commitments of the same plan and commitment_end_time. A + * common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 + * slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of + * the first one to flex and then delete it. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   long slotCount = 0L;
+   *   SplitCapacityCommitmentResponse response = reservationServiceClient.splitCapacityCommitment(name.toString(), slotCount);
+   * }
+   * 
+ * + * @param name Required. The resource name e.g.,: + * projects/myproject/locations/US/capacityCommitments/123 + * @param slotCount Number of slots in the capacity commitment after the split. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SplitCapacityCommitmentResponse splitCapacityCommitment( + String name, long slotCount) { + SplitCapacityCommitmentRequest request = + SplitCapacityCommitmentRequest.newBuilder().setName(name).setSlotCount(slotCount).build(); + return splitCapacityCommitment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits capacity commitment to two commitments of the same plan and commitment_end_time. A + * common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 + * slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of + * the first one to flex and then delete it. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   SplitCapacityCommitmentRequest request = SplitCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   SplitCapacityCommitmentResponse response = reservationServiceClient.splitCapacityCommitment(request);
+   * }
+   * 
+ * + * @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 SplitCapacityCommitmentResponse splitCapacityCommitment( + SplitCapacityCommitmentRequest request) { + return splitCapacityCommitmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits capacity commitment to two commitments of the same plan and commitment_end_time. A + * common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 + * slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of + * the first one to flex and then delete it. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   CapacityCommitmentName name = CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]");
+   *   SplitCapacityCommitmentRequest request = SplitCapacityCommitmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<SplitCapacityCommitmentResponse> future = reservationServiceClient.splitCapacityCommitmentCallable().futureCall(request);
+   *   // Do something
+   *   SplitCapacityCommitmentResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + splitCapacityCommitmentCallable() { + return stub.splitCapacityCommitmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Merges capacity commitments of the same plan into one. Resulting capacity commitment has the + * longer commitment_end_time out of the two. Attempting to merge capacity commitments of + * different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   List<String> capacityCommitmentIds = new ArrayList<>();
+   *   CapacityCommitment response = reservationServiceClient.mergeCapacityCommitments(parent, capacityCommitmentIds);
+   * }
+   * 
+ * + * @param parent Parent resource that identifies admin project and location e.g., + * projects/myproject/locations/us + * @param capacityCommitmentIds Ids of capacity commitments to merge. These capacity commitments + * must exist under admin project and location specified in the parent. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CapacityCommitment mergeCapacityCommitments( + LocationName parent, List capacityCommitmentIds) { + MergeCapacityCommitmentsRequest request = + MergeCapacityCommitmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .addAllCapacityCommitmentIds(capacityCommitmentIds) + .build(); + return mergeCapacityCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Merges capacity commitments of the same plan into one. Resulting capacity commitment has the + * longer commitment_end_time out of the two. Attempting to merge capacity commitments of + * different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   List<String> capacityCommitmentIds = new ArrayList<>();
+   *   CapacityCommitment response = reservationServiceClient.mergeCapacityCommitments(parent.toString(), capacityCommitmentIds);
+   * }
+   * 
+ * + * @param parent Parent resource that identifies admin project and location e.g., + * projects/myproject/locations/us + * @param capacityCommitmentIds Ids of capacity commitments to merge. These capacity commitments + * must exist under admin project and location specified in the parent. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CapacityCommitment mergeCapacityCommitments( + String parent, List capacityCommitmentIds) { + MergeCapacityCommitmentsRequest request = + MergeCapacityCommitmentsRequest.newBuilder() + .setParent(parent) + .addAllCapacityCommitmentIds(capacityCommitmentIds) + .build(); + return mergeCapacityCommitments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Merges capacity commitments of the same plan into one. Resulting capacity commitment has the + * longer commitment_end_time out of the two. Attempting to merge capacity commitments of + * different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   MergeCapacityCommitmentsRequest request = MergeCapacityCommitmentsRequest.newBuilder().build();
+   *   CapacityCommitment response = reservationServiceClient.mergeCapacityCommitments(request);
+   * }
+   * 
+ * + * @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 CapacityCommitment mergeCapacityCommitments( + MergeCapacityCommitmentsRequest request) { + return mergeCapacityCommitmentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Merges capacity commitments of the same plan into one. Resulting capacity commitment has the + * longer commitment_end_time out of the two. Attempting to merge capacity commitments of + * different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   MergeCapacityCommitmentsRequest request = MergeCapacityCommitmentsRequest.newBuilder().build();
+   *   ApiFuture<CapacityCommitment> future = reservationServiceClient.mergeCapacityCommitmentsCallable().futureCall(request);
+   *   // Do something
+   *   CapacityCommitment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + mergeCapacityCommitmentsCallable() { + return stub.mergeCapacityCommitmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an object which allows the given project to submit jobs of a certain type using slots + * from the specified reservation. Currently a resource (project, folder, organization) can only + * have one assignment per {job_type, location}, and that reservation will be used for all jobs of + * the matching type. Within the organization, different assignments can be created on projects, + * folders or organization level. During query execution, the assignment is looked up at the + * project, folder and organization levels in that order. The first assignment found is applied to + * the query. When creating assignments, it does not matter if other assignments exist at higher + * levels. E.g: organizationA contains project1, project2. Assignments for organizationA, project1 + * and project2 could all be created, mapping to the same or different reservations. Returns + * `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the + * project using the reservation and the project that owns this reservation. Returns + * `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of + * the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   Assignment assignment = Assignment.newBuilder().build();
+   *   Assignment response = reservationServiceClient.createAssignment(parent, assignment);
+   * }
+   * 
+ * + * @param parent Required. The parent resource name of the assignment E.g.: + * projects/myproject/locations/US/reservations/team1-prod + * @param assignment Assignment resource to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assignment createAssignment(ReservationName parent, Assignment assignment) { + CreateAssignmentRequest request = + CreateAssignmentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAssignment(assignment) + .build(); + return createAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an object which allows the given project to submit jobs of a certain type using slots + * from the specified reservation. Currently a resource (project, folder, organization) can only + * have one assignment per {job_type, location}, and that reservation will be used for all jobs of + * the matching type. Within the organization, different assignments can be created on projects, + * folders or organization level. During query execution, the assignment is looked up at the + * project, folder and organization levels in that order. The first assignment found is applied to + * the query. When creating assignments, it does not matter if other assignments exist at higher + * levels. E.g: organizationA contains project1, project2. Assignments for organizationA, project1 + * and project2 could all be created, mapping to the same or different reservations. Returns + * `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the + * project using the reservation and the project that owns this reservation. Returns + * `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of + * the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   Assignment assignment = Assignment.newBuilder().build();
+   *   Assignment response = reservationServiceClient.createAssignment(parent.toString(), assignment);
+   * }
+   * 
+ * + * @param parent Required. The parent resource name of the assignment E.g.: + * projects/myproject/locations/US/reservations/team1-prod + * @param assignment Assignment resource to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assignment createAssignment(String parent, Assignment assignment) { + CreateAssignmentRequest request = + CreateAssignmentRequest.newBuilder().setParent(parent).setAssignment(assignment).build(); + return createAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an object which allows the given project to submit jobs of a certain type using slots + * from the specified reservation. Currently a resource (project, folder, organization) can only + * have one assignment per {job_type, location}, and that reservation will be used for all jobs of + * the matching type. Within the organization, different assignments can be created on projects, + * folders or organization level. During query execution, the assignment is looked up at the + * project, folder and organization levels in that order. The first assignment found is applied to + * the query. When creating assignments, it does not matter if other assignments exist at higher + * levels. E.g: organizationA contains project1, project2. Assignments for organizationA, project1 + * and project2 could all be created, mapping to the same or different reservations. Returns + * `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the + * project using the reservation and the project that owns this reservation. Returns + * `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of + * the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   CreateAssignmentRequest request = CreateAssignmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   Assignment response = reservationServiceClient.createAssignment(request);
+   * }
+   * 
+ * + * @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 Assignment createAssignment(CreateAssignmentRequest request) { + return createAssignmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an object which allows the given project to submit jobs of a certain type using slots + * from the specified reservation. Currently a resource (project, folder, organization) can only + * have one assignment per {job_type, location}, and that reservation will be used for all jobs of + * the matching type. Within the organization, different assignments can be created on projects, + * folders or organization level. During query execution, the assignment is looked up at the + * project, folder and organization levels in that order. The first assignment found is applied to + * the query. When creating assignments, it does not matter if other assignments exist at higher + * levels. E.g: organizationA contains project1, project2. Assignments for organizationA, project1 + * and project2 could all be created, mapping to the same or different reservations. Returns + * `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the + * project using the reservation and the project that owns this reservation. Returns + * `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of + * the reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   CreateAssignmentRequest request = CreateAssignmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<Assignment> future = reservationServiceClient.createAssignmentCallable().futureCall(request);
+   *   // Do something
+   *   Assignment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createAssignmentCallable() { + return stub.createAssignmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA + * contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked + * previously and following assignments were created explicitly: <organizationA, res1> + * <project1, res1> Then this API will just return the above two assignments for reservation + * res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the + * request. In that case all assignments belongs to the specified project and location will be + * listed. Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   for (Assignment element : reservationServiceClient.listAssignments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name e.g.: + * projects/myproject/locations/US/reservations/team1-prod Or: + * projects/myproject/locations/US/reservations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAssignmentsPagedResponse listAssignments(ReservationName parent) { + ListAssignmentsRequest request = + ListAssignmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAssignments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA + * contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked + * previously and following assignments were created explicitly: <organizationA, res1> + * <project1, res1> Then this API will just return the above two assignments for reservation + * res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the + * request. In that case all assignments belongs to the specified project and location will be + * listed. Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   for (Assignment element : reservationServiceClient.listAssignments(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name e.g.: + * projects/myproject/locations/US/reservations/team1-prod Or: + * projects/myproject/locations/US/reservations/- + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAssignmentsPagedResponse listAssignments(String parent) { + ListAssignmentsRequest request = ListAssignmentsRequest.newBuilder().setParent(parent).build(); + return listAssignments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA + * contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked + * previously and following assignments were created explicitly: <organizationA, res1> + * <project1, res1> Then this API will just return the above two assignments for reservation + * res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the + * request. In that case all assignments belongs to the specified project and location will be + * listed. Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   ListAssignmentsRequest request = ListAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Assignment element : reservationServiceClient.listAssignments(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 ListAssignmentsPagedResponse listAssignments(ListAssignmentsRequest request) { + return listAssignmentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA + * contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked + * previously and following assignments were created explicitly: <organizationA, res1> + * <project1, res1> Then this API will just return the above two assignments for reservation + * res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the + * request. In that case all assignments belongs to the specified project and location will be + * listed. Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   ListAssignmentsRequest request = ListAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListAssignmentsPagedResponse> future = reservationServiceClient.listAssignmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Assignment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listAssignmentsPagedCallable() { + return stub.listAssignmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA + * contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked + * previously and following assignments were created explicitly: <organizationA, res1> + * <project1, res1> Then this API will just return the above two assignments for reservation + * res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the + * request. In that case all assignments belongs to the specified project and location will be + * listed. Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   ListAssignmentsRequest request = ListAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListAssignmentsResponse response = reservationServiceClient.listAssignmentsCallable().call(request);
+   *     for (Assignment element : response.getAssignmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listAssignmentsCallable() { + return stub.listAssignmentsCallable(); + } + + // 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. Same logic applies if the request is about a folder. If the + * request is about an organization, then assignments created on the organization will be returned + * (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior + * differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup + * (project->folder->organization) happens in this API. 3) Parent here is + * projects/*/locations/*, instead of projects/*/locations/*reservations/*. + * Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   String query = "";
+   *   for (Assignment element : reservationServiceClient.searchAssignments(parent, query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the admin project(containing project and + * location), e.g.: "projects/myproject/locations/US". + * @param query Please specify resource name as assignee in the query. e.g., + * "assignee=projects/myproject" "assignee=folders/123" "assignee=organizations/456" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchAssignmentsPagedResponse searchAssignments( + ReservationName parent, String query) { + SearchAssignmentsRequest request = + SearchAssignmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchAssignments(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. Same logic applies if the request is about a folder. If the + * request is about an organization, then assignments created on the organization will be returned + * (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior + * differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup + * (project->folder->organization) happens in this API. 3) Parent here is + * projects/*/locations/*, instead of projects/*/locations/*reservations/*. + * Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   String query = "";
+   *   for (Assignment element : reservationServiceClient.searchAssignments(parent.toString(), query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the admin project(containing project and + * location), e.g.: "projects/myproject/locations/US". + * @param query Please specify resource name as assignee in the query. e.g., + * "assignee=projects/myproject" "assignee=folders/123" "assignee=organizations/456" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchAssignmentsPagedResponse searchAssignments(String parent, String query) { + SearchAssignmentsRequest request = + SearchAssignmentsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchAssignments(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. Same logic applies if the request is about a folder. If the + * request is about an organization, then assignments created on the organization will be returned + * (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior + * differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup + * (project->folder->organization) happens in this API. 3) Parent here is + * projects/*/locations/*, instead of projects/*/locations/*reservations/*. + * Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Assignment element : reservationServiceClient.searchAssignments(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 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: 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. Same logic applies if the request is about a folder. If the + * request is about an organization, then assignments created on the organization will be returned + * (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior + * differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup + * (project->folder->organization) happens in this API. 3) Parent here is + * projects/*/locations/*, instead of projects/*/locations/*reservations/*. + * Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<SearchAssignmentsPagedResponse> future = reservationServiceClient.searchAssignmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Assignment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + searchAssignmentsPagedCallable() { + return stub.searchAssignmentsPagedCallable(); + } + + // 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. Same logic applies if the request is about a folder. If the + * request is about an organization, then assignments created on the organization will be returned + * (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior + * differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup + * (project->folder->organization) happens in this API. 3) Parent here is + * projects/*/locations/*, instead of projects/*/locations/*reservations/*. + * Note "-" cannot be used for projects nor locations. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+   *   SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     SearchAssignmentsResponse response = reservationServiceClient.searchAssignmentsCallable().call(request);
+   *     for (Assignment element : response.getAssignmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + searchAssignmentsCallable() { + return stub.searchAssignmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a assignment under a new reservation. Customers can do this by deleting the existing + * assignment followed by creating another assignment under the new reservation, but this method + * provides a transactional way to do so, to make sure the assignee always has an associated + * reservation. Without the method customers might see some queries run on-demand which might be + * unexpected. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   String destinationId = "";
+   *   Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
+   * }
+   * 
+ * + * @param name Required. The resource name of the assignment, e.g.: + * projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * @param destinationId The new reservation ID, e.g.: + * projects/myotherproject/locations/US/reservations/team2-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assignment moveAssignment(AssignmentName name, String destinationId) { + MoveAssignmentRequest request = + MoveAssignmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationId(destinationId) + .build(); + return moveAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a assignment under a new reservation. Customers can do this by deleting the existing + * assignment followed by creating another assignment under the new reservation, but this method + * provides a transactional way to do so, to make sure the assignee always has an associated + * reservation. Without the method customers might see some queries run on-demand which might be + * unexpected. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   String destinationId = "";
+   *   Assignment response = reservationServiceClient.moveAssignment(name.toString(), destinationId);
+   * }
+   * 
+ * + * @param name Required. The resource name of the assignment, e.g.: + * projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * @param destinationId The new reservation ID, e.g.: + * projects/myotherproject/locations/US/reservations/team2-prod + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assignment moveAssignment(String name, String destinationId) { + MoveAssignmentRequest request = + MoveAssignmentRequest.newBuilder().setName(name).setDestinationId(destinationId).build(); + return moveAssignment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a assignment under a new reservation. Customers can do this by deleting the existing + * assignment followed by creating another assignment under the new reservation, but this method + * provides a transactional way to do so, to make sure the assignee always has an associated + * reservation. Without the method customers might see some queries run on-demand which might be + * unexpected. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   MoveAssignmentRequest request = MoveAssignmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Assignment response = reservationServiceClient.moveAssignment(request);
+   * }
+   * 
+ * + * @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 Assignment moveAssignment(MoveAssignmentRequest request) { + return moveAssignmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a assignment under a new reservation. Customers can do this by deleting the existing + * assignment followed by creating another assignment under the new reservation, but this method + * provides a transactional way to do so, to make sure the assignee always has an associated + * reservation. Without the method customers might see some queries run on-demand which might be + * unexpected. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
+   *   MoveAssignmentRequest request = MoveAssignmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Assignment> future = reservationServiceClient.moveAssignmentCallable().futureCall(request);
+   *   // Do something
+   *   Assignment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable moveAssignmentCallable() { + return stub.moveAssignmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a BI reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]");
+   *   BiReservation response = reservationServiceClient.getBiReservation(name);
+   * }
+   * 
+ * + * @param name Required. Name of the requested reservation, for example: + * `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) { + GetBiReservationRequest request = + GetBiReservationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBiReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a BI reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]");
+   *   BiReservation response = reservationServiceClient.getBiReservation(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the requested reservation, for example: + * `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) { + GetBiReservationRequest request = GetBiReservationRequest.newBuilder().setName(name).build(); + return getBiReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a BI reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]");
+   *   GetBiReservationRequest request = GetBiReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   BiReservation response = reservationServiceClient.getBiReservation(request);
+   * }
+   * 
+ * + * @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 BiReservation getBiReservation(GetBiReservationRequest request) { + return getBiReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a BI reservation. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]");
+   *   GetBiReservationRequest request = GetBiReservationRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<BiReservation> future = reservationServiceClient.getBiReservationCallable().futureCall(request);
+   *   // Do something
+   *   BiReservation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBiReservationCallable() { + return stub.getBiReservationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a BI reservation. Only fields specified in the field_mask are updated. Singleton BI + * reservation always exists with default size 0. In order to reserve BI capacity it needs to be + * updated to an amount greater than 0. In order to release BI capacity reservation size must be + * set to 0. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   BiReservation biReservation = BiReservation.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   BiReservation response = reservationServiceClient.updateBiReservation(biReservation, updateMask);
+   * }
+   * 
+ * + * @param biReservation A reservation to update. + * @param updateMask A list of fields to be updated in this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BiReservation updateBiReservation( + BiReservation biReservation, FieldMask updateMask) { + UpdateBiReservationRequest request = + UpdateBiReservationRequest.newBuilder() + .setBiReservation(biReservation) + .setUpdateMask(updateMask) + .build(); + return updateBiReservation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a BI reservation. Only fields specified in the field_mask are updated. Singleton BI + * reservation always exists with default size 0. In order to reserve BI capacity it needs to be + * updated to an amount greater than 0. In order to release BI capacity reservation size must be + * set to 0. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateBiReservationRequest request = UpdateBiReservationRequest.newBuilder().build();
+   *   BiReservation response = reservationServiceClient.updateBiReservation(request);
+   * }
+   * 
+ * + * @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 BiReservation updateBiReservation(UpdateBiReservationRequest request) { + return updateBiReservationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a BI reservation. Only fields specified in the field_mask are updated. Singleton BI + * reservation always exists with default size 0. In order to reserve BI capacity it needs to be + * updated to an amount greater than 0. In order to release BI capacity reservation size must be + * set to 0. + * + *

Sample code: + * + *


+   * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+   *   UpdateBiReservationRequest request = UpdateBiReservationRequest.newBuilder().build();
+   *   ApiFuture<BiReservation> future = reservationServiceClient.updateBiReservationCallable().futureCall(request);
+   *   // Do something
+   *   BiReservation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateBiReservationCallable() { + return stub.updateBiReservationCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListReservationsPagedResponse + extends AbstractPagedListResponse< + ListReservationsRequest, + ListReservationsResponse, + Reservation, + ListReservationsPage, + ListReservationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReservationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListReservationsPagedResponse apply(ListReservationsPage input) { + return new ListReservationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListReservationsPagedResponse(ListReservationsPage page) { + super(page, ListReservationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListReservationsPage + extends AbstractPage< + ListReservationsRequest, ListReservationsResponse, Reservation, ListReservationsPage> { + + private ListReservationsPage( + PageContext context, + ListReservationsResponse response) { + super(context, response); + } + + private static ListReservationsPage createEmptyPage() { + return new ListReservationsPage(null, null); + } + + @Override + protected ListReservationsPage createPage( + PageContext context, + ListReservationsResponse response) { + return new ListReservationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListReservationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReservationsRequest, + ListReservationsResponse, + Reservation, + ListReservationsPage, + ListReservationsFixedSizeCollection> { + + private ListReservationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReservationsFixedSizeCollection createEmptyCollection() { + return new ListReservationsFixedSizeCollection(null, 0); + } + + @Override + protected ListReservationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReservationsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCapacityCommitmentsPagedResponse + extends AbstractPagedListResponse< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + CapacityCommitment, + ListCapacityCommitmentsPage, + ListCapacityCommitmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse, CapacityCommitment> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCapacityCommitmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListCapacityCommitmentsPagedResponse apply(ListCapacityCommitmentsPage input) { + return new ListCapacityCommitmentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListCapacityCommitmentsPagedResponse(ListCapacityCommitmentsPage page) { + super(page, ListCapacityCommitmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCapacityCommitmentsPage + extends AbstractPage< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + CapacityCommitment, + ListCapacityCommitmentsPage> { + + private ListCapacityCommitmentsPage( + PageContext< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse, CapacityCommitment> + context, + ListCapacityCommitmentsResponse response) { + super(context, response); + } + + private static ListCapacityCommitmentsPage createEmptyPage() { + return new ListCapacityCommitmentsPage(null, null); + } + + @Override + protected ListCapacityCommitmentsPage createPage( + PageContext< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse, CapacityCommitment> + context, + ListCapacityCommitmentsResponse response) { + return new ListCapacityCommitmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse, CapacityCommitment> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCapacityCommitmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + CapacityCommitment, + ListCapacityCommitmentsPage, + ListCapacityCommitmentsFixedSizeCollection> { + + private ListCapacityCommitmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCapacityCommitmentsFixedSizeCollection createEmptyCollection() { + return new ListCapacityCommitmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListCapacityCommitmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCapacityCommitmentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAssignmentsPagedResponse + extends AbstractPagedListResponse< + ListAssignmentsRequest, + ListAssignmentsResponse, + Assignment, + ListAssignmentsPage, + ListAssignmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAssignmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAssignmentsPagedResponse apply(ListAssignmentsPage input) { + return new ListAssignmentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAssignmentsPagedResponse(ListAssignmentsPage page) { + super(page, ListAssignmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAssignmentsPage + extends AbstractPage< + ListAssignmentsRequest, ListAssignmentsResponse, Assignment, ListAssignmentsPage> { + + private ListAssignmentsPage( + PageContext context, + ListAssignmentsResponse response) { + super(context, response); + } + + private static ListAssignmentsPage createEmptyPage() { + return new ListAssignmentsPage(null, null); + } + + @Override + protected ListAssignmentsPage createPage( + PageContext context, + ListAssignmentsResponse response) { + return new ListAssignmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAssignmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAssignmentsRequest, + ListAssignmentsResponse, + Assignment, + ListAssignmentsPage, + ListAssignmentsFixedSizeCollection> { + + private ListAssignmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAssignmentsFixedSizeCollection createEmptyCollection() { + return new ListAssignmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListAssignmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAssignmentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchAssignmentsPagedResponse + extends AbstractPagedListResponse< + SearchAssignmentsRequest, + SearchAssignmentsResponse, + Assignment, + SearchAssignmentsPage, + SearchAssignmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchAssignmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchAssignmentsPagedResponse apply(SearchAssignmentsPage input) { + return new SearchAssignmentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchAssignmentsPagedResponse(SearchAssignmentsPage page) { + super(page, SearchAssignmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchAssignmentsPage + extends AbstractPage< + SearchAssignmentsRequest, SearchAssignmentsResponse, Assignment, SearchAssignmentsPage> { + + private SearchAssignmentsPage( + PageContext context, + SearchAssignmentsResponse response) { + super(context, response); + } + + private static SearchAssignmentsPage createEmptyPage() { + return new SearchAssignmentsPage(null, null); + } + + @Override + protected SearchAssignmentsPage createPage( + PageContext context, + SearchAssignmentsResponse response) { + return new SearchAssignmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchAssignmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchAssignmentsRequest, + SearchAssignmentsResponse, + Assignment, + SearchAssignmentsPage, + SearchAssignmentsFixedSizeCollection> { + + private SearchAssignmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchAssignmentsFixedSizeCollection createEmptyCollection() { + return new SearchAssignmentsFixedSizeCollection(null, 0); + } + + @Override + protected SearchAssignmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchAssignmentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java new file mode 100644 index 00000000..10181a5b --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceSettings.java @@ -0,0 +1,394 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +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.SearchAssignmentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.reservation.v1.stub.ReservationServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ReservationServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryreservation.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of deleteReservation to 30 seconds: + * + *

+ * 
+ * ReservationServiceSettings.Builder reservationServiceSettingsBuilder =
+ *     ReservationServiceSettings.newBuilder();
+ * reservationServiceSettingsBuilder
+ *     .deleteReservationSettings()
+ *     .setRetrySettings(
+ *         reservationServiceSettingsBuilder.deleteReservationSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ReservationServiceSettings reservationServiceSettings = reservationServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ReservationServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to deleteReservation. */ + public UnaryCallSettings deleteReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).deleteReservationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCapacityCommitment. */ + public UnaryCallSettings + deleteCapacityCommitmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).deleteCapacityCommitmentSettings(); + } + + /** Returns the object with the settings used for calls to deleteAssignment. */ + public UnaryCallSettings deleteAssignmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).deleteAssignmentSettings(); + } + + /** Returns the object with the settings used for calls to createReservation. */ + public UnaryCallSettings createReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).createReservationSettings(); + } + + /** Returns the object with the settings used for calls to listReservations. */ + public PagedCallSettings< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).listReservationsSettings(); + } + + /** Returns the object with the settings used for calls to getReservation. */ + public UnaryCallSettings getReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).getReservationSettings(); + } + + /** Returns the object with the settings used for calls to updateReservation. */ + public UnaryCallSettings updateReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).updateReservationSettings(); + } + + /** Returns the object with the settings used for calls to listCapacityCommitments. */ + public PagedCallSettings< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).listCapacityCommitmentsSettings(); + } + + /** Returns the object with the settings used for calls to getCapacityCommitment. */ + public UnaryCallSettings + getCapacityCommitmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).getCapacityCommitmentSettings(); + } + + /** Returns the object with the settings used for calls to updateCapacityCommitment. */ + public UnaryCallSettings + updateCapacityCommitmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).updateCapacityCommitmentSettings(); + } + + /** Returns the object with the settings used for calls to splitCapacityCommitment. */ + public UnaryCallSettings + splitCapacityCommitmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).splitCapacityCommitmentSettings(); + } + + /** Returns the object with the settings used for calls to mergeCapacityCommitments. */ + public UnaryCallSettings + mergeCapacityCommitmentsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).mergeCapacityCommitmentsSettings(); + } + + /** Returns the object with the settings used for calls to createAssignment. */ + public UnaryCallSettings createAssignmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).createAssignmentSettings(); + } + + /** Returns the object with the settings used for calls to listAssignments. */ + public PagedCallSettings< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).listAssignmentsSettings(); + } + + /** Returns the object with the settings used for calls to searchAssignments. */ + public PagedCallSettings< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).searchAssignmentsSettings(); + } + + /** Returns the object with the settings used for calls to moveAssignment. */ + public UnaryCallSettings moveAssignmentSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).moveAssignmentSettings(); + } + + /** Returns the object with the settings used for calls to getBiReservation. */ + public UnaryCallSettings getBiReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).getBiReservationSettings(); + } + + /** Returns the object with the settings used for calls to updateBiReservation. */ + public UnaryCallSettings + updateBiReservationSettings() { + return ((ReservationServiceStubSettings) getStubSettings()).updateBiReservationSettings(); + } + + public static final ReservationServiceSettings create(ReservationServiceStubSettings stub) + throws IOException { + return new ReservationServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ReservationServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ReservationServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ReservationServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ReservationServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ReservationServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ReservationServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ReservationServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ReservationServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ReservationServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ReservationServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ReservationServiceStubSettings.newBuilder()); + } + + protected Builder(ReservationServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ReservationServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ReservationServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ReservationServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to deleteReservation. */ + public UnaryCallSettings.Builder deleteReservationSettings() { + return getStubSettingsBuilder().deleteReservationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCapacityCommitment. */ + public UnaryCallSettings.Builder + deleteCapacityCommitmentSettings() { + return getStubSettingsBuilder().deleteCapacityCommitmentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAssignment. */ + public UnaryCallSettings.Builder deleteAssignmentSettings() { + return getStubSettingsBuilder().deleteAssignmentSettings(); + } + + /** Returns the builder for the settings used for calls to createReservation. */ + public UnaryCallSettings.Builder + createReservationSettings() { + return getStubSettingsBuilder().createReservationSettings(); + } + + /** Returns the builder for the settings used for calls to listReservations. */ + public PagedCallSettings.Builder< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings() { + return getStubSettingsBuilder().listReservationsSettings(); + } + + /** Returns the builder for the settings used for calls to getReservation. */ + public UnaryCallSettings.Builder getReservationSettings() { + return getStubSettingsBuilder().getReservationSettings(); + } + + /** Returns the builder for the settings used for calls to updateReservation. */ + public UnaryCallSettings.Builder + updateReservationSettings() { + return getStubSettingsBuilder().updateReservationSettings(); + } + + /** Returns the builder for the settings used for calls to listCapacityCommitments. */ + public PagedCallSettings.Builder< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings() { + return getStubSettingsBuilder().listCapacityCommitmentsSettings(); + } + + /** Returns the builder for the settings used for calls to getCapacityCommitment. */ + public UnaryCallSettings.Builder + getCapacityCommitmentSettings() { + return getStubSettingsBuilder().getCapacityCommitmentSettings(); + } + + /** Returns the builder for the settings used for calls to updateCapacityCommitment. */ + public UnaryCallSettings.Builder + updateCapacityCommitmentSettings() { + return getStubSettingsBuilder().updateCapacityCommitmentSettings(); + } + + /** Returns the builder for the settings used for calls to splitCapacityCommitment. */ + public UnaryCallSettings.Builder< + SplitCapacityCommitmentRequest, SplitCapacityCommitmentResponse> + splitCapacityCommitmentSettings() { + return getStubSettingsBuilder().splitCapacityCommitmentSettings(); + } + + /** Returns the builder for the settings used for calls to mergeCapacityCommitments. */ + public UnaryCallSettings.Builder + mergeCapacityCommitmentsSettings() { + return getStubSettingsBuilder().mergeCapacityCommitmentsSettings(); + } + + /** Returns the builder for the settings used for calls to createAssignment. */ + public UnaryCallSettings.Builder + createAssignmentSettings() { + return getStubSettingsBuilder().createAssignmentSettings(); + } + + /** Returns the builder for the settings used for calls to listAssignments. */ + public PagedCallSettings.Builder< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings() { + return getStubSettingsBuilder().listAssignmentsSettings(); + } + + /** Returns the builder for the settings used for calls to searchAssignments. */ + public PagedCallSettings.Builder< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings() { + return getStubSettingsBuilder().searchAssignmentsSettings(); + } + + /** Returns the builder for the settings used for calls to moveAssignment. */ + public UnaryCallSettings.Builder moveAssignmentSettings() { + return getStubSettingsBuilder().moveAssignmentSettings(); + } + + /** Returns the builder for the settings used for calls to getBiReservation. */ + public UnaryCallSettings.Builder + getBiReservationSettings() { + return getStubSettingsBuilder().getBiReservationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBiReservation. */ + public UnaryCallSettings.Builder + updateBiReservationSettings() { + return getStubSettingsBuilder().updateBiReservationSettings(); + } + + @Override + public ReservationServiceSettings build() throws IOException { + return new ReservationServiceSettings(this); + } + } +} diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java new file mode 100644 index 00000000..6845104b --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/package-info.java @@ -0,0 +1,52 @@ +/* + * 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. + */ + +/** + * A client to BigQuery Reservation API. + * + *

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

======================== ReservationServiceClient ======================== + * + *

Service Description: This API allows users to manage their flat-rate BigQuery reservations. + * + *

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

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

Sample for ReservationServiceClient: + * + *

+ * 
+ * try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
+ *   ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
+ *   reservationServiceClient.deleteReservation(name);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.bigquery.reservation.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceCallableFactory.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceCallableFactory.java new file mode 100644 index 00000000..6934f644 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for BigQuery Reservation API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcReservationServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java new file mode 100644 index 00000000..92c54547 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/GrpcReservationServiceStub.java @@ -0,0 +1,823 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1.stub; + +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.SearchAssignmentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.reservation.v1.Assignment; +import com.google.cloud.bigquery.reservation.v1.BiReservation; +import com.google.cloud.bigquery.reservation.v1.CapacityCommitment; +import com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.CreateReservationRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.GetReservationRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListReservationsRequest; +import com.google.cloud.bigquery.reservation.v1.ListReservationsResponse; +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.SearchAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; +import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for BigQuery Reservation API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcReservationServiceStub extends ReservationServiceStub { + + private static final MethodDescriptor + deleteReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/DeleteReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteCapacityCommitmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/DeleteCapacityCommitment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteAssignmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/DeleteAssignment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAssignmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/CreateReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Reservation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listReservationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/ListReservations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListReservationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListReservationsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/GetReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Reservation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/UpdateReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Reservation.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse> + listCapacityCommitmentsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/ListCapacityCommitments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCapacityCommitmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCapacityCommitmentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getCapacityCommitmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/GetCapacityCommitment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CapacityCommitment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateCapacityCommitmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/UpdateCapacityCommitment") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CapacityCommitment.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + SplitCapacityCommitmentRequest, SplitCapacityCommitmentResponse> + splitCapacityCommitmentMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/SplitCapacityCommitment") + .setRequestMarshaller( + ProtoUtils.marshaller(SplitCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SplitCapacityCommitmentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + mergeCapacityCommitmentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/MergeCapacityCommitments") + .setRequestMarshaller( + ProtoUtils.marshaller(MergeCapacityCommitmentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CapacityCommitment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createAssignmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/CreateAssignment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAssignmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Assignment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listAssignmentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/ListAssignments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAssignmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAssignmentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + searchAssignmentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/SearchAssignments") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchAssignmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchAssignmentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + moveAssignmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/MoveAssignment") + .setRequestMarshaller( + ProtoUtils.marshaller(MoveAssignmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Assignment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getBiReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/GetBiReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetBiReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BiReservation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateBiReservationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.reservation.v1.ReservationService/UpdateBiReservation") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateBiReservationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BiReservation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable deleteReservationCallable; + private final UnaryCallable + deleteCapacityCommitmentCallable; + private final UnaryCallable deleteAssignmentCallable; + private final UnaryCallable createReservationCallable; + private final UnaryCallable + listReservationsCallable; + private final UnaryCallable + listReservationsPagedCallable; + private final UnaryCallable getReservationCallable; + private final UnaryCallable updateReservationCallable; + private final UnaryCallable + listCapacityCommitmentsCallable; + private final UnaryCallable + listCapacityCommitmentsPagedCallable; + private final UnaryCallable + getCapacityCommitmentCallable; + private final UnaryCallable + updateCapacityCommitmentCallable; + private final UnaryCallable + splitCapacityCommitmentCallable; + private final UnaryCallable + mergeCapacityCommitmentsCallable; + private final UnaryCallable createAssignmentCallable; + private final UnaryCallable + listAssignmentsCallable; + private final UnaryCallable + listAssignmentsPagedCallable; + private final UnaryCallable + searchAssignmentsCallable; + private final UnaryCallable + searchAssignmentsPagedCallable; + private final UnaryCallable moveAssignmentCallable; + private final UnaryCallable getBiReservationCallable; + private final UnaryCallable + updateBiReservationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcReservationServiceStub create(ReservationServiceStubSettings settings) + throws IOException { + return new GrpcReservationServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcReservationServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcReservationServiceStub( + ReservationServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcReservationServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcReservationServiceStub( + ReservationServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcReservationServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcReservationServiceStub( + ReservationServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcReservationServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcReservationServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcReservationServiceStub( + ReservationServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings deleteReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteCapacityCommitmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCapacityCommitmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteCapacityCommitmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteAssignmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAssignmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteAssignmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listReservationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReservationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListReservationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "reservation.name", String.valueOf(request.getReservation().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listCapacityCommitmentsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listCapacityCommitmentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCapacityCommitmentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getCapacityCommitmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCapacityCommitmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetCapacityCommitmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateCapacityCommitmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCapacityCommitmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateCapacityCommitmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "capacity_commitment.name", + String.valueOf(request.getCapacityCommitment().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + splitCapacityCommitmentTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(splitCapacityCommitmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SplitCapacityCommitmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + mergeCapacityCommitmentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(mergeCapacityCommitmentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MergeCapacityCommitmentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createAssignmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAssignmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateAssignmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listAssignmentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAssignmentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAssignmentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + searchAssignmentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchAssignmentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SearchAssignmentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings moveAssignmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(moveAssignmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MoveAssignmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBiReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBiReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBiReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateBiReservationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBiReservationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBiReservationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "bi_reservation.name", + String.valueOf(request.getBiReservation().getName())); + return params.build(); + } + }) + .build(); + + this.deleteReservationCallable = + callableFactory.createUnaryCallable( + deleteReservationTransportSettings, + settings.deleteReservationSettings(), + clientContext); + this.deleteCapacityCommitmentCallable = + callableFactory.createUnaryCallable( + deleteCapacityCommitmentTransportSettings, + settings.deleteCapacityCommitmentSettings(), + clientContext); + this.deleteAssignmentCallable = + callableFactory.createUnaryCallable( + deleteAssignmentTransportSettings, settings.deleteAssignmentSettings(), clientContext); + this.createReservationCallable = + callableFactory.createUnaryCallable( + createReservationTransportSettings, + settings.createReservationSettings(), + clientContext); + this.listReservationsCallable = + callableFactory.createUnaryCallable( + listReservationsTransportSettings, settings.listReservationsSettings(), clientContext); + this.listReservationsPagedCallable = + callableFactory.createPagedCallable( + listReservationsTransportSettings, settings.listReservationsSettings(), clientContext); + this.getReservationCallable = + callableFactory.createUnaryCallable( + getReservationTransportSettings, settings.getReservationSettings(), clientContext); + this.updateReservationCallable = + callableFactory.createUnaryCallable( + updateReservationTransportSettings, + settings.updateReservationSettings(), + clientContext); + this.listCapacityCommitmentsCallable = + callableFactory.createUnaryCallable( + listCapacityCommitmentsTransportSettings, + settings.listCapacityCommitmentsSettings(), + clientContext); + this.listCapacityCommitmentsPagedCallable = + callableFactory.createPagedCallable( + listCapacityCommitmentsTransportSettings, + settings.listCapacityCommitmentsSettings(), + clientContext); + this.getCapacityCommitmentCallable = + callableFactory.createUnaryCallable( + getCapacityCommitmentTransportSettings, + settings.getCapacityCommitmentSettings(), + clientContext); + this.updateCapacityCommitmentCallable = + callableFactory.createUnaryCallable( + updateCapacityCommitmentTransportSettings, + settings.updateCapacityCommitmentSettings(), + clientContext); + this.splitCapacityCommitmentCallable = + callableFactory.createUnaryCallable( + splitCapacityCommitmentTransportSettings, + settings.splitCapacityCommitmentSettings(), + clientContext); + this.mergeCapacityCommitmentsCallable = + callableFactory.createUnaryCallable( + mergeCapacityCommitmentsTransportSettings, + settings.mergeCapacityCommitmentsSettings(), + clientContext); + this.createAssignmentCallable = + callableFactory.createUnaryCallable( + createAssignmentTransportSettings, settings.createAssignmentSettings(), clientContext); + this.listAssignmentsCallable = + callableFactory.createUnaryCallable( + listAssignmentsTransportSettings, settings.listAssignmentsSettings(), clientContext); + this.listAssignmentsPagedCallable = + callableFactory.createPagedCallable( + listAssignmentsTransportSettings, settings.listAssignmentsSettings(), clientContext); + this.searchAssignmentsCallable = + callableFactory.createUnaryCallable( + searchAssignmentsTransportSettings, + settings.searchAssignmentsSettings(), + clientContext); + this.searchAssignmentsPagedCallable = + callableFactory.createPagedCallable( + searchAssignmentsTransportSettings, + settings.searchAssignmentsSettings(), + clientContext); + this.moveAssignmentCallable = + callableFactory.createUnaryCallable( + moveAssignmentTransportSettings, settings.moveAssignmentSettings(), clientContext); + this.getBiReservationCallable = + callableFactory.createUnaryCallable( + getBiReservationTransportSettings, settings.getBiReservationSettings(), clientContext); + this.updateBiReservationCallable = + callableFactory.createUnaryCallable( + updateBiReservationTransportSettings, + settings.updateBiReservationSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable deleteReservationCallable() { + return deleteReservationCallable; + } + + public UnaryCallable deleteCapacityCommitmentCallable() { + return deleteCapacityCommitmentCallable; + } + + public UnaryCallable deleteAssignmentCallable() { + return deleteAssignmentCallable; + } + + public UnaryCallable createReservationCallable() { + return createReservationCallable; + } + + public UnaryCallable + listReservationsPagedCallable() { + return listReservationsPagedCallable; + } + + public UnaryCallable + listReservationsCallable() { + return listReservationsCallable; + } + + public UnaryCallable getReservationCallable() { + return getReservationCallable; + } + + public UnaryCallable updateReservationCallable() { + return updateReservationCallable; + } + + public UnaryCallable + listCapacityCommitmentsPagedCallable() { + return listCapacityCommitmentsPagedCallable; + } + + public UnaryCallable + listCapacityCommitmentsCallable() { + return listCapacityCommitmentsCallable; + } + + public UnaryCallable + getCapacityCommitmentCallable() { + return getCapacityCommitmentCallable; + } + + public UnaryCallable + updateCapacityCommitmentCallable() { + return updateCapacityCommitmentCallable; + } + + public UnaryCallable + splitCapacityCommitmentCallable() { + return splitCapacityCommitmentCallable; + } + + public UnaryCallable + mergeCapacityCommitmentsCallable() { + return mergeCapacityCommitmentsCallable; + } + + public UnaryCallable createAssignmentCallable() { + return createAssignmentCallable; + } + + public UnaryCallable + listAssignmentsPagedCallable() { + return listAssignmentsPagedCallable; + } + + public UnaryCallable listAssignmentsCallable() { + return listAssignmentsCallable; + } + + public UnaryCallable + searchAssignmentsPagedCallable() { + return searchAssignmentsPagedCallable; + } + + public UnaryCallable + searchAssignmentsCallable() { + return searchAssignmentsCallable; + } + + public UnaryCallable moveAssignmentCallable() { + return moveAssignmentCallable; + } + + public UnaryCallable getBiReservationCallable() { + return getBiReservationCallable; + } + + public UnaryCallable updateBiReservationCallable() { + return updateBiReservationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java new file mode 100644 index 00000000..87ff4453 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStub.java @@ -0,0 +1,168 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1.stub; + +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.SearchAssignmentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.reservation.v1.Assignment; +import com.google.cloud.bigquery.reservation.v1.BiReservation; +import com.google.cloud.bigquery.reservation.v1.CapacityCommitment; +import com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.CreateReservationRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.GetReservationRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListReservationsRequest; +import com.google.cloud.bigquery.reservation.v1.ListReservationsResponse; +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.SearchAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; +import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for BigQuery Reservation API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ReservationServiceStub implements BackgroundResource { + + public UnaryCallable deleteReservationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReservationCallable()"); + } + + public UnaryCallable deleteCapacityCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCapacityCommitmentCallable()"); + } + + public UnaryCallable deleteAssignmentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAssignmentCallable()"); + } + + public UnaryCallable createReservationCallable() { + throw new UnsupportedOperationException("Not implemented: createReservationCallable()"); + } + + public UnaryCallable + listReservationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReservationsPagedCallable()"); + } + + public UnaryCallable + listReservationsCallable() { + throw new UnsupportedOperationException("Not implemented: listReservationsCallable()"); + } + + public UnaryCallable getReservationCallable() { + throw new UnsupportedOperationException("Not implemented: getReservationCallable()"); + } + + public UnaryCallable updateReservationCallable() { + throw new UnsupportedOperationException("Not implemented: updateReservationCallable()"); + } + + public UnaryCallable + listCapacityCommitmentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listCapacityCommitmentsPagedCallable()"); + } + + public UnaryCallable + listCapacityCommitmentsCallable() { + throw new UnsupportedOperationException("Not implemented: listCapacityCommitmentsCallable()"); + } + + public UnaryCallable + getCapacityCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: getCapacityCommitmentCallable()"); + } + + public UnaryCallable + updateCapacityCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: updateCapacityCommitmentCallable()"); + } + + public UnaryCallable + splitCapacityCommitmentCallable() { + throw new UnsupportedOperationException("Not implemented: splitCapacityCommitmentCallable()"); + } + + public UnaryCallable + mergeCapacityCommitmentsCallable() { + throw new UnsupportedOperationException("Not implemented: mergeCapacityCommitmentsCallable()"); + } + + public UnaryCallable createAssignmentCallable() { + throw new UnsupportedOperationException("Not implemented: createAssignmentCallable()"); + } + + public UnaryCallable + listAssignmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAssignmentsPagedCallable()"); + } + + public UnaryCallable listAssignmentsCallable() { + throw new UnsupportedOperationException("Not implemented: listAssignmentsCallable()"); + } + + public UnaryCallable + searchAssignmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchAssignmentsPagedCallable()"); + } + + public UnaryCallable + searchAssignmentsCallable() { + throw new UnsupportedOperationException("Not implemented: searchAssignmentsCallable()"); + } + + public UnaryCallable moveAssignmentCallable() { + throw new UnsupportedOperationException("Not implemented: moveAssignmentCallable()"); + } + + public UnaryCallable getBiReservationCallable() { + throw new UnsupportedOperationException("Not implemented: getBiReservationCallable()"); + } + + public UnaryCallable updateBiReservationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBiReservationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java new file mode 100644 index 00000000..891b6bdb --- /dev/null +++ b/google-cloud-bigquery-reservation/src/main/java/com/google/cloud/bigquery/reservation/v1/stub/ReservationServiceStubSettings.java @@ -0,0 +1,1033 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1.stub; + +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.SearchAssignmentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.reservation.v1.Assignment; +import com.google.cloud.bigquery.reservation.v1.BiReservation; +import com.google.cloud.bigquery.reservation.v1.CapacityCommitment; +import com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.CreateReservationRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.GetReservationRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; +import com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; +import com.google.cloud.bigquery.reservation.v1.ListReservationsRequest; +import com.google.cloud.bigquery.reservation.v1.ListReservationsResponse; +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.SearchAssignmentsRequest; +import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; +import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; +import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ReservationServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryreservation.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of deleteReservation to 30 seconds: + * + *

+ * 
+ * ReservationServiceStubSettings.Builder reservationServiceSettingsBuilder =
+ *     ReservationServiceStubSettings.newBuilder();
+ * reservationServiceSettingsBuilder
+ *     .deleteReservationSettings()
+ *     .setRetrySettings(
+ *         reservationServiceSettingsBuilder.deleteReservationSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ReservationServiceStubSettings reservationServiceSettings = reservationServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ReservationServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final UnaryCallSettings deleteReservationSettings; + private final UnaryCallSettings + deleteCapacityCommitmentSettings; + private final UnaryCallSettings deleteAssignmentSettings; + private final UnaryCallSettings createReservationSettings; + private final PagedCallSettings< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings; + private final UnaryCallSettings getReservationSettings; + private final UnaryCallSettings updateReservationSettings; + private final PagedCallSettings< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings; + private final UnaryCallSettings + getCapacityCommitmentSettings; + private final UnaryCallSettings + updateCapacityCommitmentSettings; + private final UnaryCallSettings + splitCapacityCommitmentSettings; + private final UnaryCallSettings + mergeCapacityCommitmentsSettings; + private final UnaryCallSettings createAssignmentSettings; + private final PagedCallSettings< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings; + private final PagedCallSettings< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings; + private final UnaryCallSettings moveAssignmentSettings; + private final UnaryCallSettings getBiReservationSettings; + private final UnaryCallSettings + updateBiReservationSettings; + + /** Returns the object with the settings used for calls to deleteReservation. */ + public UnaryCallSettings deleteReservationSettings() { + return deleteReservationSettings; + } + + /** Returns the object with the settings used for calls to deleteCapacityCommitment. */ + public UnaryCallSettings + deleteCapacityCommitmentSettings() { + return deleteCapacityCommitmentSettings; + } + + /** Returns the object with the settings used for calls to deleteAssignment. */ + public UnaryCallSettings deleteAssignmentSettings() { + return deleteAssignmentSettings; + } + + /** Returns the object with the settings used for calls to createReservation. */ + public UnaryCallSettings createReservationSettings() { + return createReservationSettings; + } + + /** Returns the object with the settings used for calls to listReservations. */ + public PagedCallSettings< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings() { + return listReservationsSettings; + } + + /** Returns the object with the settings used for calls to getReservation. */ + public UnaryCallSettings getReservationSettings() { + return getReservationSettings; + } + + /** Returns the object with the settings used for calls to updateReservation. */ + public UnaryCallSettings updateReservationSettings() { + return updateReservationSettings; + } + + /** Returns the object with the settings used for calls to listCapacityCommitments. */ + public PagedCallSettings< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings() { + return listCapacityCommitmentsSettings; + } + + /** Returns the object with the settings used for calls to getCapacityCommitment. */ + public UnaryCallSettings + getCapacityCommitmentSettings() { + return getCapacityCommitmentSettings; + } + + /** Returns the object with the settings used for calls to updateCapacityCommitment. */ + public UnaryCallSettings + updateCapacityCommitmentSettings() { + return updateCapacityCommitmentSettings; + } + + /** Returns the object with the settings used for calls to splitCapacityCommitment. */ + public UnaryCallSettings + splitCapacityCommitmentSettings() { + return splitCapacityCommitmentSettings; + } + + /** Returns the object with the settings used for calls to mergeCapacityCommitments. */ + public UnaryCallSettings + mergeCapacityCommitmentsSettings() { + return mergeCapacityCommitmentsSettings; + } + + /** Returns the object with the settings used for calls to createAssignment. */ + public UnaryCallSettings createAssignmentSettings() { + return createAssignmentSettings; + } + + /** Returns the object with the settings used for calls to listAssignments. */ + public PagedCallSettings< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings() { + return listAssignmentsSettings; + } + + /** Returns the object with the settings used for calls to searchAssignments. */ + public PagedCallSettings< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings() { + return searchAssignmentsSettings; + } + + /** Returns the object with the settings used for calls to moveAssignment. */ + public UnaryCallSettings moveAssignmentSettings() { + return moveAssignmentSettings; + } + + /** Returns the object with the settings used for calls to getBiReservation. */ + public UnaryCallSettings getBiReservationSettings() { + return getBiReservationSettings; + } + + /** Returns the object with the settings used for calls to updateBiReservation. */ + public UnaryCallSettings + updateBiReservationSettings() { + return updateBiReservationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ReservationServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcReservationServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "bigqueryreservation.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ReservationServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ReservationServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteReservationSettings = settingsBuilder.deleteReservationSettings().build(); + deleteCapacityCommitmentSettings = settingsBuilder.deleteCapacityCommitmentSettings().build(); + deleteAssignmentSettings = settingsBuilder.deleteAssignmentSettings().build(); + createReservationSettings = settingsBuilder.createReservationSettings().build(); + listReservationsSettings = settingsBuilder.listReservationsSettings().build(); + getReservationSettings = settingsBuilder.getReservationSettings().build(); + updateReservationSettings = settingsBuilder.updateReservationSettings().build(); + listCapacityCommitmentsSettings = settingsBuilder.listCapacityCommitmentsSettings().build(); + getCapacityCommitmentSettings = settingsBuilder.getCapacityCommitmentSettings().build(); + updateCapacityCommitmentSettings = settingsBuilder.updateCapacityCommitmentSettings().build(); + splitCapacityCommitmentSettings = settingsBuilder.splitCapacityCommitmentSettings().build(); + mergeCapacityCommitmentsSettings = settingsBuilder.mergeCapacityCommitmentsSettings().build(); + createAssignmentSettings = settingsBuilder.createAssignmentSettings().build(); + listAssignmentsSettings = settingsBuilder.listAssignmentsSettings().build(); + searchAssignmentsSettings = settingsBuilder.searchAssignmentsSettings().build(); + moveAssignmentSettings = settingsBuilder.moveAssignmentSettings().build(); + getBiReservationSettings = settingsBuilder.getBiReservationSettings().build(); + updateBiReservationSettings = settingsBuilder.updateBiReservationSettings().build(); + } + + private static final PagedListDescriptor< + ListReservationsRequest, ListReservationsResponse, Reservation> + LIST_RESERVATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListReservationsRequest, ListReservationsResponse, Reservation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReservationsRequest injectToken( + ListReservationsRequest payload, String token) { + return ListReservationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReservationsRequest injectPageSize( + ListReservationsRequest payload, int pageSize) { + return ListReservationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReservationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReservationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReservationsResponse payload) { + return payload.getReservationsList() != null + ? payload.getReservationsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse, CapacityCommitment> + LIST_CAPACITY_COMMITMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + CapacityCommitment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCapacityCommitmentsRequest injectToken( + ListCapacityCommitmentsRequest payload, String token) { + return ListCapacityCommitmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCapacityCommitmentsRequest injectPageSize( + ListCapacityCommitmentsRequest payload, int pageSize) { + return ListCapacityCommitmentsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListCapacityCommitmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCapacityCommitmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListCapacityCommitmentsResponse payload) { + return payload.getCapacityCommitmentsList() != null + ? payload.getCapacityCommitmentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListAssignmentsRequest, ListAssignmentsResponse, Assignment> + LIST_ASSIGNMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAssignmentsRequest injectToken( + ListAssignmentsRequest payload, String token) { + return ListAssignmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAssignmentsRequest injectPageSize( + ListAssignmentsRequest payload, int pageSize) { + return ListAssignmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAssignmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAssignmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAssignmentsResponse payload) { + return payload.getAssignmentsList() != null + ? payload.getAssignmentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + SearchAssignmentsRequest, SearchAssignmentsResponse, Assignment> + SEARCH_ASSIGNMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + SearchAssignmentsRequest, SearchAssignmentsResponse, Assignment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchAssignmentsRequest injectToken( + SearchAssignmentsRequest payload, String token) { + return SearchAssignmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchAssignmentsRequest injectPageSize( + SearchAssignmentsRequest payload, int pageSize) { + return SearchAssignmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchAssignmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchAssignmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchAssignmentsResponse payload) { + return payload.getAssignmentsList() != null + ? payload.getAssignmentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + LIST_RESERVATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReservationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_RESERVATIONS_PAGE_STR_DESC, request, context); + return ListReservationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + LIST_CAPACITY_COMMITMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListCapacityCommitmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + CapacityCommitment> + pageContext = + PageContext.create( + callable, LIST_CAPACITY_COMMITMENTS_PAGE_STR_DESC, request, context); + return ListCapacityCommitmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + LIST_ASSIGNMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAssignmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ASSIGNMENTS_PAGE_STR_DESC, request, context); + return ListAssignmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + SEARCH_ASSIGNMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchAssignmentsRequest, + SearchAssignmentsResponse, + SearchAssignmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchAssignmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, SEARCH_ASSIGNMENTS_PAGE_STR_DESC, request, context); + return SearchAssignmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ReservationServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + deleteReservationSettings; + private final UnaryCallSettings.Builder + deleteCapacityCommitmentSettings; + private final UnaryCallSettings.Builder + deleteAssignmentSettings; + private final UnaryCallSettings.Builder + createReservationSettings; + private final PagedCallSettings.Builder< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings; + private final UnaryCallSettings.Builder + getReservationSettings; + private final UnaryCallSettings.Builder + updateReservationSettings; + private final PagedCallSettings.Builder< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings; + private final UnaryCallSettings.Builder + getCapacityCommitmentSettings; + private final UnaryCallSettings.Builder + updateCapacityCommitmentSettings; + private final UnaryCallSettings.Builder< + SplitCapacityCommitmentRequest, SplitCapacityCommitmentResponse> + splitCapacityCommitmentSettings; + private final UnaryCallSettings.Builder + mergeCapacityCommitmentsSettings; + private final UnaryCallSettings.Builder + createAssignmentSettings; + private final PagedCallSettings.Builder< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings; + private final PagedCallSettings.Builder< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings; + private final UnaryCallSettings.Builder + moveAssignmentSettings; + private final UnaryCallSettings.Builder + getBiReservationSettings; + private final UnaryCallSettings.Builder + updateBiReservationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteCapacityCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listReservationsSettings = PagedCallSettings.newBuilder(LIST_RESERVATIONS_PAGE_STR_FACT); + + getReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listCapacityCommitmentsSettings = + PagedCallSettings.newBuilder(LIST_CAPACITY_COMMITMENTS_PAGE_STR_FACT); + + getCapacityCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateCapacityCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + splitCapacityCommitmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + mergeCapacityCommitmentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listAssignmentsSettings = PagedCallSettings.newBuilder(LIST_ASSIGNMENTS_PAGE_STR_FACT); + + searchAssignmentsSettings = PagedCallSettings.newBuilder(SEARCH_ASSIGNMENTS_PAGE_STR_FACT); + + moveAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteReservationSettings, + deleteCapacityCommitmentSettings, + deleteAssignmentSettings, + createReservationSettings, + listReservationsSettings, + getReservationSettings, + updateReservationSettings, + listCapacityCommitmentsSettings, + getCapacityCommitmentSettings, + updateCapacityCommitmentSettings, + splitCapacityCommitmentSettings, + mergeCapacityCommitmentsSettings, + createAssignmentSettings, + listAssignmentsSettings, + searchAssignmentsSettings, + moveAssignmentSettings, + getBiReservationSettings, + updateBiReservationSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .deleteReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteCapacityCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteAssignmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listReservationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listCapacityCommitmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getCapacityCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateCapacityCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .splitCapacityCommitmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .mergeCapacityCommitmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createAssignmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listAssignmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .searchAssignmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .moveAssignmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getBiReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateBiReservationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ReservationServiceStubSettings settings) { + super(settings); + + deleteReservationSettings = settings.deleteReservationSettings.toBuilder(); + deleteCapacityCommitmentSettings = settings.deleteCapacityCommitmentSettings.toBuilder(); + deleteAssignmentSettings = settings.deleteAssignmentSettings.toBuilder(); + createReservationSettings = settings.createReservationSettings.toBuilder(); + listReservationsSettings = settings.listReservationsSettings.toBuilder(); + getReservationSettings = settings.getReservationSettings.toBuilder(); + updateReservationSettings = settings.updateReservationSettings.toBuilder(); + listCapacityCommitmentsSettings = settings.listCapacityCommitmentsSettings.toBuilder(); + getCapacityCommitmentSettings = settings.getCapacityCommitmentSettings.toBuilder(); + updateCapacityCommitmentSettings = settings.updateCapacityCommitmentSettings.toBuilder(); + splitCapacityCommitmentSettings = settings.splitCapacityCommitmentSettings.toBuilder(); + mergeCapacityCommitmentsSettings = settings.mergeCapacityCommitmentsSettings.toBuilder(); + createAssignmentSettings = settings.createAssignmentSettings.toBuilder(); + listAssignmentsSettings = settings.listAssignmentsSettings.toBuilder(); + searchAssignmentsSettings = settings.searchAssignmentsSettings.toBuilder(); + moveAssignmentSettings = settings.moveAssignmentSettings.toBuilder(); + getBiReservationSettings = settings.getBiReservationSettings.toBuilder(); + updateBiReservationSettings = settings.updateBiReservationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteReservationSettings, + deleteCapacityCommitmentSettings, + deleteAssignmentSettings, + createReservationSettings, + listReservationsSettings, + getReservationSettings, + updateReservationSettings, + listCapacityCommitmentsSettings, + getCapacityCommitmentSettings, + updateCapacityCommitmentSettings, + splitCapacityCommitmentSettings, + mergeCapacityCommitmentsSettings, + createAssignmentSettings, + listAssignmentsSettings, + searchAssignmentsSettings, + moveAssignmentSettings, + getBiReservationSettings, + updateBiReservationSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to deleteReservation. */ + public UnaryCallSettings.Builder deleteReservationSettings() { + return deleteReservationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCapacityCommitment. */ + public UnaryCallSettings.Builder + deleteCapacityCommitmentSettings() { + return deleteCapacityCommitmentSettings; + } + + /** Returns the builder for the settings used for calls to deleteAssignment. */ + public UnaryCallSettings.Builder deleteAssignmentSettings() { + return deleteAssignmentSettings; + } + + /** Returns the builder for the settings used for calls to createReservation. */ + public UnaryCallSettings.Builder + createReservationSettings() { + return createReservationSettings; + } + + /** Returns the builder for the settings used for calls to listReservations. */ + public PagedCallSettings.Builder< + ListReservationsRequest, ListReservationsResponse, ListReservationsPagedResponse> + listReservationsSettings() { + return listReservationsSettings; + } + + /** Returns the builder for the settings used for calls to getReservation. */ + public UnaryCallSettings.Builder getReservationSettings() { + return getReservationSettings; + } + + /** Returns the builder for the settings used for calls to updateReservation. */ + public UnaryCallSettings.Builder + updateReservationSettings() { + return updateReservationSettings; + } + + /** Returns the builder for the settings used for calls to listCapacityCommitments. */ + public PagedCallSettings.Builder< + ListCapacityCommitmentsRequest, + ListCapacityCommitmentsResponse, + ListCapacityCommitmentsPagedResponse> + listCapacityCommitmentsSettings() { + return listCapacityCommitmentsSettings; + } + + /** Returns the builder for the settings used for calls to getCapacityCommitment. */ + public UnaryCallSettings.Builder + getCapacityCommitmentSettings() { + return getCapacityCommitmentSettings; + } + + /** Returns the builder for the settings used for calls to updateCapacityCommitment. */ + public UnaryCallSettings.Builder + updateCapacityCommitmentSettings() { + return updateCapacityCommitmentSettings; + } + + /** Returns the builder for the settings used for calls to splitCapacityCommitment. */ + public UnaryCallSettings.Builder< + SplitCapacityCommitmentRequest, SplitCapacityCommitmentResponse> + splitCapacityCommitmentSettings() { + return splitCapacityCommitmentSettings; + } + + /** Returns the builder for the settings used for calls to mergeCapacityCommitments. */ + public UnaryCallSettings.Builder + mergeCapacityCommitmentsSettings() { + return mergeCapacityCommitmentsSettings; + } + + /** Returns the builder for the settings used for calls to createAssignment. */ + public UnaryCallSettings.Builder + createAssignmentSettings() { + return createAssignmentSettings; + } + + /** Returns the builder for the settings used for calls to listAssignments. */ + public PagedCallSettings.Builder< + ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse> + listAssignmentsSettings() { + return listAssignmentsSettings; + } + + /** Returns the builder for the settings used for calls to searchAssignments. */ + public PagedCallSettings.Builder< + SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse> + searchAssignmentsSettings() { + return searchAssignmentsSettings; + } + + /** Returns the builder for the settings used for calls to moveAssignment. */ + public UnaryCallSettings.Builder moveAssignmentSettings() { + return moveAssignmentSettings; + } + + /** Returns the builder for the settings used for calls to getBiReservation. */ + public UnaryCallSettings.Builder + getBiReservationSettings() { + return getBiReservationSettings; + } + + /** Returns the builder for the settings used for calls to updateBiReservation. */ + public UnaryCallSettings.Builder + updateBiReservationSettings() { + return updateBiReservationSettings; + } + + @Override + public ReservationServiceStubSettings build() throws IOException { + return new ReservationServiceStubSettings(this); + } + } +} diff --git a/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationService.java b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationService.java new file mode 100644 index 00000000..124f3fc8 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationService.java @@ -0,0 +1,57 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockReservationService implements MockGrpcService { + private final MockReservationServiceImpl serviceImpl; + + public MockReservationService() { + serviceImpl = new MockReservationServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java new file mode 100644 index 00000000..f8032606 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/MockReservationServiceImpl.java @@ -0,0 +1,334 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.reservation.v1.ReservationServiceGrpc.ReservationServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockReservationServiceImpl extends ReservationServiceImplBase { + private List requests; + private Queue responses; + + public MockReservationServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createReservation( + CreateReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Reservation) { + requests.add(request); + responseObserver.onNext((Reservation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listReservations( + ListReservationsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListReservationsResponse) { + requests.add(request); + responseObserver.onNext((ListReservationsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getReservation( + GetReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Reservation) { + requests.add(request); + responseObserver.onNext((Reservation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteReservation( + DeleteReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateReservation( + UpdateReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Reservation) { + requests.add(request); + responseObserver.onNext((Reservation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listCapacityCommitments( + ListCapacityCommitmentsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListCapacityCommitmentsResponse) { + requests.add(request); + responseObserver.onNext((ListCapacityCommitmentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getCapacityCommitment( + GetCapacityCommitmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CapacityCommitment) { + requests.add(request); + responseObserver.onNext((CapacityCommitment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteCapacityCommitment( + DeleteCapacityCommitmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateCapacityCommitment( + UpdateCapacityCommitmentRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CapacityCommitment) { + requests.add(request); + responseObserver.onNext((CapacityCommitment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void splitCapacityCommitment( + SplitCapacityCommitmentRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SplitCapacityCommitmentResponse) { + requests.add(request); + responseObserver.onNext((SplitCapacityCommitmentResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void mergeCapacityCommitments( + MergeCapacityCommitmentsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CapacityCommitment) { + requests.add(request); + responseObserver.onNext((CapacityCommitment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createAssignment( + CreateAssignmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Assignment) { + requests.add(request); + responseObserver.onNext((Assignment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listAssignments( + ListAssignmentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAssignmentsResponse) { + requests.add(request); + responseObserver.onNext((ListAssignmentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteAssignment( + DeleteAssignmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void searchAssignments( + SearchAssignmentsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SearchAssignmentsResponse) { + requests.add(request); + responseObserver.onNext((SearchAssignmentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void moveAssignment( + MoveAssignmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Assignment) { + requests.add(request); + responseObserver.onNext((Assignment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getBiReservation( + GetBiReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BiReservation) { + requests.add(request); + responseObserver.onNext((BiReservation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateBiReservation( + UpdateBiReservationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BiReservation) { + requests.add(request); + responseObserver.onNext((BiReservation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java new file mode 100644 index 00000000..72d75d80 --- /dev/null +++ b/google-cloud-bigquery-reservation/src/test/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceClientTest.java @@ -0,0 +1,906 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +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.SearchAssignmentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ReservationServiceClientTest { + private static MockReservationService mockReservationService; + private static MockServiceHelper serviceHelper; + private ReservationServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockReservationService = new MockReservationService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockReservationService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ReservationServiceSettings settings = + ReservationServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ReservationServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteReservationTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockReservationService.addResponse(expectedResponse); + + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + client.deleteReservation(name); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReservationRequest actualRequest = (DeleteReservationRequest) actualRequests.get(0); + + Assert.assertEquals(name, ReservationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + client.deleteReservation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteCapacityCommitmentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockReservationService.addResponse(expectedResponse); + + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + + client.deleteCapacityCommitment(name); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCapacityCommitmentRequest actualRequest = + (DeleteCapacityCommitmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, CapacityCommitmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteCapacityCommitmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + + client.deleteCapacityCommitment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteAssignmentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockReservationService.addResponse(expectedResponse); + + AssignmentName name = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + + client.deleteAssignment(name); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAssignmentRequest actualRequest = (DeleteAssignmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AssignmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteAssignmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + AssignmentName name = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + + client.deleteAssignment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createReservationTest() { + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + long slotCapacity = 1516717605L; + boolean ignoreIdleSlots = false; + Reservation expectedResponse = + Reservation.newBuilder() + .setName(name.toString()) + .setSlotCapacity(slotCapacity) + .setIgnoreIdleSlots(ignoreIdleSlots) + .build(); + mockReservationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Reservation reservation = Reservation.newBuilder().build(); + String reservationId = "reservationId266209902"; + + Reservation actualResponse = client.createReservation(parent, reservation, reservationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReservationRequest actualRequest = (CreateReservationRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(reservation, actualRequest.getReservation()); + Assert.assertEquals(reservationId, actualRequest.getReservationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Reservation reservation = Reservation.newBuilder().build(); + String reservationId = "reservationId266209902"; + + client.createReservation(parent, reservation, reservationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listReservationsTest() { + String nextPageToken = ""; + Reservation reservationsElement = Reservation.newBuilder().build(); + List reservations = Arrays.asList(reservationsElement); + ListReservationsResponse expectedResponse = + ListReservationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllReservations(reservations) + .build(); + mockReservationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListReservationsPagedResponse pagedListResponse = client.listReservations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReservationsList().get(0), resources.get(0)); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReservationsRequest actualRequest = (ListReservationsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listReservationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listReservations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getReservationTest() { + ReservationName name2 = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + long slotCapacity = 1516717605L; + boolean ignoreIdleSlots = false; + Reservation expectedResponse = + Reservation.newBuilder() + .setName(name2.toString()) + .setSlotCapacity(slotCapacity) + .setIgnoreIdleSlots(ignoreIdleSlots) + .build(); + mockReservationService.addResponse(expectedResponse); + + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + Reservation actualResponse = client.getReservation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReservationRequest actualRequest = (GetReservationRequest) actualRequests.get(0); + + Assert.assertEquals(name, ReservationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + client.getReservation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateReservationTest() { + ReservationName name = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + long slotCapacity = 1516717605L; + boolean ignoreIdleSlots = false; + Reservation expectedResponse = + Reservation.newBuilder() + .setName(name.toString()) + .setSlotCapacity(slotCapacity) + .setIgnoreIdleSlots(ignoreIdleSlots) + .build(); + mockReservationService.addResponse(expectedResponse); + + Reservation reservation = Reservation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Reservation actualResponse = client.updateReservation(reservation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateReservationRequest actualRequest = (UpdateReservationRequest) actualRequests.get(0); + + Assert.assertEquals(reservation, actualRequest.getReservation()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + Reservation reservation = Reservation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateReservation(reservation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listCapacityCommitmentsTest() { + String nextPageToken = ""; + CapacityCommitment capacityCommitmentsElement = CapacityCommitment.newBuilder().build(); + List capacityCommitments = Arrays.asList(capacityCommitmentsElement); + ListCapacityCommitmentsResponse expectedResponse = + ListCapacityCommitmentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllCapacityCommitments(capacityCommitments) + .build(); + mockReservationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCapacityCommitmentsPagedResponse pagedListResponse = client.listCapacityCommitments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCapacityCommitmentsList().get(0), resources.get(0)); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCapacityCommitmentsRequest actualRequest = + (ListCapacityCommitmentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listCapacityCommitmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listCapacityCommitments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getCapacityCommitmentTest() { + CapacityCommitmentName name2 = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + long slotCount = 191518834L; + CapacityCommitment expectedResponse = + CapacityCommitment.newBuilder().setName(name2.toString()).setSlotCount(slotCount).build(); + mockReservationService.addResponse(expectedResponse); + + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + + CapacityCommitment actualResponse = client.getCapacityCommitment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCapacityCommitmentRequest actualRequest = + (GetCapacityCommitmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, CapacityCommitmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getCapacityCommitmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + + client.getCapacityCommitment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateCapacityCommitmentTest() { + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + long slotCount = 191518834L; + CapacityCommitment expectedResponse = + CapacityCommitment.newBuilder().setName(name.toString()).setSlotCount(slotCount).build(); + mockReservationService.addResponse(expectedResponse); + + CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CapacityCommitment actualResponse = + client.updateCapacityCommitment(capacityCommitment, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCapacityCommitmentRequest actualRequest = + (UpdateCapacityCommitmentRequest) actualRequests.get(0); + + Assert.assertEquals(capacityCommitment, actualRequest.getCapacityCommitment()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateCapacityCommitmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateCapacityCommitment(capacityCommitment, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void splitCapacityCommitmentTest() { + SplitCapacityCommitmentResponse expectedResponse = + SplitCapacityCommitmentResponse.newBuilder().build(); + mockReservationService.addResponse(expectedResponse); + + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + long slotCount = 191518834L; + + SplitCapacityCommitmentResponse actualResponse = + client.splitCapacityCommitment(name, slotCount); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SplitCapacityCommitmentRequest actualRequest = + (SplitCapacityCommitmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, CapacityCommitmentName.parse(actualRequest.getName())); + Assert.assertEquals(slotCount, actualRequest.getSlotCount()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void splitCapacityCommitmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + long slotCount = 191518834L; + + client.splitCapacityCommitment(name, slotCount); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void mergeCapacityCommitmentsTest() { + CapacityCommitmentName name = + CapacityCommitmentName.of("[PROJECT]", "[LOCATION]", "[CAPACITY_COMMITMENT]"); + long slotCount = 191518834L; + CapacityCommitment expectedResponse = + CapacityCommitment.newBuilder().setName(name.toString()).setSlotCount(slotCount).build(); + mockReservationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List capacityCommitmentIds = new ArrayList<>(); + + CapacityCommitment actualResponse = + client.mergeCapacityCommitments(parent, capacityCommitmentIds); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MergeCapacityCommitmentsRequest actualRequest = + (MergeCapacityCommitmentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(capacityCommitmentIds, actualRequest.getCapacityCommitmentIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void mergeCapacityCommitmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List capacityCommitmentIds = new ArrayList<>(); + + client.mergeCapacityCommitments(parent, capacityCommitmentIds); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createAssignmentTest() { + AssignmentName name = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + String assignee = "assignee-369881649"; + Assignment expectedResponse = + Assignment.newBuilder().setName(name.toString()).setAssignee(assignee).build(); + mockReservationService.addResponse(expectedResponse); + + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + Assignment assignment = Assignment.newBuilder().build(); + + Assignment actualResponse = client.createAssignment(parent, assignment); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAssignmentRequest actualRequest = (CreateAssignmentRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ReservationName.parse(actualRequest.getParent())); + Assert.assertEquals(assignment, actualRequest.getAssignment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createAssignmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + Assignment assignment = Assignment.newBuilder().build(); + + client.createAssignment(parent, assignment); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAssignmentsTest() { + String nextPageToken = ""; + Assignment assignmentsElement = Assignment.newBuilder().build(); + List assignments = Arrays.asList(assignmentsElement); + ListAssignmentsResponse expectedResponse = + ListAssignmentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllAssignments(assignments) + .build(); + mockReservationService.addResponse(expectedResponse); + + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + ListAssignmentsPagedResponse pagedListResponse = client.listAssignments(parent); + + 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()); + ListAssignmentsRequest actualRequest = (ListAssignmentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ReservationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listAssignmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + + client.listAssignments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void searchAssignmentsTest() { + String nextPageToken = ""; + Assignment assignmentsElement = Assignment.newBuilder().build(); + List assignments = Arrays.asList(assignmentsElement); + SearchAssignmentsResponse expectedResponse = + SearchAssignmentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllAssignments(assignments) + .build(); + mockReservationService.addResponse(expectedResponse); + + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + String query = "query107944136"; + + SearchAssignmentsPagedResponse pagedListResponse = client.searchAssignments(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()); + SearchAssignmentsRequest actualRequest = (SearchAssignmentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ReservationName.parse(actualRequest.getParent())); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void searchAssignmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]"); + String query = "query107944136"; + + client.searchAssignments(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveAssignmentTest() { + AssignmentName name2 = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + String assignee = "assignee-369881649"; + Assignment expectedResponse = + Assignment.newBuilder().setName(name2.toString()).setAssignee(assignee).build(); + mockReservationService.addResponse(expectedResponse); + + AssignmentName name = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + String destinationId = "destinationId912984812"; + + Assignment actualResponse = client.moveAssignment(name, destinationId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveAssignmentRequest actualRequest = (MoveAssignmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AssignmentName.parse(actualRequest.getName())); + Assert.assertEquals(destinationId, actualRequest.getDestinationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveAssignmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + AssignmentName name = + AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]"); + String destinationId = "destinationId912984812"; + + client.moveAssignment(name, destinationId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBiReservationTest() { + BiReservationName name2 = BiReservationName.of("[PROJECT]", "[LOCATION]"); + long size = 3530753L; + BiReservation expectedResponse = + BiReservation.newBuilder().setName(name2.toString()).setSize(size).build(); + mockReservationService.addResponse(expectedResponse); + + BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]"); + + BiReservation actualResponse = client.getBiReservation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBiReservationRequest actualRequest = (GetBiReservationRequest) actualRequests.get(0); + + Assert.assertEquals(name, BiReservationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBiReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]"); + + client.getBiReservation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBiReservationTest() { + BiReservationName name = BiReservationName.of("[PROJECT]", "[LOCATION]"); + long size = 3530753L; + BiReservation expectedResponse = + BiReservation.newBuilder().setName(name.toString()).setSize(size).build(); + mockReservationService.addResponse(expectedResponse); + + BiReservation biReservation = BiReservation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + BiReservation actualResponse = client.updateBiReservation(biReservation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockReservationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBiReservationRequest actualRequest = (UpdateBiReservationRequest) actualRequests.get(0); + + Assert.assertEquals(biReservation, actualRequest.getBiReservation()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBiReservationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockReservationService.addException(exception); + + try { + BiReservation biReservation = BiReservation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateBiReservation(biReservation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-bigqueryreservations-bom/pom.xml b/google-cloud-bigqueryreservations-bom/pom.xml new file mode 100644 index 00000000..ea5d8681 --- /dev/null +++ b/google-cloud-bigqueryreservations-bom/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigqueryreservations-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.5.0 + + + Google Cloud BigQuery Reservations BOM + https://github.com/googleapis/java-bigqueryreservations + + BOM for Cloud BigQuery Reservations + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-bigqueryreservations.git + scm:git:git@github.com:googleapis/java-bigqueryreservations.git + https://github.com/googleapis/java-bigqueryreservations + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-bigqueryreservations + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-bigqueryreservations/.flattened-pom.xml b/google-cloud-bigqueryreservations/.flattened-pom.xml new file mode 100644 index 00000000..7fbcbf62 --- /dev/null +++ b/google-cloud-bigqueryreservations/.flattened-pom.xml @@ -0,0 +1,834 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigqueryreservations + 0.0.1-SNAPSHOT + Google Cloud BigQuery Reservations + is about + https://github.com/googleapis/java-bigqueryreservations + + Google LLC + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/google-cloud-bigqueryreservations + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/google-cloud-bigqueryreservations + https://github.com/googleapis/java-bigqueryreservations/google-cloud-bigqueryreservations + + + GitHub Issues + https://github.com/googleapis/java-bigqueryreservations/issues + + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + + io.grpc + grpc-api + 1.28.1 + compile + + + grpc-context + io.grpc + + + error_prone_annotations + com.google.errorprone + + + jsr305 + com.google.code.findbugs + + + animal-sniffer-annotations + org.codehaus.mojo + + + guava + com.google.guava + + + false + + + io.grpc + grpc-context + 1.28.1 + compile + false + + + com.google.errorprone + error_prone_annotations + 2.3.4 + compile + false + + + com.google.code.findbugs + jsr305 + 3.0.2 + compile + false + + + org.codehaus.mojo + animal-sniffer-annotations + 1.18 + compile + false + + + io.grpc + grpc-stub + 1.28.1 + compile + + + grpc-api + io.grpc + + + false + + + io.grpc + grpc-protobuf + 1.28.1 + compile + + + grpc-api + io.grpc + + + protobuf-java + com.google.protobuf + + + guava + com.google.guava + + + proto-google-common-protos + com.google.api.grpc + + + grpc-protobuf-lite + io.grpc + + + false + + + io.grpc + grpc-protobuf-lite + 1.28.1 + compile + + + grpc-api + io.grpc + + + protobuf-javalite + com.google.protobuf + + + guava + com.google.guava + + + false + + + com.google.api + api-common + 1.9.0 + compile + + + jsr305 + com.google.code.findbugs + + + guava + com.google.guava + + + javax.annotation-api + javax.annotation + + + auto-value-annotations + com.google.auto.value + + + false + + + javax.annotation + javax.annotation-api + 1.3.2 + compile + false + + + com.google.auto.value + auto-value-annotations + 1.7 + compile + false + + + com.google.protobuf + protobuf-java + 3.11.4 + compile + false + + + com.google.api.grpc + proto-google-common-protos + 1.17.0 + compile + + + protobuf-java + com.google.protobuf + + + false + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + compile + + + protobuf-java + com.google.protobuf + + + proto-google-common-protos + com.google.api.grpc + + + api-common + com.google.api + + + guava + com.google.guava + + + false + + + com.google.guava + guava + 29.0-android + compile + + + failureaccess + com.google.guava + + + listenablefuture + com.google.guava + + + jsr305 + com.google.code.findbugs + + + checker-compat-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + j2objc-annotations + com.google.j2objc + + + srczip + jdk + + + false + + + com.google.guava + failureaccess + 1.0.1 + compile + false + + + com.google.guava + listenablefuture + 9999.0-empty-to-avoid-conflict-with-guava + compile + false + + + org.checkerframework + checker-compat-qual + 2.5.5 + compile + false + + + com.google.j2objc + j2objc-annotations + 1.3 + compile + false + + + com.google.api + gax + 1.56.0 + compile + + + guava + com.google.guava + + + jsr305 + com.google.code.findbugs + + + threetenbp + org.threeten + + + google-auth-library-oauth2-http + com.google.auth + + + api-common + com.google.api + + + opencensus-api + io.opencensus + + + false + + + com.google.auth + google-auth-library-oauth2-http + 0.20.0 + compile + + + auto-value-annotations + com.google.auto.value + + + jsr305 + com.google.code.findbugs + + + google-auth-library-credentials + com.google.auth + + + google-http-client + com.google.http-client + + + google-http-client-jackson2 + com.google.http-client + + + guava + com.google.guava + + + false + + + com.google.http-client + google-http-client + 1.34.2 + compile + + + httpclient + org.apache.httpcomponents + + + httpcore + org.apache.httpcomponents + + + jsr305 + com.google.code.findbugs + + + guava + com.google.guava + + + j2objc-annotations + com.google.j2objc + + + opencensus-api + io.opencensus + + + opencensus-contrib-http-util + io.opencensus + + + false + + + org.apache.httpcomponents + httpclient + 4.5.11 + compile + + + httpcore + org.apache.httpcomponents + + + commons-logging + commons-logging + + + commons-codec + commons-codec + + + false + + + commons-logging + commons-logging + 1.2 + compile + + + log4j + log4j + + + logkit + logkit + + + avalon-framework + avalon-framework + + + servlet-api + javax.servlet + + + false + + + commons-codec + commons-codec + 1.11 + compile + false + + + org.apache.httpcomponents + httpcore + 4.4.13 + compile + false + + + io.opencensus + opencensus-contrib-http-util + 0.24.0 + compile + + + opencensus-api + io.opencensus + + + guava + com.google.guava + + + false + + + com.google.http-client + google-http-client-jackson2 + 1.34.2 + compile + + + google-http-client + com.google.http-client + + + jackson-core + com.fasterxml.jackson.core + + + false + + + com.fasterxml.jackson.core + jackson-core + 2.10.2 + compile + false + + + io.opencensus + opencensus-api + 0.24.0 + compile + + + grpc-context + io.grpc + + + false + + + com.google.api + gax-grpc + 1.56.0 + compile + + + gax + com.google.api + + + grpc-stub + io.grpc + + + grpc-auth + io.grpc + + + grpc-protobuf + io.grpc + + + guava + com.google.guava + + + jsr305 + com.google.code.findbugs + + + threetenbp + org.threeten + + + google-auth-library-oauth2-http + com.google.auth + + + google-auth-library-credentials + com.google.auth + + + proto-google-common-protos + com.google.api.grpc + + + api-common + com.google.api + + + grpc-netty-shaded + io.grpc + + + grpc-alts + io.grpc + + + false + + + io.grpc + grpc-auth + 1.28.1 + compile + + + grpc-api + io.grpc + + + google-auth-library-credentials + com.google.auth + + + false + + + com.google.auth + google-auth-library-credentials + 0.20.0 + compile + false + + + io.grpc + grpc-netty-shaded + 1.28.1 + compile + + + grpc-core + io.grpc + + + false + + + io.grpc + grpc-core + 1.28.1 + compile + + + grpc-api + io.grpc + + + gson + com.google.code.gson + + + annotations + com.google.android + + + error_prone_annotations + com.google.errorprone + + + perfmark-api + io.perfmark + + + false + + + com.google.code.gson + gson + 2.8.6 + compile + false + + + com.google.android + annotations + 4.1.1.4 + compile + false + + + io.perfmark + perfmark-api + 0.19.0 + compile + + + jsr305 + com.google.code.findbugs + + + error_prone_annotations + com.google.errorprone + + + false + + + io.grpc + grpc-alts + 1.28.1 + compile + + + grpc-grpclb + io.grpc + + + grpc-auth + io.grpc + + + grpc-core + io.grpc + + + grpc-netty-shaded + io.grpc + + + grpc-protobuf + io.grpc + + + grpc-stub + io.grpc + + + commons-lang3 + org.apache.commons + + + protobuf-java + com.google.protobuf + + + conscrypt-openjdk-uber + org.conscrypt + + + google-auth-library-oauth2-http + com.google.auth + + + false + + + io.grpc + grpc-grpclb + 1.28.1 + compile + + + grpc-core + io.grpc + + + grpc-protobuf + io.grpc + + + grpc-stub + io.grpc + + + protobuf-java + com.google.protobuf + + + protobuf-java-util + com.google.protobuf + + + false + + + com.google.protobuf + protobuf-java-util + 3.11.0 + compile + + + protobuf-java + com.google.protobuf + + + guava + com.google.guava + + + error_prone_annotations + com.google.errorprone + + + gson + com.google.code.gson + + + false + + + org.apache.commons + commons-lang3 + 3.5 + compile + false + + + org.conscrypt + conscrypt-openjdk-uber + 2.2.1 + compile + false + + + org.threeten + threetenbp + 1.4.3 + compile + false + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + diff --git a/google-cloud-bigqueryreservations/pom.xml b/google-cloud-bigqueryreservations/pom.xml new file mode 100644 index 00000000..47295636 --- /dev/null +++ b/google-cloud-bigqueryreservations/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigqueryreservations + 0.0.1-SNAPSHOT + jar + Google Cloud BigQuery Reservations + https://github.com/googleapis/java-bigqueryreservations + is about + + com.google.cloud + google-cloud-bigqueryreservations-parent + 0.0.1-SNAPSHOT + + + google-cloud-bigqueryreservations + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-bigqueryreservations-v1beta1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java b/grpc-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java new file mode 100644 index 00000000..6207c08f --- /dev/null +++ b/grpc-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationServiceGrpc.java @@ -0,0 +1,2823 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.reservation.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * This API allows users to manage their flat-rate BigQuery reservations.
+ * A reservation provides computational resource guarantees, in the form of
+ * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
+ * unit of computational power in BigQuery, and serves as the basic unit of
+ * parallelism. In a scan of a multi-partitioned table, a single slot operates
+ * on a single partition of the table. A reservation resource exists as a child
+ * resource of the admin project and location, e.g.:
+ *   projects/myproject/locations/US/reservations/reservationName.
+ * A capacity commitment is a way to purchase compute capacity for BigQuery jobs
+ * (in the form of slots) with some committed period of usage. A capacity
+ * commitment resource exists as a child resource of the admin project and
+ * location, e.g.:
+ *   projects/myproject/locations/US/capacityCommitments/id.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/bigquery/reservation/v1/reservation.proto") +public final class ReservationServiceGrpc { + + private ReservationServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.bigquery.reservation.v1.ReservationService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getCreateReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateReservation", + requestType = com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.Reservation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getCreateReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getCreateReservationMethod; + if ((getCreateReservationMethod = ReservationServiceGrpc.getCreateReservationMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getCreateReservationMethod = ReservationServiceGrpc.getCreateReservationMethod) + == null) { + ReservationServiceGrpc.getCreateReservationMethod = + getCreateReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.Reservation + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("CreateReservation")) + .build(); + } + } + } + return getCreateReservationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + getListReservationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListReservations", + requestType = com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + getListReservationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + getListReservationsMethod; + if ((getListReservationsMethod = ReservationServiceGrpc.getListReservationsMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getListReservationsMethod = ReservationServiceGrpc.getListReservationsMethod) + == null) { + ReservationServiceGrpc.getListReservationsMethod = + getListReservationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReservations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("ListReservations")) + .build(); + } + } + } + return getListReservationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getGetReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetReservation", + requestType = com.google.cloud.bigquery.reservation.v1.GetReservationRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.Reservation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getGetReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getGetReservationMethod; + if ((getGetReservationMethod = ReservationServiceGrpc.getGetReservationMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getGetReservationMethod = ReservationServiceGrpc.getGetReservationMethod) == null) { + ReservationServiceGrpc.getGetReservationMethod = + getGetReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.Reservation + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("GetReservation")) + .build(); + } + } + } + return getGetReservationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, + com.google.protobuf.Empty> + getDeleteReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteReservation", + requestType = com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, + com.google.protobuf.Empty> + getDeleteReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, + com.google.protobuf.Empty> + getDeleteReservationMethod; + if ((getDeleteReservationMethod = ReservationServiceGrpc.getDeleteReservationMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getDeleteReservationMethod = ReservationServiceGrpc.getDeleteReservationMethod) + == null) { + ReservationServiceGrpc.getDeleteReservationMethod = + getDeleteReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("DeleteReservation")) + .build(); + } + } + } + return getDeleteReservationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getUpdateReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateReservation", + requestType = com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.Reservation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getUpdateReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation> + getUpdateReservationMethod; + if ((getUpdateReservationMethod = ReservationServiceGrpc.getUpdateReservationMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getUpdateReservationMethod = ReservationServiceGrpc.getUpdateReservationMethod) + == null) { + ReservationServiceGrpc.getUpdateReservationMethod = + getUpdateReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.Reservation + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("UpdateReservation")) + .build(); + } + } + } + return getUpdateReservationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + getListCapacityCommitmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCapacityCommitments", + requestType = com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + getListCapacityCommitmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + getListCapacityCommitmentsMethod; + if ((getListCapacityCommitmentsMethod = ReservationServiceGrpc.getListCapacityCommitmentsMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getListCapacityCommitmentsMethod = + ReservationServiceGrpc.getListCapacityCommitmentsMethod) + == null) { + ReservationServiceGrpc.getListCapacityCommitmentsMethod = + getListCapacityCommitmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListCapacityCommitments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .ListCapacityCommitmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .ListCapacityCommitmentsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("ListCapacityCommitments")) + .build(); + } + } + } + return getListCapacityCommitmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getGetCapacityCommitmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCapacityCommitment", + requestType = com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.CapacityCommitment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getGetCapacityCommitmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getGetCapacityCommitmentMethod; + if ((getGetCapacityCommitmentMethod = ReservationServiceGrpc.getGetCapacityCommitmentMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getGetCapacityCommitmentMethod = ReservationServiceGrpc.getGetCapacityCommitmentMethod) + == null) { + ReservationServiceGrpc.getGetCapacityCommitmentMethod = + getGetCapacityCommitmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetCapacityCommitment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("GetCapacityCommitment")) + .build(); + } + } + } + return getGetCapacityCommitmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, + com.google.protobuf.Empty> + getDeleteCapacityCommitmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCapacityCommitment", + requestType = com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, + com.google.protobuf.Empty> + getDeleteCapacityCommitmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, + com.google.protobuf.Empty> + getDeleteCapacityCommitmentMethod; + if ((getDeleteCapacityCommitmentMethod = + ReservationServiceGrpc.getDeleteCapacityCommitmentMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getDeleteCapacityCommitmentMethod = + ReservationServiceGrpc.getDeleteCapacityCommitmentMethod) + == null) { + ReservationServiceGrpc.getDeleteCapacityCommitmentMethod = + getDeleteCapacityCommitmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteCapacityCommitment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .DeleteCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier( + "DeleteCapacityCommitment")) + .build(); + } + } + } + return getDeleteCapacityCommitmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getUpdateCapacityCommitmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCapacityCommitment", + requestType = com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.CapacityCommitment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getUpdateCapacityCommitmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getUpdateCapacityCommitmentMethod; + if ((getUpdateCapacityCommitmentMethod = + ReservationServiceGrpc.getUpdateCapacityCommitmentMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getUpdateCapacityCommitmentMethod = + ReservationServiceGrpc.getUpdateCapacityCommitmentMethod) + == null) { + ReservationServiceGrpc.getUpdateCapacityCommitmentMethod = + getUpdateCapacityCommitmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateCapacityCommitment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .UpdateCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier( + "UpdateCapacityCommitment")) + .build(); + } + } + } + return getUpdateCapacityCommitmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + getSplitCapacityCommitmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SplitCapacityCommitment", + requestType = com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + getSplitCapacityCommitmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + getSplitCapacityCommitmentMethod; + if ((getSplitCapacityCommitmentMethod = ReservationServiceGrpc.getSplitCapacityCommitmentMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getSplitCapacityCommitmentMethod = + ReservationServiceGrpc.getSplitCapacityCommitmentMethod) + == null) { + ReservationServiceGrpc.getSplitCapacityCommitmentMethod = + getSplitCapacityCommitmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SplitCapacityCommitment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .SplitCapacityCommitmentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .SplitCapacityCommitmentResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("SplitCapacityCommitment")) + .build(); + } + } + } + return getSplitCapacityCommitmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getMergeCapacityCommitmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MergeCapacityCommitments", + requestType = com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.CapacityCommitment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getMergeCapacityCommitmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getMergeCapacityCommitmentsMethod; + if ((getMergeCapacityCommitmentsMethod = + ReservationServiceGrpc.getMergeCapacityCommitmentsMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getMergeCapacityCommitmentsMethod = + ReservationServiceGrpc.getMergeCapacityCommitmentsMethod) + == null) { + ReservationServiceGrpc.getMergeCapacityCommitmentsMethod = + getMergeCapacityCommitmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "MergeCapacityCommitments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1 + .MergeCapacityCommitmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier( + "MergeCapacityCommitments")) + .build(); + } + } + } + return getMergeCapacityCommitmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getCreateAssignmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAssignment", + requestType = com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.Assignment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getCreateAssignmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getCreateAssignmentMethod; + if ((getCreateAssignmentMethod = ReservationServiceGrpc.getCreateAssignmentMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getCreateAssignmentMethod = ReservationServiceGrpc.getCreateAssignmentMethod) + == null) { + ReservationServiceGrpc.getCreateAssignmentMethod = + getCreateAssignmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAssignment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.Assignment + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("CreateAssignment")) + .build(); + } + } + } + return getCreateAssignmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + getListAssignmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAssignments", + requestType = com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + getListAssignmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + getListAssignmentsMethod; + if ((getListAssignmentsMethod = ReservationServiceGrpc.getListAssignmentsMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getListAssignmentsMethod = ReservationServiceGrpc.getListAssignmentsMethod) == null) { + ReservationServiceGrpc.getListAssignmentsMethod = + getListAssignmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAssignments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("ListAssignments")) + .build(); + } + } + } + return getListAssignmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, + com.google.protobuf.Empty> + getDeleteAssignmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAssignment", + requestType = com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, + com.google.protobuf.Empty> + getDeleteAssignmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, + com.google.protobuf.Empty> + getDeleteAssignmentMethod; + if ((getDeleteAssignmentMethod = ReservationServiceGrpc.getDeleteAssignmentMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getDeleteAssignmentMethod = ReservationServiceGrpc.getDeleteAssignmentMethod) + == null) { + ReservationServiceGrpc.getDeleteAssignmentMethod = + getDeleteAssignmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAssignment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("DeleteAssignment")) + .build(); + } + } + } + return getDeleteAssignmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + getSearchAssignmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchAssignments", + requestType = com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + getSearchAssignmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + getSearchAssignmentsMethod; + if ((getSearchAssignmentsMethod = ReservationServiceGrpc.getSearchAssignmentsMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getSearchAssignmentsMethod = ReservationServiceGrpc.getSearchAssignmentsMethod) + == null) { + ReservationServiceGrpc.getSearchAssignmentsMethod = + getSearchAssignmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchAssignments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("SearchAssignments")) + .build(); + } + } + } + return getSearchAssignmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getMoveAssignmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MoveAssignment", + requestType = com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.Assignment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getMoveAssignmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment> + getMoveAssignmentMethod; + if ((getMoveAssignmentMethod = ReservationServiceGrpc.getMoveAssignmentMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getMoveAssignmentMethod = ReservationServiceGrpc.getMoveAssignmentMethod) == null) { + ReservationServiceGrpc.getMoveAssignmentMethod = + getMoveAssignmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MoveAssignment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.Assignment + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("MoveAssignment")) + .build(); + } + } + } + return getMoveAssignmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getGetBiReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBiReservation", + requestType = com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.BiReservation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getGetBiReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getGetBiReservationMethod; + if ((getGetBiReservationMethod = ReservationServiceGrpc.getGetBiReservationMethod) == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getGetBiReservationMethod = ReservationServiceGrpc.getGetBiReservationMethod) + == null) { + ReservationServiceGrpc.getGetBiReservationMethod = + getGetBiReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBiReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.BiReservation + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("GetBiReservation")) + .build(); + } + } + } + return getGetBiReservationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getUpdateBiReservationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBiReservation", + requestType = com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.class, + responseType = com.google.cloud.bigquery.reservation.v1.BiReservation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getUpdateBiReservationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation> + getUpdateBiReservationMethod; + if ((getUpdateBiReservationMethod = ReservationServiceGrpc.getUpdateBiReservationMethod) + == null) { + synchronized (ReservationServiceGrpc.class) { + if ((getUpdateBiReservationMethod = ReservationServiceGrpc.getUpdateBiReservationMethod) + == null) { + ReservationServiceGrpc.getUpdateBiReservationMethod = + getUpdateBiReservationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateBiReservation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.reservation.v1.BiReservation + .getDefaultInstance())) + .setSchemaDescriptor( + new ReservationServiceMethodDescriptorSupplier("UpdateBiReservation")) + .build(); + } + } + } + return getUpdateBiReservationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ReservationServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ReservationServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceStub(channel, callOptions); + } + }; + return ReservationServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ReservationServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ReservationServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceBlockingStub(channel, callOptions); + } + }; + return ReservationServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ReservationServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ReservationServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceFutureStub(channel, callOptions); + } + }; + return ReservationServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * This API allows users to manage their flat-rate BigQuery reservations.
+   * A reservation provides computational resource guarantees, in the form of
+   * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
+   * unit of computational power in BigQuery, and serves as the basic unit of
+   * parallelism. In a scan of a multi-partitioned table, a single slot operates
+   * on a single partition of the table. A reservation resource exists as a child
+   * resource of the admin project and location, e.g.:
+   *   projects/myproject/locations/US/reservations/reservationName.
+   * A capacity commitment is a way to purchase compute capacity for BigQuery jobs
+   * (in the form of slots) with some committed period of usage. A capacity
+   * commitment resource exists as a child resource of the admin project and
+   * location, e.g.:
+   *   projects/myproject/locations/US/capacityCommitments/id.
+   * 
+ */ + public abstract static class ReservationServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new reservation resource.
+     * 
+ */ + public void createReservation( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateReservationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the reservations for the project in the specified location.
+     * 
+ */ + public void listReservations( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListReservationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns information about the reservation.
+     * 
+ */ + public void getReservation( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetReservationMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a reservation.
+     * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
+     * assignments.
+     * 
+ */ + public void deleteReservation( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteReservationMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing reservation resource.
+     * 
+ */ + public void updateReservation( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateReservationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the capacity commitments for the admin project.
+     * 
+ */ + public void listCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListCapacityCommitmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns information about the capacity commitment.
+     * 
+ */ + public void getCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetCapacityCommitmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a capacity commitment. Attempting to delete capacity commitment
+     * before its commitment_end_time will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void deleteCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteCapacityCommitmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing capacity commitment.
+     * Only plan and renewal_plan fields can be updated.
+     * Plan can only be changed to a plan of a longer commitment period.
+     * Attempting to change to a plan with shorter commitment period will fail
+     * with the error code `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void updateCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateCapacityCommitmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Splits capacity commitment to two commitments of the same plan and
+     * commitment_end_time. A common use case to do that is to perform a downgrade
+     * e.g., in order to downgrade from 10000 slots to 8000, one might split 10000
+     * capacity commitment to 2000 and 8000, change the plan of the first one to
+     * flex and then delete it.
+     * 
+ */ + public void splitCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getSplitCapacityCommitmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Merges capacity commitments of the same plan into one. Resulting capacity
+     * commitment has the longer commitment_end_time out of the two. Attempting to
+     * merge capacity commitments of different plan will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void mergeCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getMergeCapacityCommitmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an object which allows the given project to submit jobs
+     * of a certain type using slots from the specified reservation. Currently a
+     * resource (project, folder, organization) can only have one assignment per
+     * {job_type, location}, and that reservation will be used for all jobs of the
+     * matching type. Within the organization, different assignments can be
+     * created on projects, folders or organization level. During query execution,
+     * the assignment is looked up at the project, folder and organization levels
+     * in that order. The first assignment found is applied to the query. When
+     * creating assignments, it does not matter if other assignments exist at
+     * higher levels. E.g: organizationA contains project1, project2. Assignments
+     * for organizationA, project1 and project2 could all be created, mapping to
+     * the same or different reservations.
+     * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
+     * 'bigquery.admin' permissions on the project using the reservation
+     * and the project that owns this reservation.
+     * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
+     * does not match location of the reservation.
+     * 
+ */ + public void createAssignment( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateAssignmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists assignments.
+     * Only explicitly created assignments will be returned. E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then this API will just return the above two assignments for reservation
+     * res1, and no expansion/merge will happen. Wildcard "-" can be used for
+     * reservations in the request. In that case all assignments belongs to the
+     * specified project and location will be listed. Note
+     * "-" cannot be used for projects nor locations.
+     * 
+ */ + public void listAssignments( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListAssignmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a assignment. No expansion will happen.
+     * E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then deletion of <organizationA, res1> won't affect <project1, res1>. After
+     * deletion of <organizationA, res1>, queries from project1 will still use
+     * res1, while queries from project2 will use on-demand mode.
+     * 
+ */ + public void deleteAssignment( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteAssignmentMethod(), 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.
+     * Same logic applies if the request is about a folder.
+     * If the request is about an organization, then assignments created on the
+     * organization will be returned (organization doesn't have ancestors).
+     * Comparing to ListAssignments, there are some behavior
+     * differences:
+     *   1) permission on the assignee will be verified in this API.
+     *   2) Hierarchy lookup (project->folder->organization) happens in this API.
+     *   3) Parent here is projects/*/locations/*, instead of
+     *   projects/*/locations/*reservations/*.
+     * Note "-" cannot be used for projects
+     * nor locations.
+     * 
+ */ + public void searchAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getSearchAssignmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Moves a assignment under a new reservation. Customers can do this by
+     * deleting the existing assignment followed by creating another assignment
+     * under the new reservation, but this method provides a transactional way to
+     * do so, to make sure the assignee always has an associated reservation.
+     * Without the method customers might see some queries run on-demand which
+     * might be unexpected.
+     * 
+ */ + public void moveAssignment( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getMoveAssignmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a BI reservation.
+     * 
+ */ + public void getBiReservation( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetBiReservationMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a BI reservation.
+     * Only fields specified in the field_mask are updated.
+     * Singleton BI reservation always exists with default size 0.
+     * In order to reserve BI capacity it needs to be updated to an amount
+     * greater than 0. In order to release BI capacity reservation size
+     * must be set to 0.
+     * 
+ */ + public void updateBiReservation( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateBiReservationMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation>( + this, METHODID_CREATE_RESERVATION))) + .addMethod( + getListReservationsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse>( + this, METHODID_LIST_RESERVATIONS))) + .addMethod( + getGetReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.GetReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation>( + this, METHODID_GET_RESERVATION))) + .addMethod( + getDeleteReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_RESERVATION))) + .addMethod( + getUpdateReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, + com.google.cloud.bigquery.reservation.v1.Reservation>( + this, METHODID_UPDATE_RESERVATION))) + .addMethod( + getListCapacityCommitmentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse>( + this, METHODID_LIST_CAPACITY_COMMITMENTS))) + .addMethod( + getGetCapacityCommitmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>( + this, METHODID_GET_CAPACITY_COMMITMENT))) + .addMethod( + getDeleteCapacityCommitmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CAPACITY_COMMITMENT))) + .addMethod( + getUpdateCapacityCommitmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>( + this, METHODID_UPDATE_CAPACITY_COMMITMENT))) + .addMethod( + getSplitCapacityCommitmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse>( + this, METHODID_SPLIT_CAPACITY_COMMITMENT))) + .addMethod( + getMergeCapacityCommitmentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>( + this, METHODID_MERGE_CAPACITY_COMMITMENTS))) + .addMethod( + getCreateAssignmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment>( + this, METHODID_CREATE_ASSIGNMENT))) + .addMethod( + getListAssignmentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse>( + this, METHODID_LIST_ASSIGNMENTS))) + .addMethod( + getDeleteAssignmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_ASSIGNMENT))) + .addMethod( + getSearchAssignmentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse>( + this, METHODID_SEARCH_ASSIGNMENTS))) + .addMethod( + getMoveAssignmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, + com.google.cloud.bigquery.reservation.v1.Assignment>( + this, METHODID_MOVE_ASSIGNMENT))) + .addMethod( + getGetBiReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation>( + this, METHODID_GET_BI_RESERVATION))) + .addMethod( + getUpdateBiReservationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, + com.google.cloud.bigquery.reservation.v1.BiReservation>( + this, METHODID_UPDATE_BI_RESERVATION))) + .build(); + } + } + + /** + * + * + *
+   * This API allows users to manage their flat-rate BigQuery reservations.
+   * A reservation provides computational resource guarantees, in the form of
+   * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
+   * unit of computational power in BigQuery, and serves as the basic unit of
+   * parallelism. In a scan of a multi-partitioned table, a single slot operates
+   * on a single partition of the table. A reservation resource exists as a child
+   * resource of the admin project and location, e.g.:
+   *   projects/myproject/locations/US/reservations/reservationName.
+   * A capacity commitment is a way to purchase compute capacity for BigQuery jobs
+   * (in the form of slots) with some committed period of usage. A capacity
+   * commitment resource exists as a child resource of the admin project and
+   * location, e.g.:
+   *   projects/myproject/locations/US/capacityCommitments/id.
+   * 
+ */ + public static final class ReservationServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ReservationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ReservationServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new reservation resource.
+     * 
+ */ + public void createReservation( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateReservationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all the reservations for the project in the specified location.
+     * 
+ */ + public void listReservations( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListReservationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns information about the reservation.
+     * 
+ */ + public void getReservation( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetReservationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a reservation.
+     * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
+     * assignments.
+     * 
+ */ + public void deleteReservation( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteReservationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing reservation resource.
+     * 
+ */ + public void updateReservation( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateReservationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all the capacity commitments for the admin project.
+     * 
+ */ + public void listCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListCapacityCommitmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns information about the capacity commitment.
+     * 
+ */ + public void getCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetCapacityCommitmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a capacity commitment. Attempting to delete capacity commitment
+     * before its commitment_end_time will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void deleteCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteCapacityCommitmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing capacity commitment.
+     * Only plan and renewal_plan fields can be updated.
+     * Plan can only be changed to a plan of a longer commitment period.
+     * Attempting to change to a plan with shorter commitment period will fail
+     * with the error code `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void updateCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateCapacityCommitmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Splits capacity commitment to two commitments of the same plan and
+     * commitment_end_time. A common use case to do that is to perform a downgrade
+     * e.g., in order to downgrade from 10000 slots to 8000, one might split 10000
+     * capacity commitment to 2000 and 8000, change the plan of the first one to
+     * flex and then delete it.
+     * 
+ */ + public void splitCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSplitCapacityCommitmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Merges capacity commitments of the same plan into one. Resulting capacity
+     * commitment has the longer commitment_end_time out of the two. Attempting to
+     * merge capacity commitments of different plan will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public void mergeCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getMergeCapacityCommitmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an object which allows the given project to submit jobs
+     * of a certain type using slots from the specified reservation. Currently a
+     * resource (project, folder, organization) can only have one assignment per
+     * {job_type, location}, and that reservation will be used for all jobs of the
+     * matching type. Within the organization, different assignments can be
+     * created on projects, folders or organization level. During query execution,
+     * the assignment is looked up at the project, folder and organization levels
+     * in that order. The first assignment found is applied to the query. When
+     * creating assignments, it does not matter if other assignments exist at
+     * higher levels. E.g: organizationA contains project1, project2. Assignments
+     * for organizationA, project1 and project2 could all be created, mapping to
+     * the same or different reservations.
+     * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
+     * 'bigquery.admin' permissions on the project using the reservation
+     * and the project that owns this reservation.
+     * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
+     * does not match location of the reservation.
+     * 
+ */ + public void createAssignment( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateAssignmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists assignments.
+     * Only explicitly created assignments will be returned. E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then this API will just return the above two assignments for reservation
+     * res1, and no expansion/merge will happen. Wildcard "-" can be used for
+     * reservations in the request. In that case all assignments belongs to the
+     * specified project and location will be listed. Note
+     * "-" cannot be used for projects nor locations.
+     * 
+ */ + public void listAssignments( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAssignmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a assignment. No expansion will happen.
+     * E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then deletion of <organizationA, res1> won't affect <project1, res1>. After
+     * deletion of <organizationA, res1>, queries from project1 will still use
+     * res1, while queries from project2 will use on-demand mode.
+     * 
+ */ + public void deleteAssignment( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteAssignmentMethod(), getCallOptions()), + request, + 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.
+     * Same logic applies if the request is about a folder.
+     * If the request is about an organization, then assignments created on the
+     * organization will be returned (organization doesn't have ancestors).
+     * Comparing to ListAssignments, there are some behavior
+     * differences:
+     *   1) permission on the assignee will be verified in this API.
+     *   2) Hierarchy lookup (project->folder->organization) happens in this API.
+     *   3) Parent here is projects/*/locations/*, instead of
+     *   projects/*/locations/*reservations/*.
+     * Note "-" cannot be used for projects
+     * nor locations.
+     * 
+ */ + public void searchAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSearchAssignmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Moves a assignment under a new reservation. Customers can do this by
+     * deleting the existing assignment followed by creating another assignment
+     * under the new reservation, but this method provides a transactional way to
+     * do so, to make sure the assignee always has an associated reservation.
+     * Without the method customers might see some queries run on-demand which
+     * might be unexpected.
+     * 
+ */ + public void moveAssignment( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getMoveAssignmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a BI reservation.
+     * 
+ */ + public void getBiReservation( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetBiReservationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a BI reservation.
+     * Only fields specified in the field_mask are updated.
+     * Singleton BI reservation always exists with default size 0.
+     * In order to reserve BI capacity it needs to be updated to an amount
+     * greater than 0. In order to release BI capacity reservation size
+     * must be set to 0.
+     * 
+ */ + public void updateBiReservation( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateBiReservationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * This API allows users to manage their flat-rate BigQuery reservations.
+   * A reservation provides computational resource guarantees, in the form of
+   * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
+   * unit of computational power in BigQuery, and serves as the basic unit of
+   * parallelism. In a scan of a multi-partitioned table, a single slot operates
+   * on a single partition of the table. A reservation resource exists as a child
+   * resource of the admin project and location, e.g.:
+   *   projects/myproject/locations/US/reservations/reservationName.
+   * A capacity commitment is a way to purchase compute capacity for BigQuery jobs
+   * (in the form of slots) with some committed period of usage. A capacity
+   * commitment resource exists as a child resource of the admin project and
+   * location, e.g.:
+   *   projects/myproject/locations/US/capacityCommitments/id.
+   * 
+ */ + public static final class ReservationServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ReservationServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ReservationServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new reservation resource.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.Reservation createReservation( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest request) { + return blockingUnaryCall( + getChannel(), getCreateReservationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the reservations for the project in the specified location.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.ListReservationsResponse listReservations( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest request) { + return blockingUnaryCall( + getChannel(), getListReservationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns information about the reservation.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservation( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest request) { + return blockingUnaryCall(getChannel(), getGetReservationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a reservation.
+     * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
+     * assignments.
+     * 
+ */ + public com.google.protobuf.Empty deleteReservation( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteReservationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing reservation resource.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.Reservation updateReservation( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateReservationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the capacity commitments for the admin project.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + listCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest request) { + return blockingUnaryCall( + getChannel(), getListCapacityCommitmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns information about the capacity commitment.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest request) { + return blockingUnaryCall( + getChannel(), getGetCapacityCommitmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a capacity commitment. Attempting to delete capacity commitment
+     * before its commitment_end_time will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.protobuf.Empty deleteCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteCapacityCommitmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing capacity commitment.
+     * Only plan and renewal_plan fields can be updated.
+     * Plan can only be changed to a plan of a longer commitment period.
+     * Attempting to change to a plan with shorter commitment period will fail
+     * with the error code `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment updateCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCapacityCommitmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Splits capacity commitment to two commitments of the same plan and
+     * commitment_end_time. A common use case to do that is to perform a downgrade
+     * e.g., in order to downgrade from 10000 slots to 8000, one might split 10000
+     * capacity commitment to 2000 and 8000, change the plan of the first one to
+     * flex and then delete it.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + splitCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest request) { + return blockingUnaryCall( + getChannel(), getSplitCapacityCommitmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Merges capacity commitments of the same plan into one. Resulting capacity
+     * commitment has the longer commitment_end_time out of the two. Attempting to
+     * merge capacity commitments of different plan will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment mergeCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest request) { + return blockingUnaryCall( + getChannel(), getMergeCapacityCommitmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an object which allows the given project to submit jobs
+     * of a certain type using slots from the specified reservation. Currently a
+     * resource (project, folder, organization) can only have one assignment per
+     * {job_type, location}, and that reservation will be used for all jobs of the
+     * matching type. Within the organization, different assignments can be
+     * created on projects, folders or organization level. During query execution,
+     * the assignment is looked up at the project, folder and organization levels
+     * in that order. The first assignment found is applied to the query. When
+     * creating assignments, it does not matter if other assignments exist at
+     * higher levels. E.g: organizationA contains project1, project2. Assignments
+     * for organizationA, project1 and project2 could all be created, mapping to
+     * the same or different reservations.
+     * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
+     * 'bigquery.admin' permissions on the project using the reservation
+     * and the project that owns this reservation.
+     * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
+     * does not match location of the reservation.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.Assignment createAssignment( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest request) { + return blockingUnaryCall( + getChannel(), getCreateAssignmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists assignments.
+     * Only explicitly created assignments will be returned. E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then this API will just return the above two assignments for reservation
+     * res1, and no expansion/merge will happen. Wildcard "-" can be used for
+     * reservations in the request. In that case all assignments belongs to the
+     * specified project and location will be listed. Note
+     * "-" cannot be used for projects nor locations.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse listAssignments( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest request) { + return blockingUnaryCall(getChannel(), getListAssignmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a assignment. No expansion will happen.
+     * E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then deletion of <organizationA, res1> won't affect <project1, res1>. After
+     * deletion of <organizationA, res1>, queries from project1 will still use
+     * res1, while queries from project2 will use on-demand mode.
+     * 
+ */ + public com.google.protobuf.Empty deleteAssignment( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteAssignmentMethod(), 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.
+     * Same logic applies if the request is about a folder.
+     * If the request is about an organization, then assignments created on the
+     * organization will be returned (organization doesn't have ancestors).
+     * Comparing to ListAssignments, there are some behavior
+     * differences:
+     *   1) permission on the assignee will be verified in this API.
+     *   2) Hierarchy lookup (project->folder->organization) happens in this API.
+     *   3) Parent here is projects/*/locations/*, instead of
+     *   projects/*/locations/*reservations/*.
+     * Note "-" cannot be used for projects
+     * nor locations.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse searchAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request) { + return blockingUnaryCall( + getChannel(), getSearchAssignmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Moves a assignment under a new reservation. Customers can do this by
+     * deleting the existing assignment followed by creating another assignment
+     * under the new reservation, but this method provides a transactional way to
+     * do so, to make sure the assignee always has an associated reservation.
+     * Without the method customers might see some queries run on-demand which
+     * might be unexpected.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.Assignment moveAssignment( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest request) { + return blockingUnaryCall(getChannel(), getMoveAssignmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a BI reservation.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.BiReservation getBiReservation( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest request) { + return blockingUnaryCall( + getChannel(), getGetBiReservationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a BI reservation.
+     * Only fields specified in the field_mask are updated.
+     * Singleton BI reservation always exists with default size 0.
+     * In order to reserve BI capacity it needs to be updated to an amount
+     * greater than 0. In order to release BI capacity reservation size
+     * must be set to 0.
+     * 
+ */ + public com.google.cloud.bigquery.reservation.v1.BiReservation updateBiReservation( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateBiReservationMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * This API allows users to manage their flat-rate BigQuery reservations.
+   * A reservation provides computational resource guarantees, in the form of
+   * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
+   * unit of computational power in BigQuery, and serves as the basic unit of
+   * parallelism. In a scan of a multi-partitioned table, a single slot operates
+   * on a single partition of the table. A reservation resource exists as a child
+   * resource of the admin project and location, e.g.:
+   *   projects/myproject/locations/US/reservations/reservationName.
+   * A capacity commitment is a way to purchase compute capacity for BigQuery jobs
+   * (in the form of slots) with some committed period of usage. A capacity
+   * commitment resource exists as a child resource of the admin project and
+   * location, e.g.:
+   *   projects/myproject/locations/US/capacityCommitments/id.
+   * 
+ */ + public static final class ReservationServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ReservationServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ReservationServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ReservationServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new reservation resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.Reservation> + createReservation( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateReservationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the reservations for the project in the specified location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse> + listReservations(com.google.cloud.bigquery.reservation.v1.ListReservationsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListReservationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns information about the reservation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.Reservation> + getReservation(com.google.cloud.bigquery.reservation.v1.GetReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetReservationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a reservation.
+     * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
+     * assignments.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteReservation( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteReservationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing reservation resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.Reservation> + updateReservation( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateReservationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the capacity commitments for the admin project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse> + listCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListCapacityCommitmentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns information about the capacity commitment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + getCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetCapacityCommitmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a capacity commitment. Attempting to delete capacity commitment
+     * before its commitment_end_time will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteCapacityCommitmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing capacity commitment.
+     * Only plan and renewal_plan fields can be updated.
+     * Plan can only be changed to a plan of a longer commitment period.
+     * Attempting to change to a plan with shorter commitment period will fail
+     * with the error code `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + updateCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateCapacityCommitmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Splits capacity commitment to two commitments of the same plan and
+     * commitment_end_time. A common use case to do that is to perform a downgrade
+     * e.g., in order to downgrade from 10000 slots to 8000, one might split 10000
+     * capacity commitment to 2000 and 8000, change the plan of the first one to
+     * flex and then delete it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse> + splitCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getSplitCapacityCommitmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Merges capacity commitments of the same plan into one. Resulting capacity
+     * commitment has the longer commitment_end_time out of the two. Attempting to
+     * merge capacity commitments of different plan will fail with the error code
+     * `google.rpc.Code.FAILED_PRECONDITION`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment> + mergeCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getMergeCapacityCommitmentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an object which allows the given project to submit jobs
+     * of a certain type using slots from the specified reservation. Currently a
+     * resource (project, folder, organization) can only have one assignment per
+     * {job_type, location}, and that reservation will be used for all jobs of the
+     * matching type. Within the organization, different assignments can be
+     * created on projects, folders or organization level. During query execution,
+     * the assignment is looked up at the project, folder and organization levels
+     * in that order. The first assignment found is applied to the query. When
+     * creating assignments, it does not matter if other assignments exist at
+     * higher levels. E.g: organizationA contains project1, project2. Assignments
+     * for organizationA, project1 and project2 could all be created, mapping to
+     * the same or different reservations.
+     * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
+     * 'bigquery.admin' permissions on the project using the reservation
+     * and the project that owns this reservation.
+     * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
+     * does not match location of the reservation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.Assignment> + createAssignment(com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateAssignmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists assignments.
+     * Only explicitly created assignments will be returned. E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then this API will just return the above two assignments for reservation
+     * res1, and no expansion/merge will happen. Wildcard "-" can be used for
+     * reservations in the request. In that case all assignments belongs to the
+     * specified project and location will be listed. Note
+     * "-" cannot be used for projects nor locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse> + listAssignments(com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAssignmentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a assignment. No expansion will happen.
+     * E.g:
+     * organizationA contains project1 and project2. Reservation res1 exists.
+     * CreateAssignment was invoked previously and following assignments were
+     * created explicitly:
+     *   <organizationA, res1>
+     *   <project1, res1>
+     * Then deletion of <organizationA, res1> won't affect <project1, res1>. After
+     * deletion of <organizationA, res1>, queries from project1 will still use
+     * res1, while queries from project2 will use on-demand mode.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAssignment(com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteAssignmentMethod(), 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.
+     * Same logic applies if the request is about a folder.
+     * If the request is about an organization, then assignments created on the
+     * organization will be returned (organization doesn't have ancestors).
+     * Comparing to ListAssignments, there are some behavior
+     * differences:
+     *   1) permission on the assignee will be verified in this API.
+     *   2) Hierarchy lookup (project->folder->organization) happens in this API.
+     *   3) Parent here is projects/*/locations/*, instead of
+     *   projects/*/locations/*reservations/*.
+     * Note "-" cannot be used for projects
+     * nor locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse> + searchAssignments( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getSearchAssignmentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Moves a assignment under a new reservation. Customers can do this by
+     * deleting the existing assignment followed by creating another assignment
+     * under the new reservation, but this method provides a transactional way to
+     * do so, to make sure the assignee always has an associated reservation.
+     * Without the method customers might see some queries run on-demand which
+     * might be unexpected.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.Assignment> + moveAssignment(com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getMoveAssignmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a BI reservation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.BiReservation> + getBiReservation(com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBiReservationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a BI reservation.
+     * Only fields specified in the field_mask are updated.
+     * Singleton BI reservation always exists with default size 0.
+     * In order to reserve BI capacity it needs to be updated to an amount
+     * greater than 0. In order to release BI capacity reservation size
+     * must be set to 0.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.reservation.v1.BiReservation> + updateBiReservation( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateBiReservationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_RESERVATION = 0; + private static final int METHODID_LIST_RESERVATIONS = 1; + private static final int METHODID_GET_RESERVATION = 2; + private static final int METHODID_DELETE_RESERVATION = 3; + private static final int METHODID_UPDATE_RESERVATION = 4; + private static final int METHODID_LIST_CAPACITY_COMMITMENTS = 5; + private static final int METHODID_GET_CAPACITY_COMMITMENT = 6; + private static final int METHODID_DELETE_CAPACITY_COMMITMENT = 7; + private static final int METHODID_UPDATE_CAPACITY_COMMITMENT = 8; + private static final int METHODID_SPLIT_CAPACITY_COMMITMENT = 9; + private static final int METHODID_MERGE_CAPACITY_COMMITMENTS = 10; + private static final int METHODID_CREATE_ASSIGNMENT = 11; + private static final int METHODID_LIST_ASSIGNMENTS = 12; + private static final int METHODID_DELETE_ASSIGNMENT = 13; + private static final int METHODID_SEARCH_ASSIGNMENTS = 14; + private static final int METHODID_MOVE_ASSIGNMENT = 15; + private static final int METHODID_GET_BI_RESERVATION = 16; + private static final int METHODID_UPDATE_BI_RESERVATION = 17; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ReservationServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ReservationServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_RESERVATION: + serviceImpl.createReservation( + (com.google.cloud.bigquery.reservation.v1.CreateReservationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_RESERVATIONS: + serviceImpl.listReservations( + (com.google.cloud.bigquery.reservation.v1.ListReservationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse>) + responseObserver); + break; + case METHODID_GET_RESERVATION: + serviceImpl.getReservation( + (com.google.cloud.bigquery.reservation.v1.GetReservationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_RESERVATION: + serviceImpl.deleteReservation( + (com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_RESERVATION: + serviceImpl.updateReservation( + (com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CAPACITY_COMMITMENTS: + serviceImpl.listCapacityCommitments( + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse>) + responseObserver); + break; + case METHODID_GET_CAPACITY_COMMITMENT: + serviceImpl.getCapacityCommitment( + (com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>) + responseObserver); + break; + case METHODID_DELETE_CAPACITY_COMMITMENT: + serviceImpl.deleteCapacityCommitment( + (com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CAPACITY_COMMITMENT: + serviceImpl.updateCapacityCommitment( + (com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>) + responseObserver); + break; + case METHODID_SPLIT_CAPACITY_COMMITMENT: + serviceImpl.splitCapacityCommitment( + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse>) + responseObserver); + break; + case METHODID_MERGE_CAPACITY_COMMITMENTS: + serviceImpl.mergeCapacityCommitments( + (com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>) + responseObserver); + break; + case METHODID_CREATE_ASSIGNMENT: + serviceImpl.createAssignment( + (com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ASSIGNMENTS: + serviceImpl.listAssignments( + (com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse>) + responseObserver); + break; + case METHODID_DELETE_ASSIGNMENT: + serviceImpl.deleteAssignment( + (com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SEARCH_ASSIGNMENTS: + serviceImpl.searchAssignments( + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse>) + responseObserver); + break; + case METHODID_MOVE_ASSIGNMENT: + serviceImpl.moveAssignment( + (com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BI_RESERVATION: + serviceImpl.getBiReservation( + (com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_BI_RESERVATION: + serviceImpl.updateBiReservation( + (com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ReservationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ReservationServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ReservationService"); + } + } + + private static final class ReservationServiceFileDescriptorSupplier + extends ReservationServiceBaseDescriptorSupplier { + ReservationServiceFileDescriptorSupplier() {} + } + + private static final class ReservationServiceMethodDescriptorSupplier + extends ReservationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ReservationServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ReservationServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ReservationServiceFileDescriptorSupplier()) + .addMethod(getCreateReservationMethod()) + .addMethod(getListReservationsMethod()) + .addMethod(getGetReservationMethod()) + .addMethod(getDeleteReservationMethod()) + .addMethod(getUpdateReservationMethod()) + .addMethod(getListCapacityCommitmentsMethod()) + .addMethod(getGetCapacityCommitmentMethod()) + .addMethod(getDeleteCapacityCommitmentMethod()) + .addMethod(getUpdateCapacityCommitmentMethod()) + .addMethod(getSplitCapacityCommitmentMethod()) + .addMethod(getMergeCapacityCommitmentsMethod()) + .addMethod(getCreateAssignmentMethod()) + .addMethod(getListAssignmentsMethod()) + .addMethod(getDeleteAssignmentMethod()) + .addMethod(getSearchAssignmentsMethod()) + .addMethod(getMoveAssignmentMethod()) + .addMethod(getGetBiReservationMethod()) + .addMethod(getUpdateBiReservationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml b/grpc-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml new file mode 100644 index 00000000..ed571ad2 --- /dev/null +++ b/grpc-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml @@ -0,0 +1,335 @@ + + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-bigqueryreservations-v1beta1 + GRPC library for grpc-google-cloud-bigqueryreservations-v1beta1 + https://github.com/googleapis/java-bigqueryreservations/grpc-google-cloud-bigqueryreservations-v1beta1 + + Google LLC + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/grpc-google-cloud-bigqueryreservations-v1beta1 + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/grpc-google-cloud-bigqueryreservations-v1beta1 + https://github.com/googleapis/java-bigqueryreservations/grpc-google-cloud-bigqueryreservations-v1beta1 + + + GitHub Issues + https://github.com/googleapis/java-bigqueryreservations/issues + + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + + io.grpc + grpc-api + 1.28.1 + compile + + + grpc-context + io.grpc + + + error_prone_annotations + com.google.errorprone + + + jsr305 + com.google.code.findbugs + + + animal-sniffer-annotations + org.codehaus.mojo + + + guava + com.google.guava + + + false + + + io.grpc + grpc-context + 1.28.1 + compile + false + + + com.google.errorprone + error_prone_annotations + 2.3.4 + compile + false + + + com.google.code.findbugs + jsr305 + 3.0.2 + compile + false + + + org.codehaus.mojo + animal-sniffer-annotations + 1.18 + compile + false + + + io.grpc + grpc-stub + 1.28.1 + compile + + + grpc-api + io.grpc + + + false + + + io.grpc + grpc-protobuf + 1.28.1 + compile + + + grpc-api + io.grpc + + + protobuf-java + com.google.protobuf + + + guava + com.google.guava + + + proto-google-common-protos + com.google.api.grpc + + + grpc-protobuf-lite + io.grpc + + + false + + + com.google.api.grpc + proto-google-common-protos + 1.17.0 + compile + + + protobuf-java + com.google.protobuf + + + false + + + io.grpc + grpc-protobuf-lite + 1.28.1 + compile + + + grpc-api + io.grpc + + + protobuf-javalite + com.google.protobuf + + + guava + com.google.guava + + + false + + + com.google.protobuf + protobuf-java + 3.11.4 + compile + false + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + compile + + + protobuf-java + com.google.protobuf + + + proto-google-common-protos + com.google.api.grpc + + + api-common + com.google.api + + + guava + com.google.guava + + + false + + + com.google.api + api-common + 1.9.0 + compile + + + jsr305 + com.google.code.findbugs + + + guava + com.google.guava + + + javax.annotation-api + javax.annotation + + + auto-value-annotations + com.google.auto.value + + + false + + + javax.annotation + javax.annotation-api + 1.3.2 + compile + false + + + com.google.auto.value + auto-value-annotations + 1.7 + compile + false + + + com.google.guava + guava + 29.0-android + compile + + + failureaccess + com.google.guava + + + listenablefuture + com.google.guava + + + jsr305 + com.google.code.findbugs + + + checker-compat-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + j2objc-annotations + com.google.j2objc + + + srczip + jdk + + + false + + + com.google.guava + failureaccess + 1.0.1 + compile + false + + + com.google.guava + listenablefuture + 9999.0-empty-to-avoid-conflict-with-guava + compile + false + + + org.checkerframework + checker-compat-qual + 2.5.5 + compile + false + + + com.google.j2objc + j2objc-annotations + 1.3 + compile + false + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + diff --git a/grpc-google-cloud-bigqueryreservations-v1beta1/pom.xml b/grpc-google-cloud-bigqueryreservations-v1beta1/pom.xml new file mode 100644 index 00000000..45a7a1e0 --- /dev/null +++ b/grpc-google-cloud-bigqueryreservations-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-bigqueryreservations-v1beta1 + GRPC library for grpc-google-cloud-bigqueryreservations-v1beta1 + + com.google.cloud + google-cloud-bigqueryreservations-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* 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\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..be29f134 --- /dev/null +++ b/pom.xml @@ -0,0 +1,186 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigqueryreservations-parent + pom + 0.0.1-SNAPSHOT + Google Cloud BigQuery Reservations Parent + https://github.com/googleapis/java-bigqueryreservations + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.5.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-bigqueryreservations.git + scm:git:git@github.com:googleapis/java-bigqueryreservations.git + https://github.com/googleapis/java-bigqueryreservations + HEAD + + + https://github.com/googleapis/java-bigqueryreservations/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-bigqueryreservations-parent + + + + + + com.google.cloud + google-cloud-bigqueryreservations + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.1.1 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + google-cloud-bigqueryreservations + proto-google-cloud-bigqueryreservations-v1beta1 + grpc-google-cloud-bigqueryreservations-v1beta1 + google-cloud-bigqueryreservations-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java new file mode 100644 index 00000000..e0cdd348 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Assignment.java @@ -0,0 +1,1463 @@ +/* + * 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; + +/** + * + * + *
+ * A Assignment allows a project to submit jobs
+ * of a certain type using slots from the specified reservation.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.Assignment} + */ +public final class Assignment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.Assignment) + AssignmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Assignment.newBuilder() to construct. + private Assignment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Assignment() { + name_ = ""; + assignee_ = ""; + jobType_ = 0; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Assignment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Assignment( + 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(); + + name_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + jobType_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + assignee_ = s; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + 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_Assignment_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_Assignment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.Assignment.class, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder.class); + } + + /** + * + * + *
+   * Types of job, which could be specified when using the reservation.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.reservation.v1.Assignment.JobType} + */ + public enum JobType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid type. Requests with this value will be rejected with
+     * error code `google.rpc.Code.INVALID_ARGUMENT`.
+     * 
+ * + * JOB_TYPE_UNSPECIFIED = 0; + */ + JOB_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Pipeline (load/export) jobs from the project will use the reservation.
+     * 
+ * + * PIPELINE = 1; + */ + PIPELINE(1), + /** + * + * + *
+     * Query jobs from the project will use the reservation.
+     * 
+ * + * QUERY = 2; + */ + QUERY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid type. Requests with this value will be rejected with
+     * error code `google.rpc.Code.INVALID_ARGUMENT`.
+     * 
+ * + * JOB_TYPE_UNSPECIFIED = 0; + */ + public static final int JOB_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Pipeline (load/export) jobs from the project will use the reservation.
+     * 
+ * + * PIPELINE = 1; + */ + public static final int PIPELINE_VALUE = 1; + /** + * + * + *
+     * Query jobs from the project will use the reservation.
+     * 
+ * + * QUERY = 2; + */ + public static final int QUERY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static JobType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static JobType forNumber(int value) { + switch (value) { + case 0: + return JOB_TYPE_UNSPECIFIED; + case 1: + return PIPELINE; + case 2: + return QUERY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public JobType findValueByNumber(int number) { + return JobType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.Assignment.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final JobType[] VALUES = values(); + + public static JobType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private JobType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.reservation.v1.Assignment.JobType) + } + + /** + * + * + *
+   * Assignment will remain in PENDING state if no active capacity commitment is
+   * present. It will become ACTIVE when some capacity commitment becomes
+   * active.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.reservation.v1.Assignment.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid state value.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Queries from assignee will be executed as on-demand, if related
+     * assignment is pending.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+     * Assignment is ready.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid state value.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Queries from assignee will be executed as on-demand, if related
+     * assignment is pending.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + * + * + *
+     * Assignment is ready.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return ACTIVE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.Assignment.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.reservation.v1.Assignment.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Name of the resource. E.g.:
+   * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the resource. E.g.:
+   * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSIGNEE_FIELD_NUMBER = 4; + private volatile java.lang.Object assignee_; + /** + * + * + *
+   * The resource which will use the reservation. E.g.
+   * projects/myproject, folders/123, organizations/456.
+   * 
+ * + * string assignee = 4; + * + * @return The assignee. + */ + public java.lang.String getAssignee() { + java.lang.Object ref = assignee_; + 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(); + assignee_ = s; + return s; + } + } + /** + * + * + *
+   * The resource which will use the reservation. E.g.
+   * projects/myproject, folders/123, organizations/456.
+   * 
+ * + * string assignee = 4; + * + * @return The bytes for assignee. + */ + public com.google.protobuf.ByteString getAssigneeBytes() { + java.lang.Object ref = assignee_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assignee_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int JOB_TYPE_FIELD_NUMBER = 3; + private int jobType_; + /** + * + * + *
+   * Which type of jobs will use the reservation.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The enum numeric value on the wire for jobType. + */ + public int getJobTypeValue() { + return jobType_; + } + /** + * + * + *
+   * Which type of jobs will use the reservation.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The jobType. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.Assignment.JobType result = + com.google.cloud.bigquery.reservation.v1.Assignment.JobType.valueOf(jobType_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.JobType.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. State of the assignment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the assignment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.Assignment.State result = + com.google.cloud.bigquery.reservation.v1.Assignment.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.State.UNRECOGNIZED + : result; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (jobType_ + != com.google.cloud.bigquery.reservation.v1.Assignment.JobType.JOB_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, jobType_); + } + if (!getAssigneeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, assignee_); + } + if (state_ + != com.google.cloud.bigquery.reservation.v1.Assignment.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (jobType_ + != com.google.cloud.bigquery.reservation.v1.Assignment.JobType.JOB_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, jobType_); + } + if (!getAssigneeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, assignee_); + } + if (state_ + != com.google.cloud.bigquery.reservation.v1.Assignment.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + 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.Assignment)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.Assignment other = + (com.google.cloud.bigquery.reservation.v1.Assignment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAssignee().equals(other.getAssignee())) return false; + if (jobType_ != other.jobType_) return false; + if (state_ != other.state_) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ASSIGNEE_FIELD_NUMBER; + hash = (53 * hash) + getAssignee().hashCode(); + hash = (37 * hash) + JOB_TYPE_FIELD_NUMBER; + hash = (53 * hash) + jobType_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.Assignment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Assignment 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.Assignment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Assignment 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.Assignment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Assignment 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.Assignment 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.Assignment 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.Assignment 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.Assignment 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.Assignment 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.Assignment 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.Assignment 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; + } + /** + * + * + *
+   * A Assignment allows a project to submit jobs
+   * of a certain type using slots from the specified reservation.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.Assignment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.Assignment) + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_Assignment_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_Assignment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.Assignment.class, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.Assignment.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(); + name_ = ""; + + assignee_ = ""; + + jobType_ = 0; + + state_ = 0; + + 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_Assignment_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Assignment getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Assignment build() { + com.google.cloud.bigquery.reservation.v1.Assignment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Assignment buildPartial() { + com.google.cloud.bigquery.reservation.v1.Assignment result = + new com.google.cloud.bigquery.reservation.v1.Assignment(this); + result.name_ = name_; + result.assignee_ = assignee_; + result.jobType_ = jobType_; + result.state_ = state_; + 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.Assignment) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.Assignment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.Assignment other) { + if (other == com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAssignee().isEmpty()) { + assignee_ = other.assignee_; + onChanged(); + } + if (other.jobType_ != 0) { + setJobTypeValue(other.getJobTypeValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + 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.Assignment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.Assignment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Name of the resource. E.g.:
+     * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource. E.g.:
+     * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource. E.g.:
+     * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource. E.g.:
+     * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource. E.g.:
+     * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object assignee_ = ""; + /** + * + * + *
+     * The resource which will use the reservation. E.g.
+     * projects/myproject, folders/123, organizations/456.
+     * 
+ * + * string assignee = 4; + * + * @return The assignee. + */ + public java.lang.String getAssignee() { + java.lang.Object ref = assignee_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assignee_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource which will use the reservation. E.g.
+     * projects/myproject, folders/123, organizations/456.
+     * 
+ * + * string assignee = 4; + * + * @return The bytes for assignee. + */ + public com.google.protobuf.ByteString getAssigneeBytes() { + java.lang.Object ref = assignee_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assignee_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource which will use the reservation. E.g.
+     * projects/myproject, folders/123, organizations/456.
+     * 
+ * + * string assignee = 4; + * + * @param value The assignee to set. + * @return This builder for chaining. + */ + public Builder setAssignee(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assignee_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource which will use the reservation. E.g.
+     * projects/myproject, folders/123, organizations/456.
+     * 
+ * + * string assignee = 4; + * + * @return This builder for chaining. + */ + public Builder clearAssignee() { + + assignee_ = getDefaultInstance().getAssignee(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource which will use the reservation. E.g.
+     * projects/myproject, folders/123, organizations/456.
+     * 
+ * + * string assignee = 4; + * + * @param value The bytes for assignee to set. + * @return This builder for chaining. + */ + public Builder setAssigneeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assignee_ = value; + onChanged(); + return this; + } + + private int jobType_ = 0; + /** + * + * + *
+     * Which type of jobs will use the reservation.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The enum numeric value on the wire for jobType. + */ + public int getJobTypeValue() { + return jobType_; + } + /** + * + * + *
+     * Which type of jobs will use the reservation.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @param value The enum numeric value on the wire for jobType to set. + * @return This builder for chaining. + */ + public Builder setJobTypeValue(int value) { + jobType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Which type of jobs will use the reservation.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The jobType. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.Assignment.JobType result = + com.google.cloud.bigquery.reservation.v1.Assignment.JobType.valueOf(jobType_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.JobType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Which type of jobs will use the reservation.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @param value The jobType to set. + * @return This builder for chaining. + */ + public Builder setJobType(com.google.cloud.bigquery.reservation.v1.Assignment.JobType value) { + if (value == null) { + throw new NullPointerException(); + } + + jobType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Which type of jobs will use the reservation.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearJobType() { + + jobType_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the assignment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the assignment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the assignment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.Assignment.State result = + com.google.cloud.bigquery.reservation.v1.Assignment.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the assignment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.bigquery.reservation.v1.Assignment.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the assignment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + 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.Assignment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.Assignment) + private static final com.google.cloud.bigquery.reservation.v1.Assignment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.Assignment(); + } + + public static com.google.cloud.bigquery.reservation.v1.Assignment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Assignment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Assignment(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.Assignment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentName.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentName.java new file mode 100644 index 00000000..6103f546 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentName.java @@ -0,0 +1,251 @@ +/* + * 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. + */ + +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AssignmentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String reservation; + private final String assignment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReservation() { + return reservation; + } + + public String getAssignment() { + return assignment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AssignmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + reservation = Preconditions.checkNotNull(builder.getReservation()); + assignment = Preconditions.checkNotNull(builder.getAssignment()); + } + + public static AssignmentName of( + String project, String location, String reservation, String assignment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReservation(reservation) + .setAssignment(assignment) + .build(); + } + + public static String format( + String project, String location, String reservation, String assignment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReservation(reservation) + .setAssignment(assignment) + .build() + .toString(); + } + + public static AssignmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AssignmentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("reservation"), + matchMap.get("assignment")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (AssignmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("reservation", reservation); + fieldMapBuilder.put("assignment", assignment); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "reservation", + reservation, + "assignment", + assignment); + } + + /** Builder for AssignmentName. */ + public static class Builder { + + private String project; + private String location; + private String reservation; + private String assignment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReservation() { + return reservation; + } + + public String getAssignment() { + return assignment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + + public Builder setAssignment(String assignment) { + this.assignment = assignment; + return this; + } + + private Builder() {} + + private Builder(AssignmentName assignmentName) { + project = assignmentName.project; + location = assignmentName.location; + reservation = assignmentName.reservation; + assignment = assignmentName.assignment; + } + + public AssignmentName build() { + return new AssignmentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AssignmentName) { + AssignmentName that = (AssignmentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.reservation.equals(that.reservation)) + && (this.assignment.equals(that.assignment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= reservation.hashCode(); + h *= 1000003; + h ^= assignment.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentOrBuilder.java new file mode 100644 index 00000000..ce5a355c --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/AssignmentOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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 AssignmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.Assignment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the resource. E.g.:
+   * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Name of the resource. E.g.:
+   * projects/myproject/locations/US/reservations/team1-prod/assignments/123.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The resource which will use the reservation. E.g.
+   * projects/myproject, folders/123, organizations/456.
+   * 
+ * + * string assignee = 4; + * + * @return The assignee. + */ + java.lang.String getAssignee(); + /** + * + * + *
+   * The resource which will use the reservation. E.g.
+   * projects/myproject, folders/123, organizations/456.
+   * 
+ * + * string assignee = 4; + * + * @return The bytes for assignee. + */ + com.google.protobuf.ByteString getAssigneeBytes(); + + /** + * + * + *
+   * Which type of jobs will use the reservation.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The enum numeric value on the wire for jobType. + */ + int getJobTypeValue(); + /** + * + * + *
+   * Which type of jobs will use the reservation.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment.JobType job_type = 3; + * + * @return The jobType. + */ + com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType(); + + /** + * + * + *
+   * Output only. State of the assignment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the assignment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.Assignment.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.bigquery.reservation.v1.Assignment.State getState(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java new file mode 100644 index 00000000..af79ef04 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservation.java @@ -0,0 +1,1027 @@ +/* + * 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; + +/** + * + * + *
+ * Represents a BI Reservation.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.BiReservation} + */ +public final class BiReservation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.BiReservation) + BiReservationOrBuilder { + private static final long serialVersionUID = 0L; + // Use BiReservation.newBuilder() to construct. + private BiReservation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BiReservation() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BiReservation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BiReservation( + 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(); + + name_ = s; + break; + } + case 26: + { + 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; + } + case 32: + { + size_ = input.readInt64(); + 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_BiReservation_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_BiReservation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.BiReservation.class, + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the singleton BI reservation.
+   * Reservation names have the form
+   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the singleton BI reservation.
+   * Reservation names have the form
+   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int SIZE_FIELD_NUMBER = 4; + private long size_; + /** + * + * + *
+   * Size of a reservation, in bytes.
+   * 
+ * + * int64 size = 4; + * + * @return The size. + */ + public long getSize() { + return size_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + if (size_ != 0L) { + output.writeInt64(4, size_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, size_); + } + 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.BiReservation)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.BiReservation other = + (com.google.cloud.bigquery.reservation.v1.BiReservation) obj; + + if (!getName().equals(other.getName())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getSize() != other.getSize()) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSize()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.BiReservation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.BiReservation 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.BiReservation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.BiReservation 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.BiReservation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.BiReservation 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.BiReservation 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.BiReservation 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.BiReservation 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.BiReservation 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.BiReservation 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.BiReservation 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.BiReservation 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; + } + /** + * + * + *
+   * Represents a BI Reservation.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.BiReservation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.BiReservation) + com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_BiReservation_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_BiReservation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.BiReservation.class, + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.BiReservation.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(); + name_ = ""; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + size_ = 0L; + + 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_BiReservation_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.BiReservation getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.BiReservation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.BiReservation build() { + com.google.cloud.bigquery.reservation.v1.BiReservation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.BiReservation buildPartial() { + com.google.cloud.bigquery.reservation.v1.BiReservation result = + new com.google.cloud.bigquery.reservation.v1.BiReservation(this); + result.name_ = name_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.size_ = size_; + 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.BiReservation) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.BiReservation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.BiReservation other) { + if (other == com.google.cloud.bigquery.reservation.v1.BiReservation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + 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.BiReservation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.BiReservation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the singleton BI reservation.
+     * Reservation names have the form
+     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the singleton BI reservation.
+     * Reservation names have the form
+     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the singleton BI reservation.
+     * Reservation names have the form
+     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the singleton BI reservation.
+     * Reservation names have the form
+     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the singleton BI reservation.
+     * Reservation names have the form
+     * `projects/{project_id}/locations/{location_id}/bireservation`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + 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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. The last update timestamp of a reservation.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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_; + } + + private long size_; + /** + * + * + *
+     * Size of a reservation, in bytes.
+     * 
+ * + * int64 size = 4; + * + * @return The size. + */ + public long getSize() { + return size_; + } + /** + * + * + *
+     * Size of a reservation, in bytes.
+     * 
+ * + * int64 size = 4; + * + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Size of a reservation, in bytes.
+     * 
+ * + * int64 size = 4; + * + * @return This builder for chaining. + */ + public Builder clearSize() { + + size_ = 0L; + 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.BiReservation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.BiReservation) + private static final com.google.cloud.bigquery.reservation.v1.BiReservation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.BiReservation(); + } + + public static com.google.cloud.bigquery.reservation.v1.BiReservation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BiReservation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BiReservation(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.BiReservation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java new file mode 100644 index 00000000..ba4e7455 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationName.java @@ -0,0 +1,183 @@ +/* + * 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. + */ + +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BiReservationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/bireservation"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BiReservationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static BiReservationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static BiReservationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "BiReservationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BiReservationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for BiReservationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(BiReservationName biReservationName) { + project = biReservationName.project; + location = biReservationName.location; + } + + public BiReservationName build() { + return new BiReservationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BiReservationName) { + BiReservationName that = (BiReservationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java new file mode 100644 index 00000000..03d6f7d9 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/BiReservationOrBuilder.java @@ -0,0 +1,105 @@ +/* + * 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 BiReservationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.BiReservation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the singleton BI reservation.
+   * Reservation names have the form
+   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the singleton BI reservation.
+   * Reservation names have the form
+   * `projects/{project_id}/locations/{location_id}/bireservation`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a reservation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Size of a reservation, in bytes.
+   * 
+ * + * int64 size = 4; + * + * @return The size. + */ + long getSize(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java new file mode 100644 index 00000000..68fcec40 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitment.java @@ -0,0 +1,2208 @@ +/* + * 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; + +/** + * + * + *
+ * Capacity commitment is a way to purchase compute capacity for BigQuery jobs
+ * (in the form of slots) with some committed period of usage. Monthly and
+ * annual commitments renew by default. Only flex commitments can be removed. In
+ * order to remove monthly or annual commitments, their plan needs to be changed
+ * to flex first.
+ * A capacity commitment resource exists as a child resource of the admin
+ * project.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CapacityCommitment} + */ +public final class CapacityCommitment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.CapacityCommitment) + CapacityCommitmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use CapacityCommitment.newBuilder() to construct. + private CapacityCommitment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CapacityCommitment() { + name_ = ""; + plan_ = 0; + state_ = 0; + renewalPlan_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CapacityCommitment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CapacityCommitment( + 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(); + + name_ = s; + break; + } + case 16: + { + slotCount_ = input.readInt64(); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + plan_ = rawValue; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (commitmentEndTime_ != null) { + subBuilder = commitmentEndTime_.toBuilder(); + } + commitmentEndTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commitmentEndTime_); + commitmentEndTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.rpc.Status.Builder subBuilder = null; + if (failureStatus_ != null) { + subBuilder = failureStatus_.toBuilder(); + } + failureStatus_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(failureStatus_); + failureStatus_ = subBuilder.buildPartial(); + } + + break; + } + case 64: + { + int rawValue = input.readEnum(); + + renewalPlan_ = rawValue; + 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_CapacityCommitment_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_CapacityCommitment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.class, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder.class); + } + + /** + * + * + *
+   * Commitment plan defines the current committed period. Capacity commitment
+   * cannot be deleted during it's committed period.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan} + */ + public enum CommitmentPlan implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid plan value. Requests with this value will be rejected with
+     * error code `google.rpc.Code.INVALID_ARGUMENT`.
+     * 
+ * + * COMMITMENT_PLAN_UNSPECIFIED = 0; + */ + COMMITMENT_PLAN_UNSPECIFIED(0), + /** + * + * + *
+     * Flex commitments have committed period of 1 minute after becoming ACTIVE.
+     * After that, they are not in a committed period anymore and can be removed
+     * any time.
+     * 
+ * + * FLEX = 3; + */ + FLEX(3), + /** + * + * + *
+     * Monthly commitments have a committed period of 30 days after becoming
+     * ACTIVE.
+     * 
+ * + * MONTHLY = 2; + */ + MONTHLY(2), + /** + * + * + *
+     * Annual commitments have a committed period of 365 days after becoming
+     * ACTIVE.
+     * 
+ * + * ANNUAL = 4; + */ + ANNUAL(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid plan value. Requests with this value will be rejected with
+     * error code `google.rpc.Code.INVALID_ARGUMENT`.
+     * 
+ * + * COMMITMENT_PLAN_UNSPECIFIED = 0; + */ + public static final int COMMITMENT_PLAN_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Flex commitments have committed period of 1 minute after becoming ACTIVE.
+     * After that, they are not in a committed period anymore and can be removed
+     * any time.
+     * 
+ * + * FLEX = 3; + */ + public static final int FLEX_VALUE = 3; + /** + * + * + *
+     * Monthly commitments have a committed period of 30 days after becoming
+     * ACTIVE.
+     * 
+ * + * MONTHLY = 2; + */ + public static final int MONTHLY_VALUE = 2; + /** + * + * + *
+     * Annual commitments have a committed period of 365 days after becoming
+     * ACTIVE.
+     * 
+ * + * ANNUAL = 4; + */ + public static final int ANNUAL_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CommitmentPlan valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CommitmentPlan forNumber(int value) { + switch (value) { + case 0: + return COMMITMENT_PLAN_UNSPECIFIED; + case 3: + return FLEX; + case 2: + return MONTHLY; + case 4: + return ANNUAL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CommitmentPlan findValueByNumber(int number) { + return CommitmentPlan.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final CommitmentPlan[] VALUES = values(); + + public static CommitmentPlan valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CommitmentPlan(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan) + } + + /** + * + * + *
+   * Capacity commitment can either become ACTIVE right away or transition
+   * from PENDING to ACTIVE or FAILED.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.reservation.v1.CapacityCommitment.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid state value.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Capacity commitment is pending provisioning. Pending capacity commitment
+     * does not contribute to the parent's slot_capacity.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+     * Once slots are provisioned, capacity commitment becomes active.
+     * slot_count is added to the parent's slot_capacity.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * Capacity commitment is failed to be activated by the backend.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid state value.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Capacity commitment is pending provisioning. Pending capacity commitment
+     * does not contribute to the parent's slot_capacity.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + * + * + *
+     * Once slots are provisioned, capacity commitment becomes active.
+     * slot_count is added to the parent's slot_capacity.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * Capacity commitment is failed to be activated by the backend.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return ACTIVE; + case 3: + return FAILED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.reservation.v1.CapacityCommitment.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the capacity commitment, e.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the capacity commitment, e.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SLOT_COUNT_FIELD_NUMBER = 2; + private long slotCount_; + /** + * + * + *
+   * Number of slots in this commitment.
+   * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + public long getSlotCount() { + return slotCount_; + } + + public static final int PLAN_FIELD_NUMBER = 3; + private int plan_; + /** + * + * + *
+   * Capacity commitment commitment plan.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * @return The enum numeric value on the wire for plan. + */ + public int getPlanValue() { + return plan_; + } + /** + * + * + *
+   * Capacity commitment commitment plan.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * @return The plan. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan getPlan() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.valueOf(plan_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. State of the commitment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the commitment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.UNRECOGNIZED + : result; + } + + public static final int COMMITMENT_END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp commitmentEndTime_; + /** + * + * + *
+   * 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]; + * + * + * @return Whether the commitmentEndTime field is set. + */ + public boolean hasCommitmentEndTime() { + return commitmentEndTime_ != null; + } + /** + * + * + *
+   * 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]; + * + * + * @return The commitmentEndTime. + */ + public com.google.protobuf.Timestamp getCommitmentEndTime() { + return commitmentEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentEndTime_; + } + /** + * + * + *
+   * 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]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCommitmentEndTimeOrBuilder() { + return getCommitmentEndTime(); + } + + public static final int FAILURE_STATUS_FIELD_NUMBER = 7; + private com.google.rpc.Status failureStatus_; + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the failureStatus field is set. + */ + public boolean hasFailureStatus() { + return failureStatus_ != null; + } + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The failureStatus. + */ + public com.google.rpc.Status getFailureStatus() { + return failureStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : failureStatus_; + } + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getFailureStatusOrBuilder() { + return getFailureStatus(); + } + + public static final int RENEWAL_PLAN_FIELD_NUMBER = 8; + private int renewalPlan_; + /** + * + * + *
+   * The plan this capacity commitment is converted to after commitment_end_time
+   * passes. Once the plan is changed, committed period is extended according to
+   * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The enum numeric value on the wire for renewalPlan. + */ + public int getRenewalPlanValue() { + return renewalPlan_; + } + /** + * + * + *
+   * The plan this capacity commitment is converted to after commitment_end_time
+   * passes. Once the plan is changed, committed period is extended according to
+   * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The renewalPlan. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + getRenewalPlan() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.valueOf( + renewalPlan_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.UNRECOGNIZED + : result; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (slotCount_ != 0L) { + output.writeInt64(2, slotCount_); + } + if (plan_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + .COMMITMENT_PLAN_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, plan_); + } + if (state_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + if (commitmentEndTime_ != null) { + output.writeMessage(5, getCommitmentEndTime()); + } + if (failureStatus_ != null) { + output.writeMessage(7, getFailureStatus()); + } + if (renewalPlan_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + .COMMITMENT_PLAN_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, renewalPlan_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (slotCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, slotCount_); + } + if (plan_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + .COMMITMENT_PLAN_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, plan_); + } + if (state_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (commitmentEndTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCommitmentEndTime()); + } + if (failureStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFailureStatus()); + } + if (renewalPlan_ + != com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + .COMMITMENT_PLAN_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, renewalPlan_); + } + 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.CapacityCommitment)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.CapacityCommitment other = + (com.google.cloud.bigquery.reservation.v1.CapacityCommitment) obj; + + if (!getName().equals(other.getName())) return false; + if (getSlotCount() != other.getSlotCount()) return false; + if (plan_ != other.plan_) return false; + if (state_ != other.state_) return false; + if (hasCommitmentEndTime() != other.hasCommitmentEndTime()) return false; + if (hasCommitmentEndTime()) { + if (!getCommitmentEndTime().equals(other.getCommitmentEndTime())) return false; + } + if (hasFailureStatus() != other.hasFailureStatus()) return false; + if (hasFailureStatus()) { + if (!getFailureStatus().equals(other.getFailureStatus())) return false; + } + if (renewalPlan_ != other.renewalPlan_) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SLOT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSlotCount()); + hash = (37 * hash) + PLAN_FIELD_NUMBER; + hash = (53 * hash) + plan_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCommitmentEndTime()) { + hash = (37 * hash) + COMMITMENT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCommitmentEndTime().hashCode(); + } + if (hasFailureStatus()) { + hash = (37 * hash) + FAILURE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getFailureStatus().hashCode(); + } + hash = (37 * hash) + RENEWAL_PLAN_FIELD_NUMBER; + hash = (53 * hash) + renewalPlan_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.CapacityCommitment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CapacityCommitment 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.CapacityCommitment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CapacityCommitment 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.CapacityCommitment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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.CapacityCommitment 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; + } + /** + * + * + *
+   * Capacity commitment is a way to purchase compute capacity for BigQuery jobs
+   * (in the form of slots) with some committed period of usage. Monthly and
+   * annual commitments renew by default. Only flex commitments can be removed. In
+   * order to remove monthly or annual commitments, their plan needs to be changed
+   * to flex first.
+   * A capacity commitment resource exists as a child resource of the admin
+   * project.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CapacityCommitment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.CapacityCommitment) + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_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_CapacityCommitment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.class, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.CapacityCommitment.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(); + name_ = ""; + + slotCount_ = 0L; + + plan_ = 0; + + state_ = 0; + + if (commitmentEndTimeBuilder_ == null) { + commitmentEndTime_ = null; + } else { + commitmentEndTime_ = null; + commitmentEndTimeBuilder_ = null; + } + if (failureStatusBuilder_ == null) { + failureStatus_ = null; + } else { + failureStatus_ = null; + failureStatusBuilder_ = null; + } + renewalPlan_ = 0; + + 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_CapacityCommitment_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment build() { + com.google.cloud.bigquery.reservation.v1.CapacityCommitment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment buildPartial() { + com.google.cloud.bigquery.reservation.v1.CapacityCommitment result = + new com.google.cloud.bigquery.reservation.v1.CapacityCommitment(this); + result.name_ = name_; + result.slotCount_ = slotCount_; + result.plan_ = plan_; + result.state_ = state_; + if (commitmentEndTimeBuilder_ == null) { + result.commitmentEndTime_ = commitmentEndTime_; + } else { + result.commitmentEndTime_ = commitmentEndTimeBuilder_.build(); + } + if (failureStatusBuilder_ == null) { + result.failureStatus_ = failureStatus_; + } else { + result.failureStatus_ = failureStatusBuilder_.build(); + } + result.renewalPlan_ = renewalPlan_; + 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.CapacityCommitment) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.CapacityCommitment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.CapacityCommitment other) { + if (other == com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getSlotCount() != 0L) { + setSlotCount(other.getSlotCount()); + } + if (other.plan_ != 0) { + setPlanValue(other.getPlanValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCommitmentEndTime()) { + mergeCommitmentEndTime(other.getCommitmentEndTime()); + } + if (other.hasFailureStatus()) { + mergeFailureStatus(other.getFailureStatus()); + } + if (other.renewalPlan_ != 0) { + setRenewalPlanValue(other.getRenewalPlanValue()); + } + 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.CapacityCommitment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.CapacityCommitment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the capacity commitment, e.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the capacity commitment, e.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the capacity commitment, e.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the capacity commitment, e.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the capacity commitment, e.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long slotCount_; + /** + * + * + *
+     * Number of slots in this commitment.
+     * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + public long getSlotCount() { + return slotCount_; + } + /** + * + * + *
+     * Number of slots in this commitment.
+     * 
+ * + * int64 slot_count = 2; + * + * @param value The slotCount to set. + * @return This builder for chaining. + */ + public Builder setSlotCount(long value) { + + slotCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of slots in this commitment.
+     * 
+ * + * int64 slot_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearSlotCount() { + + slotCount_ = 0L; + onChanged(); + return this; + } + + private int plan_ = 0; + /** + * + * + *
+     * Capacity commitment commitment plan.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * + * @return The enum numeric value on the wire for plan. + */ + public int getPlanValue() { + return plan_; + } + /** + * + * + *
+     * Capacity commitment commitment plan.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * + * @param value The enum numeric value on the wire for plan to set. + * @return This builder for chaining. + */ + public Builder setPlanValue(int value) { + plan_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Capacity commitment commitment plan.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * + * @return The plan. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan getPlan() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.valueOf(plan_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Capacity commitment commitment plan.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * + * @param value The plan to set. + * @return This builder for chaining. + */ + public Builder setPlan( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan value) { + if (value == null) { + throw new NullPointerException(); + } + + plan_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Capacity commitment commitment plan.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearPlan() { + + plan_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the commitment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the commitment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the commitment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.valueOf(state_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the commitment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the commitment.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp commitmentEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitmentEndTimeBuilder_; + /** + * + * + *
+     * 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]; + * + * + * @return Whether the commitmentEndTime field is set. + */ + public boolean hasCommitmentEndTime() { + return commitmentEndTimeBuilder_ != null || commitmentEndTime_ != null; + } + /** + * + * + *
+     * 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]; + * + * + * @return The commitmentEndTime. + */ + public com.google.protobuf.Timestamp getCommitmentEndTime() { + if (commitmentEndTimeBuilder_ == null) { + return commitmentEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentEndTime_; + } else { + return commitmentEndTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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]; + * + */ + public Builder setCommitmentEndTime(com.google.protobuf.Timestamp value) { + if (commitmentEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitmentEndTime_ = value; + onChanged(); + } else { + commitmentEndTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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]; + * + */ + public Builder setCommitmentEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitmentEndTimeBuilder_ == null) { + commitmentEndTime_ = builderForValue.build(); + onChanged(); + } else { + commitmentEndTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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]; + * + */ + public Builder mergeCommitmentEndTime(com.google.protobuf.Timestamp value) { + if (commitmentEndTimeBuilder_ == null) { + if (commitmentEndTime_ != null) { + commitmentEndTime_ = + com.google.protobuf.Timestamp.newBuilder(commitmentEndTime_) + .mergeFrom(value) + .buildPartial(); + } else { + commitmentEndTime_ = value; + } + onChanged(); + } else { + commitmentEndTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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]; + * + */ + public Builder clearCommitmentEndTime() { + if (commitmentEndTimeBuilder_ == null) { + commitmentEndTime_ = null; + onChanged(); + } else { + commitmentEndTime_ = null; + commitmentEndTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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]; + * + */ + public com.google.protobuf.Timestamp.Builder getCommitmentEndTimeBuilder() { + + onChanged(); + return getCommitmentEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCommitmentEndTimeOrBuilder() { + if (commitmentEndTimeBuilder_ != null) { + return commitmentEndTimeBuilder_.getMessageOrBuilder(); + } else { + return commitmentEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitmentEndTime_; + } + } + /** + * + * + *
+     * 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]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitmentEndTimeFieldBuilder() { + if (commitmentEndTimeBuilder_ == null) { + commitmentEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitmentEndTime(), getParentForChildren(), isClean()); + commitmentEndTime_ = null; + } + return commitmentEndTimeBuilder_; + } + + private com.google.rpc.Status failureStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + failureStatusBuilder_; + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the failureStatus field is set. + */ + public boolean hasFailureStatus() { + return failureStatusBuilder_ != null || failureStatus_ != null; + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The failureStatus. + */ + public com.google.rpc.Status getFailureStatus() { + if (failureStatusBuilder_ == null) { + return failureStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : failureStatus_; + } else { + return failureStatusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFailureStatus(com.google.rpc.Status value) { + if (failureStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failureStatus_ = value; + onChanged(); + } else { + failureStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFailureStatus(com.google.rpc.Status.Builder builderForValue) { + if (failureStatusBuilder_ == null) { + failureStatus_ = builderForValue.build(); + onChanged(); + } else { + failureStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeFailureStatus(com.google.rpc.Status value) { + if (failureStatusBuilder_ == null) { + if (failureStatus_ != null) { + failureStatus_ = + com.google.rpc.Status.newBuilder(failureStatus_).mergeFrom(value).buildPartial(); + } else { + failureStatus_ = value; + } + onChanged(); + } else { + failureStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFailureStatus() { + if (failureStatusBuilder_ == null) { + failureStatus_ = null; + onChanged(); + } else { + failureStatus_ = null; + failureStatusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getFailureStatusBuilder() { + + onChanged(); + return getFailureStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getFailureStatusOrBuilder() { + if (failureStatusBuilder_ != null) { + return failureStatusBuilder_.getMessageOrBuilder(); + } else { + return failureStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : failureStatus_; + } + } + /** + * + * + *
+     * Output only. For FAILED commitment plan, provides the reason of failure.
+     * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getFailureStatusFieldBuilder() { + if (failureStatusBuilder_ == null) { + failureStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + getFailureStatus(), getParentForChildren(), isClean()); + failureStatus_ = null; + } + return failureStatusBuilder_; + } + + private int renewalPlan_ = 0; + /** + * + * + *
+     * The plan this capacity commitment is converted to after commitment_end_time
+     * passes. Once the plan is changed, committed period is extended according to
+     * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The enum numeric value on the wire for renewalPlan. + */ + public int getRenewalPlanValue() { + return renewalPlan_; + } + /** + * + * + *
+     * The plan this capacity commitment is converted to after commitment_end_time
+     * passes. Once the plan is changed, committed period is extended according to
+     * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @param value The enum numeric value on the wire for renewalPlan to set. + * @return This builder for chaining. + */ + public Builder setRenewalPlanValue(int value) { + renewalPlan_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The plan this capacity commitment is converted to after commitment_end_time
+     * passes. Once the plan is changed, committed period is extended according to
+     * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The renewalPlan. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + getRenewalPlan() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan result = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.valueOf( + renewalPlan_); + return result == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The plan this capacity commitment is converted to after commitment_end_time
+     * passes. Once the plan is changed, committed period is extended according to
+     * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @param value The renewalPlan to set. + * @return This builder for chaining. + */ + public Builder setRenewalPlan( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan value) { + if (value == null) { + throw new NullPointerException(); + } + + renewalPlan_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The plan this capacity commitment is converted to after commitment_end_time
+     * passes. Once the plan is changed, committed period is extended according to
+     * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+     * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return This builder for chaining. + */ + public Builder clearRenewalPlan() { + + renewalPlan_ = 0; + 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.CapacityCommitment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.CapacityCommitment) + private static final com.google.cloud.bigquery.reservation.v1.CapacityCommitment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.CapacityCommitment(); + } + + public static com.google.cloud.bigquery.reservation.v1.CapacityCommitment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CapacityCommitment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CapacityCommitment(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.CapacityCommitment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentName.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentName.java new file mode 100644 index 00000000..a86738de --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentName.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CapacityCommitmentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String capacityCommitment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCapacityCommitment() { + return capacityCommitment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private CapacityCommitmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + capacityCommitment = Preconditions.checkNotNull(builder.getCapacityCommitment()); + } + + public static CapacityCommitmentName of( + String project, String location, String capacityCommitment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCapacityCommitment(capacityCommitment) + .build(); + } + + public static String format(String project, String location, String capacityCommitment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCapacityCommitment(capacityCommitment) + .build() + .toString(); + } + + public static CapacityCommitmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "CapacityCommitmentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("capacity_commitment")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (CapacityCommitmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("capacityCommitment", capacityCommitment); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "capacity_commitment", capacityCommitment); + } + + /** Builder for CapacityCommitmentName. */ + public static class Builder { + + private String project; + private String location; + private String capacityCommitment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCapacityCommitment() { + return capacityCommitment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCapacityCommitment(String capacityCommitment) { + this.capacityCommitment = capacityCommitment; + return this; + } + + private Builder() {} + + private Builder(CapacityCommitmentName capacityCommitmentName) { + project = capacityCommitmentName.project; + location = capacityCommitmentName.location; + capacityCommitment = capacityCommitmentName.capacityCommitment; + } + + public CapacityCommitmentName build() { + return new CapacityCommitmentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CapacityCommitmentName) { + CapacityCommitmentName that = (CapacityCommitmentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.capacityCommitment.equals(that.capacityCommitment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= capacityCommitment.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java new file mode 100644 index 00000000..b096c809 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CapacityCommitmentOrBuilder.java @@ -0,0 +1,232 @@ +/* + * 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 CapacityCommitmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.CapacityCommitment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the capacity commitment, e.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the capacity commitment, e.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Number of slots in this commitment.
+   * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + long getSlotCount(); + + /** + * + * + *
+   * Capacity commitment commitment plan.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * @return The enum numeric value on the wire for plan. + */ + int getPlanValue(); + /** + * + * + *
+   * Capacity commitment commitment plan.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3; + * + * @return The plan. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan getPlan(); + + /** + * + * + *
+   * Output only. State of the commitment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the commitment.
+   * 
+ * + * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.State getState(); + + /** + * + * + *
+   * 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]; + * + * + * @return Whether the commitmentEndTime field is set. + */ + boolean hasCommitmentEndTime(); + /** + * + * + *
+   * 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]; + * + * + * @return The commitmentEndTime. + */ + com.google.protobuf.Timestamp getCommitmentEndTime(); + /** + * + * + *
+   * 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]; + * + */ + com.google.protobuf.TimestampOrBuilder getCommitmentEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the failureStatus field is set. + */ + boolean hasFailureStatus(); + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The failureStatus. + */ + com.google.rpc.Status getFailureStatus(); + /** + * + * + *
+   * Output only. For FAILED commitment plan, provides the reason of failure.
+   * 
+ * + * .google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getFailureStatusOrBuilder(); + + /** + * + * + *
+   * The plan this capacity commitment is converted to after commitment_end_time
+   * passes. Once the plan is changed, committed period is extended according to
+   * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The enum numeric value on the wire for renewalPlan. + */ + int getRenewalPlanValue(); + /** + * + * + *
+   * The plan this capacity commitment is converted to after commitment_end_time
+   * passes. Once the plan is changed, committed period is extended according to
+   * commitment plan. Only applicable for MONTHLY and ANNUAL commitments.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8; + * + * + * @return The renewalPlan. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan getRenewalPlan(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java new file mode 100644 index 00000000..ef2f791f --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequest.java @@ -0,0 +1,943 @@ +/* + * 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.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment].
+ * Note: "bigquery.reservationAssignments.create" permission is required on the
+ * related assignee.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} + */ +public final class CreateAssignmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + CreateAssignmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAssignmentRequest.newBuilder() to construct. + private CreateAssignmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAssignmentRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAssignmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAssignmentRequest( + 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: + { + com.google.cloud.bigquery.reservation.v1.Assignment.Builder subBuilder = null; + if (assignment_ != null) { + subBuilder = assignment_.toBuilder(); + } + assignment_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.Assignment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(assignment_); + assignment_ = subBuilder.buildPartial(); + } + + 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_CreateAssignmentRequest_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_CreateAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name of the assignment
+   * E.g.: projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * 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) { + 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 parent resource name of the assignment
+   * E.g.: projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * 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 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 ASSIGNMENT_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.reservation.v1.Assignment assignment_; + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return Whether the assignment field is set. + */ + public boolean hasAssignment() { + return assignment_ != null; + } + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return The assignment. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment getAssignment() { + return assignment_ == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance() + : assignment_; + } + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentOrBuilder() { + return getAssignment(); + } + + 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 (assignment_ != null) { + output.writeMessage(2, getAssignment()); + } + 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 (assignment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAssignment()); + } + 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.CreateAssignmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest other = + (com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAssignment() != other.hasAssignment()) return false; + if (hasAssignment()) { + if (!getAssignment().equals(other.getAssignment())) 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(); + if (hasAssignment()) { + hash = (37 * hash) + ASSIGNMENT_FIELD_NUMBER; + hash = (53 * hash) + getAssignment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest 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.CreateAssignmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest 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.CreateAssignmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignmentRequest 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.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment].
+   * Note: "bigquery.reservationAssignments.create" permission is required on the
+   * related assignee.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_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_CreateAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.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_ = ""; + + if (assignmentBuilder_ == null) { + assignment_ = null; + } else { + assignment_ = null; + assignmentBuilder_ = null; + } + 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_CreateAssignmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest build() { + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest result = + new com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(this); + result.parent_ = parent_; + if (assignmentBuilder_ == null) { + result.assignment_ = assignment_; + } else { + result.assignment_ = assignmentBuilder_.build(); + } + 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.CreateAssignmentRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasAssignment()) { + mergeAssignment(other.getAssignment()); + } + 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.CreateAssignmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name of the assignment
+     * E.g.: projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * 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 parent resource name of the assignment
+     * E.g.: projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * 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 parent resource name of the assignment
+     * E.g.: projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * 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 parent resource name of the assignment
+     * E.g.: projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * 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 parent resource name of the assignment
+     * E.g.: projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * 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 com.google.cloud.bigquery.reservation.v1.Assignment assignment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder> + assignmentBuilder_; + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return Whether the assignment field is set. + */ + public boolean hasAssignment() { + return assignmentBuilder_ != null || assignment_ != null; + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return The assignment. + */ + public com.google.cloud.bigquery.reservation.v1.Assignment getAssignment() { + if (assignmentBuilder_ == null) { + return assignment_ == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance() + : assignment_; + } else { + return assignmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public Builder setAssignment(com.google.cloud.bigquery.reservation.v1.Assignment value) { + if (assignmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + assignment_ = value; + onChanged(); + } else { + assignmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public Builder setAssignment( + com.google.cloud.bigquery.reservation.v1.Assignment.Builder builderForValue) { + if (assignmentBuilder_ == null) { + assignment_ = builderForValue.build(); + onChanged(); + } else { + assignmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public Builder mergeAssignment(com.google.cloud.bigquery.reservation.v1.Assignment value) { + if (assignmentBuilder_ == null) { + if (assignment_ != null) { + assignment_ = + com.google.cloud.bigquery.reservation.v1.Assignment.newBuilder(assignment_) + .mergeFrom(value) + .buildPartial(); + } else { + assignment_ = value; + } + onChanged(); + } else { + assignmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public Builder clearAssignment() { + if (assignmentBuilder_ == null) { + assignment_ = null; + onChanged(); + } else { + assignment_ = null; + assignmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public com.google.cloud.bigquery.reservation.v1.Assignment.Builder getAssignmentBuilder() { + + onChanged(); + return getAssignmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + public com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentOrBuilder() { + if (assignmentBuilder_ != null) { + return assignmentBuilder_.getMessageOrBuilder(); + } else { + return assignment_ == null + ? com.google.cloud.bigquery.reservation.v1.Assignment.getDefaultInstance() + : assignment_; + } + } + /** + * + * + *
+     * Assignment resource to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder> + getAssignmentFieldBuilder() { + if (assignmentBuilder_ == null) { + assignmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Assignment, + com.google.cloud.bigquery.reservation.v1.Assignment.Builder, + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder>( + getAssignment(), getParentForChildren(), isClean()); + assignment_ = null; + } + return assignmentBuilder_; + } + + @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.CreateAssignmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAssignmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAssignmentRequest(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.CreateAssignmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java new file mode 100644 index 00000000..061840a2 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateAssignmentRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * 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 CreateAssignmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name of the assignment
+   * E.g.: projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name of the assignment
+   * E.g.: projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return Whether the assignment field is set. + */ + boolean hasAssignment(); + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + * + * @return The assignment. + */ + com.google.cloud.bigquery.reservation.v1.Assignment getAssignment(); + /** + * + * + *
+   * Assignment resource to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Assignment assignment = 2; + */ + com.google.cloud.bigquery.reservation.v1.AssignmentOrBuilder getAssignmentOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequest.java new file mode 100644 index 00000000..b4b51e0e --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequest.java @@ -0,0 +1,1125 @@ +/* + * 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.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CreateReservationRequest} + */ +public final class CreateReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.CreateReservationRequest) + CreateReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateReservationRequest.newBuilder() to construct. + private CreateReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateReservationRequest() { + parent_ = ""; + reservationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateReservationRequest( + 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(); + + reservationId_ = s; + break; + } + case 26: + { + com.google.cloud.bigquery.reservation.v1.Reservation.Builder subBuilder = null; + if (reservation_ != null) { + subBuilder = reservation_.toBuilder(); + } + reservation_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.Reservation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(reservation_); + reservation_ = subBuilder.buildPartial(); + } + + 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_CreateReservationRequest_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_CreateReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Project, location. E.g.,
+   *    projects/myproject/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) { + 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. Project, location. E.g.,
+   *    projects/myproject/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 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 RESERVATION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object reservationId_; + /** + * + * + *
+   * The reservation ID. This field must only contain lower case alphanumeric
+   * characters or dash. Max length is 64 characters.
+   * 
+ * + * string reservation_id = 2; + * + * @return The reservationId. + */ + public java.lang.String getReservationId() { + java.lang.Object ref = reservationId_; + 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(); + reservationId_ = s; + return s; + } + } + /** + * + * + *
+   * The reservation ID. This field must only contain lower case alphanumeric
+   * characters or dash. Max length is 64 characters.
+   * 
+ * + * string reservation_id = 2; + * + * @return The bytes for reservationId. + */ + public com.google.protobuf.ByteString getReservationIdBytes() { + java.lang.Object ref = reservationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESERVATION_FIELD_NUMBER = 3; + private com.google.cloud.bigquery.reservation.v1.Reservation reservation_; + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return Whether the reservation field is set. + */ + public boolean hasReservation() { + return reservation_ != null; + } + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return The reservation. + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservation() { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder() { + return getReservation(); + } + + 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 (!getReservationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, reservationId_); + } + if (reservation_ != null) { + output.writeMessage(3, getReservation()); + } + 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 (!getReservationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, reservationId_); + } + if (reservation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReservation()); + } + 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.CreateReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.CreateReservationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getReservationId().equals(other.getReservationId())) return false; + if (hasReservation() != other.hasReservation()) return false; + if (hasReservation()) { + if (!getReservation().equals(other.getReservation())) 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) + RESERVATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getReservationId().hashCode(); + if (hasReservation()) { + hash = (37 * hash) + RESERVATION_FIELD_NUMBER; + hash = (53 * hash) + getReservation().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.CreateReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateReservationRequest 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.CreateReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateReservationRequest 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.CreateReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateReservationRequest 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.CreateReservationRequest 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.CreateReservationRequest 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.CreateReservationRequest + 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.CreateReservationRequest + 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.CreateReservationRequest 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.CreateReservationRequest 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.CreateReservationRequest 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.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.CreateReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.CreateReservationRequest) + com.google.cloud.bigquery.reservation.v1.CreateReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_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_CreateReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.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_ = ""; + + reservationId_ = ""; + + if (reservationBuilder_ == null) { + reservation_ = null; + } else { + reservation_ = null; + reservationBuilder_ = null; + } + 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_CreateReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.CreateReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.CreateReservationRequest(this); + result.parent_ = parent_; + result.reservationId_ = reservationId_; + if (reservationBuilder_ == null) { + result.reservation_ = reservation_; + } else { + result.reservation_ = reservationBuilder_.build(); + } + 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.CreateReservationRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.CreateReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.CreateReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.CreateReservationRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getReservationId().isEmpty()) { + reservationId_ = other.reservationId_; + onChanged(); + } + if (other.hasReservation()) { + mergeReservation(other.getReservation()); + } + 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.CreateReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.CreateReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Project, location. E.g.,
+     *    projects/myproject/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. Project, location. E.g.,
+     *    projects/myproject/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. Project, location. E.g.,
+     *    projects/myproject/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. Project, location. E.g.,
+     *    projects/myproject/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. Project, location. E.g.,
+     *    projects/myproject/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 reservationId_ = ""; + /** + * + * + *
+     * The reservation ID. This field must only contain lower case alphanumeric
+     * characters or dash. Max length is 64 characters.
+     * 
+ * + * string reservation_id = 2; + * + * @return The reservationId. + */ + public java.lang.String getReservationId() { + java.lang.Object ref = reservationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reservationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reservation ID. This field must only contain lower case alphanumeric
+     * characters or dash. Max length is 64 characters.
+     * 
+ * + * string reservation_id = 2; + * + * @return The bytes for reservationId. + */ + public com.google.protobuf.ByteString getReservationIdBytes() { + java.lang.Object ref = reservationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reservation ID. This field must only contain lower case alphanumeric
+     * characters or dash. Max length is 64 characters.
+     * 
+ * + * string reservation_id = 2; + * + * @param value The reservationId to set. + * @return This builder for chaining. + */ + public Builder setReservationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reservationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reservation ID. This field must only contain lower case alphanumeric
+     * characters or dash. Max length is 64 characters.
+     * 
+ * + * string reservation_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearReservationId() { + + reservationId_ = getDefaultInstance().getReservationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reservation ID. This field must only contain lower case alphanumeric
+     * characters or dash. Max length is 64 characters.
+     * 
+ * + * string reservation_id = 2; + * + * @param value The bytes for reservationId to set. + * @return This builder for chaining. + */ + public Builder setReservationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reservationId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.reservation.v1.Reservation reservation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + reservationBuilder_; + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return Whether the reservation field is set. + */ + public boolean hasReservation() { + return reservationBuilder_ != null || reservation_ != null; + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return The reservation. + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservation() { + if (reservationBuilder_ == null) { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } else { + return reservationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public Builder setReservation(com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reservation_ = value; + onChanged(); + } else { + reservationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public Builder setReservation( + com.google.cloud.bigquery.reservation.v1.Reservation.Builder builderForValue) { + if (reservationBuilder_ == null) { + reservation_ = builderForValue.build(); + onChanged(); + } else { + reservationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public Builder mergeReservation(com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationBuilder_ == null) { + if (reservation_ != null) { + reservation_ = + com.google.cloud.bigquery.reservation.v1.Reservation.newBuilder(reservation_) + .mergeFrom(value) + .buildPartial(); + } else { + reservation_ = value; + } + onChanged(); + } else { + reservationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public Builder clearReservation() { + if (reservationBuilder_ == null) { + reservation_ = null; + onChanged(); + } else { + reservation_ = null; + reservationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation.Builder getReservationBuilder() { + + onChanged(); + return getReservationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder() { + if (reservationBuilder_ != null) { + return reservationBuilder_.getMessageOrBuilder(); + } else { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } + } + /** + * + * + *
+     * Content of the new reservation to create.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + getReservationFieldBuilder() { + if (reservationBuilder_ == null) { + reservationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder>( + getReservation(), getParentForChildren(), isClean()); + reservation_ = null; + } + return reservationBuilder_; + } + + @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.CreateReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.CreateReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.CreateReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.CreateReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.CreateReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateReservationRequest(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.CreateReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequestOrBuilder.java new file mode 100644 index 00000000..4d95c97e --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/CreateReservationRequestOrBuilder.java @@ -0,0 +1,118 @@ +/* + * 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 CreateReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.CreateReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project, location. E.g.,
+   *    projects/myproject/locations/US
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Project, location. E.g.,
+   *    projects/myproject/locations/US
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The reservation ID. This field must only contain lower case alphanumeric
+   * characters or dash. Max length is 64 characters.
+   * 
+ * + * string reservation_id = 2; + * + * @return The reservationId. + */ + java.lang.String getReservationId(); + /** + * + * + *
+   * The reservation ID. This field must only contain lower case alphanumeric
+   * characters or dash. Max length is 64 characters.
+   * 
+ * + * string reservation_id = 2; + * + * @return The bytes for reservationId. + */ + com.google.protobuf.ByteString getReservationIdBytes(); + + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return Whether the reservation field is set. + */ + boolean hasReservation(); + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + * + * @return The reservation. + */ + com.google.cloud.bigquery.reservation.v1.Reservation getReservation(); + /** + * + * + *
+   * Content of the new reservation to create.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 3; + */ + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequest.java new file mode 100644 index 00000000..8973b37f --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequest.java @@ -0,0 +1,667 @@ +/* + * 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.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment].
+ * Note: "bigquery.reservationAssignments.delete" permission is required on the
+ * related assignee.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} + */ +public final class DeleteAssignmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + DeleteAssignmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAssignmentRequest.newBuilder() to construct. + private DeleteAssignmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAssignmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAssignmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAssignmentRequest( + 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(); + + name_ = 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_DeleteAssignmentRequest_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_DeleteAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the resource, e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource, e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.DeleteAssignmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest other = + (com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest 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.DeleteAssignmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest 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.DeleteAssignmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignmentRequest 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.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment].
+   * Note: "bigquery.reservationAssignments.delete" permission is required on the
+   * related assignee.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_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_DeleteAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.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(); + name_ = ""; + + 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_DeleteAssignmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest build() { + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest result = + new com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(this); + result.name_ = name_; + 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.DeleteAssignmentRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteAssignmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource, e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource, e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource, e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource, e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource, e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteAssignmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAssignmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAssignmentRequest(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.DeleteAssignmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequestOrBuilder.java new file mode 100644 index 00000000..0a9347eb --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteAssignmentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 DeleteAssignmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource, e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource, e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java new file mode 100644 index 00000000..0e95fcd7 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequest.java @@ -0,0 +1,673 @@ +/* + * 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.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} + */ +public final class DeleteCapacityCommitmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + DeleteCapacityCommitmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteCapacityCommitmentRequest.newBuilder() to construct. + private DeleteCapacityCommitmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteCapacityCommitmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteCapacityCommitmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteCapacityCommitmentRequest( + 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(); + + name_ = 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_DeleteCapacityCommitmentRequest_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_DeleteCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the capacity commitment to delete. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the capacity commitment to delete. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.DeleteCapacityCommitmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest other = + (com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest + 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.DeleteCapacityCommitmentRequest + 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.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitmentRequest 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.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_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_DeleteCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.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(); + name_ = ""; + + 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_DeleteCapacityCommitmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest build() { + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest result = + new com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(this); + result.name_ = name_; + 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.DeleteCapacityCommitmentRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteCapacityCommitmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the capacity commitment to delete. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to delete. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to delete. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to delete. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to delete. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteCapacityCommitmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCapacityCommitmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteCapacityCommitmentRequest(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.DeleteCapacityCommitmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java new file mode 100644 index 00000000..96145b28 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteCapacityCommitmentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 DeleteCapacityCommitmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the capacity commitment to delete. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the capacity commitment to delete. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequest.java new file mode 100644 index 00000000..6c2116b6 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequest.java @@ -0,0 +1,665 @@ +/* + * 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.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteReservationRequest} + */ +public final class DeleteReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + DeleteReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteReservationRequest.newBuilder() to construct. + private DeleteReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteReservationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteReservationRequest( + 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(); + + name_ = 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_DeleteReservationRequest_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_DeleteReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.DeleteReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest 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.DeleteReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest 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.DeleteReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest 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.DeleteReservationRequest 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.DeleteReservationRequest 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.DeleteReservationRequest + 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.DeleteReservationRequest + 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.DeleteReservationRequest 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.DeleteReservationRequest 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.DeleteReservationRequest 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.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.DeleteReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_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_DeleteReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.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(); + name_ = ""; + + 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_DeleteReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(this); + result.name_ = name_; + 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.DeleteReservationRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.DeleteReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteReservationRequest(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.DeleteReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequestOrBuilder.java new file mode 100644 index 00000000..4d4e0ba4 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/DeleteReservationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 DeleteReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java new file mode 100644 index 00000000..bbf1a368 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequest.java @@ -0,0 +1,663 @@ +/* + * 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; + +/** + * + * + *
+ * A request to get a singleton BI reservation.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetBiReservationRequest} + */ +public final class GetBiReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + GetBiReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBiReservationRequest.newBuilder() to construct. + private GetBiReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBiReservationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBiReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBiReservationRequest( + 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(); + + name_ = 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_GetBiReservationRequest_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_GetBiReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the requested reservation, for example:
+   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the requested reservation, for example:
+   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.GetBiReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest 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.GetBiReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest 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.GetBiReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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.GetBiReservationRequest 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; + } + /** + * + * + *
+   * A request to get a singleton BI reservation.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetBiReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_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_GetBiReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.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(); + name_ = ""; + + 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_GetBiReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(this); + result.name_ = name_; + 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.GetBiReservationRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.GetBiReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested reservation, for example:
+     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested reservation, for example:
+     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested reservation, for example:
+     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested reservation, for example:
+     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested reservation, for example:
+     * `projects/{project_id}/locations/{location_id}/bireservation`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.GetBiReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.GetBiReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBiReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBiReservationRequest(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.GetBiReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java new file mode 100644 index 00000000..1d1e119c --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetBiReservationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GetBiReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested reservation, for example:
+   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested reservation, for example:
+   * `projects/{project_id}/locations/{location_id}/bireservation`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequest.java new file mode 100644 index 00000000..36257978 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequest.java @@ -0,0 +1,667 @@ +/* + * 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.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} + */ +public final class GetCapacityCommitmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + GetCapacityCommitmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCapacityCommitmentRequest.newBuilder() to construct. + private GetCapacityCommitmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCapacityCommitmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCapacityCommitmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetCapacityCommitmentRequest( + 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(); + + name_ = 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_GetCapacityCommitmentRequest_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_GetCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the capacity commitment to retrieve. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the capacity commitment to retrieve. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.GetCapacityCommitmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest other = + (com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest + 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.GetCapacityCommitmentRequest + 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.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest 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.GetCapacityCommitmentRequest 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.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_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_GetCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.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(); + name_ = ""; + + 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_GetCapacityCommitmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest build() { + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest result = + new com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(this); + result.name_ = name_; + 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.GetCapacityCommitmentRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.GetCapacityCommitmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the capacity commitment to retrieve. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to retrieve. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to retrieve. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to retrieve. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the capacity commitment to retrieve. E.g.,
+     *    projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.GetCapacityCommitmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCapacityCommitmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCapacityCommitmentRequest(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.GetCapacityCommitmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequestOrBuilder.java new file mode 100644 index 00000000..8c770e2f --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetCapacityCommitmentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GetCapacityCommitmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the capacity commitment to retrieve. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the capacity commitment to retrieve. E.g.,
+   *    projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequest.java new file mode 100644 index 00000000..a7d11021 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequest.java @@ -0,0 +1,662 @@ +/* + * 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.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetReservationRequest} + */ +public final class GetReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.GetReservationRequest) + GetReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetReservationRequest.newBuilder() to construct. + private GetReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetReservationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetReservationRequest( + 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(); + + name_ = 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_GetReservationRequest_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_GetReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.GetReservationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.GetReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.GetReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.GetReservationRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.GetReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetReservationRequest 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.GetReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetReservationRequest 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.GetReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservationRequest 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.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.GetReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.GetReservationRequest) + com.google.cloud.bigquery.reservation.v1.GetReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_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_GetReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.GetReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.GetReservationRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.GetReservationRequest.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(); + name_ = ""; + + 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_GetReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.GetReservationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.GetReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.GetReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.GetReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.GetReservationRequest(this); + result.name_ = name_; + 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.GetReservationRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.GetReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.GetReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.GetReservationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.GetReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.GetReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the reservation to retrieve. E.g.,
+     *    projects/myproject/locations/US/reservations/team1-prod
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.GetReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.GetReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.GetReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.GetReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.GetReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetReservationRequest(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.GetReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequestOrBuilder.java new file mode 100644 index 00000000..228d294e --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/GetReservationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GetReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.GetReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the reservation to retrieve. E.g.,
+   *    projects/myproject/locations/US/reservations/team1-prod
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequest.java new file mode 100644 index 00000000..147bf6f6 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequest.java @@ -0,0 +1,942 @@ +/* + * 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.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} + */ +public final class ListAssignmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + ListAssignmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssignmentsRequest.newBuilder() to construct. + private ListAssignmentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssignmentsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssignmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssignmentsRequest( + 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 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + 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_ListAssignmentsRequest_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_ListAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name e.g.:
+   * projects/myproject/locations/US/reservations/team1-prod
+   * Or:
+   * projects/myproject/locations/US/reservations/-
+   * 
+ * + * + * 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) { + 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 parent resource name e.g.:
+   * projects/myproject/locations/US/reservations/team1-prod
+   * Or:
+   * projects/myproject/locations/US/reservations/-
+   * 
+ * + * + * 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 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + 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 = 3; + * + * @return The bytes for pageToken. + */ + 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 (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.ListAssignmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest other = + (com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) obj; + + if (!getParent().equals(other.getParent())) 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) + 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.ListAssignmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest 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.ListAssignmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest 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.ListAssignmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignmentsRequest 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.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_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_ListAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.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_ = ""; + + 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_ListAssignmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest build() { + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest result = + new com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(this); + result.parent_ = parent_; + 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.ListAssignmentsRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.ListAssignmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name e.g.:
+     * projects/myproject/locations/US/reservations/team1-prod
+     * Or:
+     * projects/myproject/locations/US/reservations/-
+     * 
+ * + * + * 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 parent resource name e.g.:
+     * projects/myproject/locations/US/reservations/team1-prod
+     * Or:
+     * projects/myproject/locations/US/reservations/-
+     * 
+ * + * + * 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 parent resource name e.g.:
+     * projects/myproject/locations/US/reservations/team1-prod
+     * Or:
+     * projects/myproject/locations/US/reservations/-
+     * 
+ * + * + * 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 parent resource name e.g.:
+     * projects/myproject/locations/US/reservations/team1-prod
+     * Or:
+     * projects/myproject/locations/US/reservations/-
+     * 
+ * + * + * 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 parent resource name e.g.:
+     * projects/myproject/locations/US/reservations/team1-prod
+     * Or:
+     * projects/myproject/locations/US/reservations/-
+     * 
+ * + * + * 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 int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @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.
+     * 
+ * + * int32 page_size = 2; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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.ListAssignmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + private static final com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssignmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssignmentsRequest(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.ListAssignmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequestOrBuilder.java new file mode 100644 index 00000000..8b3f93aa --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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 ListAssignmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name e.g.:
+   * projects/myproject/locations/US/reservations/team1-prod
+   * Or:
+   * projects/myproject/locations/US/reservations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name e.g.:
+   * projects/myproject/locations/US/reservations/team1-prod
+   * Or:
+   * projects/myproject/locations/US/reservations/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponse.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponse.java new file mode 100644 index 00000000..29f77196 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponse.java @@ -0,0 +1,1149 @@ +/* + * 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.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} + */ +public final class ListAssignmentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + ListAssignmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssignmentsResponse.newBuilder() to construct. + private ListAssignmentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssignmentsResponse() { + assignments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssignmentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssignmentsResponse( + 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_ListAssignmentsResponse_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_ListAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.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; + */ + public java.util.List getAssignmentsList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public java.util.List + getAssignmentsOrBuilderList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public int getAssignmentsCount() { + return assignments_.size(); + } + /** + * + * + *
+   * 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) { + return assignments_.get(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) { + 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. + */ + 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. + */ + 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.ListAssignmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse other = + (com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) 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.ListAssignmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse 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.ListAssignmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse 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.ListAssignmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignmentsResponse 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.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_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_ListAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.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_ListAssignmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse build() { + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse result = + new com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(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.ListAssignmentsResponse) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.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.ListAssignmentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + 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.ListAssignmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + private static final com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssignmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssignmentsResponse(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.ListAssignmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponseOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponseOrBuilder.java new file mode 100644 index 00000000..d401a63b --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListAssignmentsResponseOrBuilder.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 ListAssignmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + 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-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequest.java new file mode 100644 index 00000000..dd1dd512 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequest.java @@ -0,0 +1,937 @@ +/* + * 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.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} + */ +public final class ListCapacityCommitmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + ListCapacityCommitmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCapacityCommitmentsRequest.newBuilder() to construct. + private ListCapacityCommitmentsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCapacityCommitmentsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCapacityCommitmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCapacityCommitmentsRequest( + 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 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + 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_ListCapacityCommitmentsRequest_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_ListCapacityCommitmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name of the parent reservation. E.g.,
+   *    projects/myproject/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) { + 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. Resource name of the parent reservation. E.g.,
+   *    projects/myproject/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 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + 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 = 3; + * + * @return The bytes for pageToken. + */ + 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 (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.ListCapacityCommitmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest other = + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) obj; + + if (!getParent().equals(other.getParent())) 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) + 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.ListCapacityCommitmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest + 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.ListCapacityCommitmentsRequest + 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.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest 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.ListCapacityCommitmentsRequest 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.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_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_ListCapacityCommitmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.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_ = ""; + + 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_ListCapacityCommitmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest build() { + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest result = + new com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(this); + result.parent_ = parent_; + 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.ListCapacityCommitmentsRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.ListCapacityCommitmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name of the parent reservation. E.g.,
+     *    projects/myproject/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. Resource name of the parent reservation. E.g.,
+     *    projects/myproject/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. Resource name of the parent reservation. E.g.,
+     *    projects/myproject/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. Resource name of the parent reservation. E.g.,
+     *    projects/myproject/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. Resource name of the parent reservation. E.g.,
+     *    projects/myproject/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 int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @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.
+     * 
+ * + * int32 page_size = 2; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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.ListCapacityCommitmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + private static final com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCapacityCommitmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCapacityCommitmentsRequest(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.ListCapacityCommitmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequestOrBuilder.java new file mode 100644 index 00000000..698f9d27 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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 ListCapacityCommitmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the parent reservation. E.g.,
+   *    projects/myproject/locations/US
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name of the parent reservation. E.g.,
+   *    projects/myproject/locations/US
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponse.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponse.java new file mode 100644 index 00000000..8536593d --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponse.java @@ -0,0 +1,1223 @@ +/* + * 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.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} + */ +public final class ListCapacityCommitmentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + ListCapacityCommitmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCapacityCommitmentsResponse.newBuilder() to construct. + private ListCapacityCommitmentsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCapacityCommitmentsResponse() { + capacityCommitments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCapacityCommitmentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCapacityCommitmentsResponse( + 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)) { + capacityCommitments_ = + new java.util.ArrayList< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment>(); + mutable_bitField0_ |= 0x00000001; + } + capacityCommitments_.add( + input.readMessage( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.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)) { + capacityCommitments_ = java.util.Collections.unmodifiableList(capacityCommitments_); + } + 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_ListCapacityCommitmentsResponse_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_ListCapacityCommitmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.Builder.class); + } + + public static final int CAPACITY_COMMITMENTS_FIELD_NUMBER = 1; + private java.util.List + capacityCommitments_; + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public java.util.List + getCapacityCommitmentsList() { + return capacityCommitments_; + } + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getCapacityCommitmentsOrBuilderList() { + return capacityCommitments_; + } + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public int getCapacityCommitmentsCount() { + return capacityCommitments_.size(); + } + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitments( + int index) { + return capacityCommitments_.get(index); + } + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentsOrBuilder(int index) { + return capacityCommitments_.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. + */ + 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. + */ + 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 < capacityCommitments_.size(); i++) { + output.writeMessage(1, capacityCommitments_.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 < capacityCommitments_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, capacityCommitments_.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.ListCapacityCommitmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse other = + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) obj; + + if (!getCapacityCommitmentsList().equals(other.getCapacityCommitmentsList())) 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 (getCapacityCommitmentsCount() > 0) { + hash = (37 * hash) + CAPACITY_COMMITMENTS_FIELD_NUMBER; + hash = (53 * hash) + getCapacityCommitmentsList().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.ListCapacityCommitmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse + 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.ListCapacityCommitmentsResponse + 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.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse 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.ListCapacityCommitmentsResponse 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.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_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_ListCapacityCommitmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCapacityCommitmentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (capacityCommitmentsBuilder_ == null) { + capacityCommitments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + capacityCommitmentsBuilder_.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_ListCapacityCommitmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse build() { + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse result = + new com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(this); + int from_bitField0_ = bitField0_; + if (capacityCommitmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + capacityCommitments_ = java.util.Collections.unmodifiableList(capacityCommitments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.capacityCommitments_ = capacityCommitments_; + } else { + result.capacityCommitments_ = capacityCommitmentsBuilder_.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.ListCapacityCommitmentsResponse) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + .getDefaultInstance()) return this; + if (capacityCommitmentsBuilder_ == null) { + if (!other.capacityCommitments_.isEmpty()) { + if (capacityCommitments_.isEmpty()) { + capacityCommitments_ = other.capacityCommitments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.addAll(other.capacityCommitments_); + } + onChanged(); + } + } else { + if (!other.capacityCommitments_.isEmpty()) { + if (capacityCommitmentsBuilder_.isEmpty()) { + capacityCommitmentsBuilder_.dispose(); + capacityCommitmentsBuilder_ = null; + capacityCommitments_ = other.capacityCommitments_; + bitField0_ = (bitField0_ & ~0x00000001); + capacityCommitmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCapacityCommitmentsFieldBuilder() + : null; + } else { + capacityCommitmentsBuilder_.addAllMessages(other.capacityCommitments_); + } + } + } + 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.ListCapacityCommitmentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + capacityCommitments_ = java.util.Collections.emptyList(); + + private void ensureCapacityCommitmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + capacityCommitments_ = + new java.util.ArrayList( + capacityCommitments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + capacityCommitmentsBuilder_; + + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public java.util.List + getCapacityCommitmentsList() { + if (capacityCommitmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(capacityCommitments_); + } else { + return capacityCommitmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public int getCapacityCommitmentsCount() { + if (capacityCommitmentsBuilder_ == null) { + return capacityCommitments_.size(); + } else { + return capacityCommitmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitments( + int index) { + if (capacityCommitmentsBuilder_ == null) { + return capacityCommitments_.get(index); + } else { + return capacityCommitmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder setCapacityCommitments( + int index, com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (capacityCommitmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.set(index, value); + onChanged(); + } else { + capacityCommitmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder setCapacityCommitments( + int index, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (capacityCommitmentsBuilder_ == null) { + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.set(index, builderForValue.build()); + onChanged(); + } else { + capacityCommitmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder addCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (capacityCommitmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.add(value); + onChanged(); + } else { + capacityCommitmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder addCapacityCommitments( + int index, com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (capacityCommitmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.add(index, value); + onChanged(); + } else { + capacityCommitmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder addCapacityCommitments( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (capacityCommitmentsBuilder_ == null) { + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.add(builderForValue.build()); + onChanged(); + } else { + capacityCommitmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder addCapacityCommitments( + int index, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (capacityCommitmentsBuilder_ == null) { + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.add(index, builderForValue.build()); + onChanged(); + } else { + capacityCommitmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder addAllCapacityCommitments( + java.lang.Iterable + values) { + if (capacityCommitmentsBuilder_ == null) { + ensureCapacityCommitmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, capacityCommitments_); + onChanged(); + } else { + capacityCommitmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder clearCapacityCommitments() { + if (capacityCommitmentsBuilder_ == null) { + capacityCommitments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + capacityCommitmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public Builder removeCapacityCommitments(int index) { + if (capacityCommitmentsBuilder_ == null) { + ensureCapacityCommitmentsIsMutable(); + capacityCommitments_.remove(index); + onChanged(); + } else { + capacityCommitmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder + getCapacityCommitmentsBuilder(int index) { + return getCapacityCommitmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentsOrBuilder(int index) { + if (capacityCommitmentsBuilder_ == null) { + return capacityCommitments_.get(index); + } else { + return capacityCommitmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getCapacityCommitmentsOrBuilderList() { + if (capacityCommitmentsBuilder_ != null) { + return capacityCommitmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(capacityCommitments_); + } + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder + addCapacityCommitmentsBuilder() { + return getCapacityCommitmentsFieldBuilder() + .addBuilder( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance()); + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder + addCapacityCommitmentsBuilder(int index) { + return getCapacityCommitmentsFieldBuilder() + .addBuilder( + index, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance()); + } + /** + * + * + *
+     * List of capacity commitments visible to the user.
+     * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + public java.util.List + getCapacityCommitmentsBuilderList() { + return getCapacityCommitmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getCapacityCommitmentsFieldBuilder() { + if (capacityCommitmentsBuilder_ == null) { + capacityCommitmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder>( + capacityCommitments_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + capacityCommitments_ = null; + } + return capacityCommitmentsBuilder_; + } + + 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.ListCapacityCommitmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + private static final com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCapacityCommitmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCapacityCommitmentsResponse(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.ListCapacityCommitmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponseOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponseOrBuilder.java new file mode 100644 index 00000000..7d3afdf5 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListCapacityCommitmentsResponseOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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 ListCapacityCommitmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + java.util.List + getCapacityCommitmentsList(); + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitments(int index); + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + int getCapacityCommitmentsCount(); + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + java.util.List + getCapacityCommitmentsOrBuilderList(); + /** + * + * + *
+   * List of capacity commitments visible to the user.
+   * 
+ * + * + * repeated .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitments = 1; + * + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentsOrBuilder(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-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequest.java new file mode 100644 index 00000000..f37b4694 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequest.java @@ -0,0 +1,928 @@ +/* + * 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.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListReservationsRequest} + */ +public final class ListReservationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListReservationsRequest) + ListReservationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReservationsRequest.newBuilder() to construct. + private ListReservationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReservationsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReservationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListReservationsRequest( + 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 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + 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_ListReservationsRequest_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_ListReservationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name containing project and location, e.g.:
+   *   "projects/myproject/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) { + 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 parent resource name containing project and location, e.g.:
+   *   "projects/myproject/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 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + 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 = 3; + * + * @return The bytes for pageToken. + */ + 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 (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.ListReservationsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest other = + (com.google.cloud.bigquery.reservation.v1.ListReservationsRequest) obj; + + if (!getParent().equals(other.getParent())) 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) + 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.ListReservationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsRequest 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.ListReservationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsRequest 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.ListReservationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservationsRequest 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.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListReservationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListReservationsRequest) + com.google.cloud.bigquery.reservation.v1.ListReservationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_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_ListReservationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.class, + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.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_ = ""; + + 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_ListReservationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsRequest build() { + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest result = + new com.google.cloud.bigquery.reservation.v1.ListReservationsRequest(this); + result.parent_ = parent_; + 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.ListReservationsRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.ListReservationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListReservationsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListReservationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.ListReservationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListReservationsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name containing project and location, e.g.:
+     *   "projects/myproject/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 parent resource name containing project and location, e.g.:
+     *   "projects/myproject/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 parent resource name containing project and location, e.g.:
+     *   "projects/myproject/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 parent resource name containing project and location, e.g.:
+     *   "projects/myproject/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 parent resource name containing project and location, e.g.:
+     *   "projects/myproject/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 int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @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.
+     * 
+ * + * int32 page_size = 2; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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.ListReservationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListReservationsRequest) + private static final com.google.cloud.bigquery.reservation.v1.ListReservationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.ListReservationsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReservationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListReservationsRequest(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.ListReservationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequestOrBuilder.java new file mode 100644 index 00000000..293d51a4 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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 ListReservationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListReservationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name containing project and location, e.g.:
+   *   "projects/myproject/locations/US"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name containing project and location, e.g.:
+   *   "projects/myproject/locations/US"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponse.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponse.java new file mode 100644 index 00000000..7d13a0c8 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponse.java @@ -0,0 +1,1152 @@ +/* + * 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.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListReservationsResponse} + */ +public final class ListReservationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.ListReservationsResponse) + ListReservationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReservationsResponse.newBuilder() to construct. + private ListReservationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReservationsResponse() { + reservations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReservationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListReservationsResponse( + 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)) { + reservations_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + reservations_.add( + input.readMessage( + com.google.cloud.bigquery.reservation.v1.Reservation.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)) { + reservations_ = java.util.Collections.unmodifiableList(reservations_); + } + 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_ListReservationsResponse_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_ListReservationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.Builder.class); + } + + public static final int RESERVATIONS_FIELD_NUMBER = 1; + private java.util.List reservations_; + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public java.util.List + getReservationsList() { + return reservations_; + } + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public java.util.List + getReservationsOrBuilderList() { + return reservations_; + } + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public int getReservationsCount() { + return reservations_.size(); + } + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservations(int index) { + return reservations_.get(index); + } + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationsOrBuilder( + int index) { + return reservations_.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. + */ + 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. + */ + 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 < reservations_.size(); i++) { + output.writeMessage(1, reservations_.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 < reservations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, reservations_.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.ListReservationsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse other = + (com.google.cloud.bigquery.reservation.v1.ListReservationsResponse) obj; + + if (!getReservationsList().equals(other.getReservationsList())) 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 (getReservationsCount() > 0) { + hash = (37 * hash) + RESERVATIONS_FIELD_NUMBER; + hash = (53 * hash) + getReservationsList().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.ListReservationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsResponse 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.ListReservationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsResponse 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.ListReservationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsResponse 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.ListReservationsResponse 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.ListReservationsResponse 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.ListReservationsResponse + 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.ListReservationsResponse + 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.ListReservationsResponse 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.ListReservationsResponse 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.ListReservationsResponse 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.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.ListReservationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.ListReservationsResponse) + com.google.cloud.bigquery.reservation.v1.ListReservationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_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_ListReservationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.class, + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReservationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (reservationsBuilder_ == null) { + reservations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + reservationsBuilder_.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_ListReservationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsResponse build() { + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.ListReservationsResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse result = + new com.google.cloud.bigquery.reservation.v1.ListReservationsResponse(this); + int from_bitField0_ = bitField0_; + if (reservationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + reservations_ = java.util.Collections.unmodifiableList(reservations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reservations_ = reservations_; + } else { + result.reservations_ = reservationsBuilder_.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.ListReservationsResponse) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.ListReservationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.ListReservationsResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.ListReservationsResponse.getDefaultInstance()) + return this; + if (reservationsBuilder_ == null) { + if (!other.reservations_.isEmpty()) { + if (reservations_.isEmpty()) { + reservations_ = other.reservations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReservationsIsMutable(); + reservations_.addAll(other.reservations_); + } + onChanged(); + } + } else { + if (!other.reservations_.isEmpty()) { + if (reservationsBuilder_.isEmpty()) { + reservationsBuilder_.dispose(); + reservationsBuilder_ = null; + reservations_ = other.reservations_; + bitField0_ = (bitField0_ & ~0x00000001); + reservationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReservationsFieldBuilder() + : null; + } else { + reservationsBuilder_.addAllMessages(other.reservations_); + } + } + } + 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.ListReservationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.ListReservationsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List reservations_ = + java.util.Collections.emptyList(); + + private void ensureReservationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reservations_ = + new java.util.ArrayList( + reservations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + reservationsBuilder_; + + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public java.util.List + getReservationsList() { + if (reservationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reservations_); + } else { + return reservationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public int getReservationsCount() { + if (reservationsBuilder_ == null) { + return reservations_.size(); + } else { + return reservationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservations(int index) { + if (reservationsBuilder_ == null) { + return reservations_.get(index); + } else { + return reservationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder setReservations( + int index, com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReservationsIsMutable(); + reservations_.set(index, value); + onChanged(); + } else { + reservationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder setReservations( + int index, com.google.cloud.bigquery.reservation.v1.Reservation.Builder builderForValue) { + if (reservationsBuilder_ == null) { + ensureReservationsIsMutable(); + reservations_.set(index, builderForValue.build()); + onChanged(); + } else { + reservationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder addReservations(com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReservationsIsMutable(); + reservations_.add(value); + onChanged(); + } else { + reservationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder addReservations( + int index, com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReservationsIsMutable(); + reservations_.add(index, value); + onChanged(); + } else { + reservationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder addReservations( + com.google.cloud.bigquery.reservation.v1.Reservation.Builder builderForValue) { + if (reservationsBuilder_ == null) { + ensureReservationsIsMutable(); + reservations_.add(builderForValue.build()); + onChanged(); + } else { + reservationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder addReservations( + int index, com.google.cloud.bigquery.reservation.v1.Reservation.Builder builderForValue) { + if (reservationsBuilder_ == null) { + ensureReservationsIsMutable(); + reservations_.add(index, builderForValue.build()); + onChanged(); + } else { + reservationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder addAllReservations( + java.lang.Iterable values) { + if (reservationsBuilder_ == null) { + ensureReservationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reservations_); + onChanged(); + } else { + reservationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder clearReservations() { + if (reservationsBuilder_ == null) { + reservations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + reservationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public Builder removeReservations(int index) { + if (reservationsBuilder_ == null) { + ensureReservationsIsMutable(); + reservations_.remove(index); + onChanged(); + } else { + reservationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation.Builder getReservationsBuilder( + int index) { + return getReservationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationsOrBuilder( + int index) { + if (reservationsBuilder_ == null) { + return reservations_.get(index); + } else { + return reservationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public java.util.List + getReservationsOrBuilderList() { + if (reservationsBuilder_ != null) { + return reservationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reservations_); + } + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation.Builder addReservationsBuilder() { + return getReservationsFieldBuilder() + .addBuilder(com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance()); + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation.Builder addReservationsBuilder( + int index) { + return getReservationsFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance()); + } + /** + * + * + *
+     * List of reservations visible to the user.
+     * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + public java.util.List + getReservationsBuilderList() { + return getReservationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + getReservationsFieldBuilder() { + if (reservationsBuilder_ == null) { + reservationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder>( + reservations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + reservations_ = null; + } + return reservationsBuilder_; + } + + 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.ListReservationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.ListReservationsResponse) + private static final com.google.cloud.bigquery.reservation.v1.ListReservationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.ListReservationsResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.ListReservationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReservationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListReservationsResponse(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.ListReservationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponseOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponseOrBuilder.java new file mode 100644 index 00000000..894b1ea4 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ListReservationsResponseOrBuilder.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 ListReservationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.ListReservationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + java.util.List getReservationsList(); + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + com.google.cloud.bigquery.reservation.v1.Reservation getReservations(int index); + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + int getReservationsCount(); + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + java.util.List + getReservationsOrBuilderList(); + /** + * + * + *
+   * List of reservations visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Reservation reservations = 1; + */ + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationsOrBuilder(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-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/LocationName.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/LocationName.java new file mode 100644 index 00000000..1f22eedd --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/LocationName.java @@ -0,0 +1,182 @@ +/* + * 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. + */ + +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequest.java new file mode 100644 index 00000000..676caf82 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequest.java @@ -0,0 +1,967 @@ +/* + * 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.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} + */ +public final class MergeCapacityCommitmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + MergeCapacityCommitmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MergeCapacityCommitmentsRequest.newBuilder() to construct. + private MergeCapacityCommitmentsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MergeCapacityCommitmentsRequest() { + parent_ = ""; + capacityCommitmentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MergeCapacityCommitmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MergeCapacityCommitmentsRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + capacityCommitmentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + capacityCommitmentIds_.add(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)) { + capacityCommitmentIds_ = capacityCommitmentIds_.getUnmodifiableView(); + } + 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_MergeCapacityCommitmentsRequest_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_MergeCapacityCommitmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Parent resource that identifies admin project and location e.g.,
+   * projects/myproject/locations/us
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + 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; + } + } + /** + * + * + *
+   * Parent resource that identifies admin project and location e.g.,
+   * projects/myproject/locations/us
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + 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 CAPACITY_COMMITMENT_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList capacityCommitmentIds_; + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return A list containing the capacityCommitmentIds. + */ + public com.google.protobuf.ProtocolStringList getCapacityCommitmentIdsList() { + return capacityCommitmentIds_; + } + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return The count of capacityCommitmentIds. + */ + public int getCapacityCommitmentIdsCount() { + return capacityCommitmentIds_.size(); + } + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the element to return. + * @return The capacityCommitmentIds at the given index. + */ + public java.lang.String getCapacityCommitmentIds(int index) { + return capacityCommitmentIds_.get(index); + } + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the capacityCommitmentIds at the given index. + */ + public com.google.protobuf.ByteString getCapacityCommitmentIdsBytes(int index) { + return capacityCommitmentIds_.getByteString(index); + } + + 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_); + } + for (int i = 0; i < capacityCommitmentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, capacityCommitmentIds_.getRaw(i)); + } + 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_); + } + { + int dataSize = 0; + for (int i = 0; i < capacityCommitmentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(capacityCommitmentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCapacityCommitmentIdsList().size(); + } + 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.MergeCapacityCommitmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest other = + (com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getCapacityCommitmentIdsList().equals(other.getCapacityCommitmentIdsList())) 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(); + if (getCapacityCommitmentIdsCount() > 0) { + hash = (37 * hash) + CAPACITY_COMMITMENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCapacityCommitmentIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest + 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.MergeCapacityCommitmentsRequest + 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.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitmentsRequest 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.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_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_MergeCapacityCommitmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.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_ = ""; + + capacityCommitmentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + 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_MergeCapacityCommitmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest build() { + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest result = + new com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + if (((bitField0_ & 0x00000001) != 0)) { + capacityCommitmentIds_ = capacityCommitmentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.capacityCommitmentIds_ = capacityCommitmentIds_; + 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.MergeCapacityCommitmentsRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.capacityCommitmentIds_.isEmpty()) { + if (capacityCommitmentIds_.isEmpty()) { + capacityCommitmentIds_ = other.capacityCommitmentIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCapacityCommitmentIdsIsMutable(); + capacityCommitmentIds_.addAll(other.capacityCommitmentIds_); + } + 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.MergeCapacityCommitmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Parent resource that identifies admin project and location e.g.,
+     * projects/myproject/locations/us
+     * 
+ * + * string parent = 1 [(.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; + } + } + /** + * + * + *
+     * Parent resource that identifies admin project and location e.g.,
+     * projects/myproject/locations/us
+     * 
+ * + * string parent = 1 [(.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; + } + } + /** + * + * + *
+     * Parent resource that identifies admin project and location e.g.,
+     * projects/myproject/locations/us
+     * 
+ * + * string parent = 1 [(.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; + } + /** + * + * + *
+     * Parent resource that identifies admin project and location e.g.,
+     * projects/myproject/locations/us
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Parent resource that identifies admin project and location e.g.,
+     * projects/myproject/locations/us
+     * 
+ * + * string parent = 1 [(.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 com.google.protobuf.LazyStringList capacityCommitmentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCapacityCommitmentIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + capacityCommitmentIds_ = + new com.google.protobuf.LazyStringArrayList(capacityCommitmentIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return A list containing the capacityCommitmentIds. + */ + public com.google.protobuf.ProtocolStringList getCapacityCommitmentIdsList() { + return capacityCommitmentIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return The count of capacityCommitmentIds. + */ + public int getCapacityCommitmentIdsCount() { + return capacityCommitmentIds_.size(); + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the element to return. + * @return The capacityCommitmentIds at the given index. + */ + public java.lang.String getCapacityCommitmentIds(int index) { + return capacityCommitmentIds_.get(index); + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the capacityCommitmentIds at the given index. + */ + public com.google.protobuf.ByteString getCapacityCommitmentIdsBytes(int index) { + return capacityCommitmentIds_.getByteString(index); + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index to set the value at. + * @param value The capacityCommitmentIds to set. + * @return This builder for chaining. + */ + public Builder setCapacityCommitmentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCapacityCommitmentIdsIsMutable(); + capacityCommitmentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param value The capacityCommitmentIds to add. + * @return This builder for chaining. + */ + public Builder addCapacityCommitmentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCapacityCommitmentIdsIsMutable(); + capacityCommitmentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param values The capacityCommitmentIds to add. + * @return This builder for chaining. + */ + public Builder addAllCapacityCommitmentIds(java.lang.Iterable values) { + ensureCapacityCommitmentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, capacityCommitmentIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearCapacityCommitmentIds() { + capacityCommitmentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Ids of capacity commitments to merge.
+     * These capacity commitments must exist under admin project and location
+     * specified in the parent.
+     * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param value The bytes of the capacityCommitmentIds to add. + * @return This builder for chaining. + */ + public Builder addCapacityCommitmentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCapacityCommitmentIdsIsMutable(); + capacityCommitmentIds_.add(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.MergeCapacityCommitmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + private static final com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MergeCapacityCommitmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MergeCapacityCommitmentsRequest(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.MergeCapacityCommitmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequestOrBuilder.java new file mode 100644 index 00000000..0505a563 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MergeCapacityCommitmentsRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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 MergeCapacityCommitmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Parent resource that identifies admin project and location e.g.,
+   * projects/myproject/locations/us
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Parent resource that identifies admin project and location e.g.,
+   * projects/myproject/locations/us
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return A list containing the capacityCommitmentIds. + */ + java.util.List getCapacityCommitmentIdsList(); + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @return The count of capacityCommitmentIds. + */ + int getCapacityCommitmentIdsCount(); + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the element to return. + * @return The capacityCommitmentIds at the given index. + */ + java.lang.String getCapacityCommitmentIds(int index); + /** + * + * + *
+   * Ids of capacity commitments to merge.
+   * These capacity commitments must exist under admin project and location
+   * specified in the parent.
+   * 
+ * + * repeated string capacity_commitment_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the capacityCommitmentIds at the given index. + */ + com.google.protobuf.ByteString getCapacityCommitmentIdsBytes(int index); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequest.java new file mode 100644 index 00000000..d3b827c3 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequest.java @@ -0,0 +1,863 @@ +/* + * 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.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].
+ * Note: "bigquery.reservationAssignments.create" permission is required on the
+ * destination_id. Note: "bigquery.reservationAssignments.create" and
+ * "bigquery.reservationAssignments.delete" permission is required on the
+ * related assignee.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} + */ +public final class MoveAssignmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + MoveAssignmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MoveAssignmentRequest.newBuilder() to construct. + private MoveAssignmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveAssignmentRequest() { + name_ = ""; + destinationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveAssignmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MoveAssignmentRequest( + 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(); + + name_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + destinationId_ = 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_MoveAssignmentRequest_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_MoveAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the assignment,
+   * e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the assignment,
+   * e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object destinationId_; + /** + * + * + *
+   * The new reservation ID, e.g.:
+   *   projects/myotherproject/locations/US/reservations/team2-prod
+   * 
+ * + * string destination_id = 3; + * + * @return The destinationId. + */ + public java.lang.String getDestinationId() { + java.lang.Object ref = destinationId_; + 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(); + destinationId_ = s; + return s; + } + } + /** + * + * + *
+   * The new reservation ID, e.g.:
+   *   projects/myotherproject/locations/US/reservations/team2-prod
+   * 
+ * + * string destination_id = 3; + * + * @return The bytes for destinationId. + */ + public com.google.protobuf.ByteString getDestinationIdBytes() { + java.lang.Object ref = destinationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationId_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDestinationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destinationId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDestinationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destinationId_); + } + 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.MoveAssignmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest other = + (com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestinationId().equals(other.getDestinationId())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESTINATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getDestinationId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest 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.MoveAssignmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest 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.MoveAssignmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignmentRequest 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.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].
+   * Note: "bigquery.reservationAssignments.create" permission is required on the
+   * destination_id. Note: "bigquery.reservationAssignments.create" and
+   * "bigquery.reservationAssignments.delete" permission is required on the
+   * related assignee.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_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_MoveAssignmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.class, + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.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(); + name_ = ""; + + destinationId_ = ""; + + 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_MoveAssignmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest build() { + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest result = + new com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(this); + result.name_ = name_; + result.destinationId_ = destinationId_; + 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.MoveAssignmentRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDestinationId().isEmpty()) { + destinationId_ = other.destinationId_; + 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.MoveAssignmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the assignment,
+     * e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the assignment,
+     * e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the assignment,
+     * e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the assignment,
+     * e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the assignment,
+     * e.g.:
+     *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object destinationId_ = ""; + /** + * + * + *
+     * The new reservation ID, e.g.:
+     *   projects/myotherproject/locations/US/reservations/team2-prod
+     * 
+ * + * string destination_id = 3; + * + * @return The destinationId. + */ + public java.lang.String getDestinationId() { + java.lang.Object ref = destinationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The new reservation ID, e.g.:
+     *   projects/myotherproject/locations/US/reservations/team2-prod
+     * 
+ * + * string destination_id = 3; + * + * @return The bytes for destinationId. + */ + public com.google.protobuf.ByteString getDestinationIdBytes() { + java.lang.Object ref = destinationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The new reservation ID, e.g.:
+     *   projects/myotherproject/locations/US/reservations/team2-prod
+     * 
+ * + * string destination_id = 3; + * + * @param value The destinationId to set. + * @return This builder for chaining. + */ + public Builder setDestinationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + destinationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The new reservation ID, e.g.:
+     *   projects/myotherproject/locations/US/reservations/team2-prod
+     * 
+ * + * string destination_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinationId() { + + destinationId_ = getDefaultInstance().getDestinationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The new reservation ID, e.g.:
+     *   projects/myotherproject/locations/US/reservations/team2-prod
+     * 
+ * + * string destination_id = 3; + * + * @param value The bytes for destinationId to set. + * @return This builder for chaining. + */ + public Builder setDestinationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + destinationId_ = 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.MoveAssignmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveAssignmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MoveAssignmentRequest(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.MoveAssignmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequestOrBuilder.java new file mode 100644 index 00000000..2c1eb9f5 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/MoveAssignmentRequestOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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 MoveAssignmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the assignment,
+   * e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the assignment,
+   * e.g.:
+   *   projects/myproject/locations/US/reservations/team1-prod/assignments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The new reservation ID, e.g.:
+   *   projects/myotherproject/locations/US/reservations/team2-prod
+   * 
+ * + * string destination_id = 3; + * + * @return The destinationId. + */ + java.lang.String getDestinationId(); + /** + * + * + *
+   * The new reservation ID, e.g.:
+   *   projects/myotherproject/locations/US/reservations/team2-prod
+   * 
+ * + * string destination_id = 3; + * + * @return The bytes for destinationId. + */ + com.google.protobuf.ByteString getDestinationIdBytes(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java new file mode 100644 index 00000000..1b67e6dd --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/Reservation.java @@ -0,0 +1,853 @@ +/* + * 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; + +/** + * + * + *
+ * A reservation is a mechanism used to guarantee slots to users.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.Reservation} + */ +public final class Reservation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.Reservation) + ReservationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reservation.newBuilder() to construct. + private Reservation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reservation() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reservation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Reservation( + 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(); + + name_ = s; + break; + } + case 16: + { + slotCapacity_ = input.readInt64(); + break; + } + case 32: + { + ignoreIdleSlots_ = input.readBool(); + 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_Reservation_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_Reservation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.Reservation.class, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the reservation, e.g.,
+   * "projects/*/locations/*/reservations/team1-prod".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the reservation, e.g.,
+   * "projects/*/locations/*/reservations/team1-prod".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SLOT_CAPACITY_FIELD_NUMBER = 2; + private long slotCapacity_; + /** + * + * + *
+   * Minimum slots available to this reservation. A slot is a unit of
+   * computational power in BigQuery, and serves as the unit of parallelism.
+   * Queries using this reservation might use more slots during runtime if
+   * ignore_idle_slots is set to false.
+   * If the new reservation's slot capacity exceed the parent's slot capacity or
+   * if total slot capacity of the new reservation and its siblings exceeds the
+   * parent's slot capacity, the request will fail with
+   * `google.rpc.Code.RESOURCE_EXHAUSTED`.
+   * 
+ * + * int64 slot_capacity = 2; + * + * @return The slotCapacity. + */ + public long getSlotCapacity() { + return slotCapacity_; + } + + public static final int IGNORE_IDLE_SLOTS_FIELD_NUMBER = 4; + private boolean ignoreIdleSlots_; + /** + * + * + *
+   * 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.
+   * 
+ * + * bool ignore_idle_slots = 4; + * + * @return The ignoreIdleSlots. + */ + public boolean getIgnoreIdleSlots() { + return ignoreIdleSlots_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (slotCapacity_ != 0L) { + output.writeInt64(2, slotCapacity_); + } + if (ignoreIdleSlots_ != false) { + output.writeBool(4, ignoreIdleSlots_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (slotCapacity_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, slotCapacity_); + } + if (ignoreIdleSlots_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, ignoreIdleSlots_); + } + 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.Reservation)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.Reservation other = + (com.google.cloud.bigquery.reservation.v1.Reservation) obj; + + if (!getName().equals(other.getName())) return false; + if (getSlotCapacity() != other.getSlotCapacity()) return false; + if (getIgnoreIdleSlots() != other.getIgnoreIdleSlots()) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SLOT_CAPACITY_FIELD_NUMBER; + 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()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.Reservation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Reservation 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.Reservation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Reservation 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.Reservation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.Reservation 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.Reservation 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.Reservation 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.Reservation 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.Reservation 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.Reservation 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.Reservation 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.Reservation 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; + } + /** + * + * + *
+   * A reservation is a mechanism used to guarantee slots to users.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.Reservation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.Reservation) + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_Reservation_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_Reservation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.Reservation.class, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder.class); + } + + // Construct using com.google.cloud.bigquery.reservation.v1.Reservation.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(); + name_ = ""; + + slotCapacity_ = 0L; + + ignoreIdleSlots_ = false; + + 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_Reservation_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Reservation getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Reservation build() { + com.google.cloud.bigquery.reservation.v1.Reservation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.Reservation buildPartial() { + com.google.cloud.bigquery.reservation.v1.Reservation result = + new com.google.cloud.bigquery.reservation.v1.Reservation(this); + result.name_ = name_; + result.slotCapacity_ = slotCapacity_; + result.ignoreIdleSlots_ = ignoreIdleSlots_; + 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.Reservation) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.Reservation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.reservation.v1.Reservation other) { + if (other == com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getSlotCapacity() != 0L) { + setSlotCapacity(other.getSlotCapacity()); + } + if (other.getIgnoreIdleSlots() != false) { + setIgnoreIdleSlots(other.getIgnoreIdleSlots()); + } + 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.Reservation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.Reservation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the reservation, e.g.,
+     * "projects/*/locations/*/reservations/team1-prod".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the reservation, e.g.,
+     * "projects/*/locations/*/reservations/team1-prod".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the reservation, e.g.,
+     * "projects/*/locations/*/reservations/team1-prod".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the reservation, e.g.,
+     * "projects/*/locations/*/reservations/team1-prod".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the reservation, e.g.,
+     * "projects/*/locations/*/reservations/team1-prod".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long slotCapacity_; + /** + * + * + *
+     * Minimum slots available to this reservation. A slot is a unit of
+     * computational power in BigQuery, and serves as the unit of parallelism.
+     * Queries using this reservation might use more slots during runtime if
+     * ignore_idle_slots is set to false.
+     * If the new reservation's slot capacity exceed the parent's slot capacity or
+     * if total slot capacity of the new reservation and its siblings exceeds the
+     * parent's slot capacity, the request will fail with
+     * `google.rpc.Code.RESOURCE_EXHAUSTED`.
+     * 
+ * + * int64 slot_capacity = 2; + * + * @return The slotCapacity. + */ + public long getSlotCapacity() { + return slotCapacity_; + } + /** + * + * + *
+     * Minimum slots available to this reservation. A slot is a unit of
+     * computational power in BigQuery, and serves as the unit of parallelism.
+     * Queries using this reservation might use more slots during runtime if
+     * ignore_idle_slots is set to false.
+     * If the new reservation's slot capacity exceed the parent's slot capacity or
+     * if total slot capacity of the new reservation and its siblings exceeds the
+     * parent's slot capacity, the request will fail with
+     * `google.rpc.Code.RESOURCE_EXHAUSTED`.
+     * 
+ * + * int64 slot_capacity = 2; + * + * @param value The slotCapacity to set. + * @return This builder for chaining. + */ + public Builder setSlotCapacity(long value) { + + slotCapacity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Minimum slots available to this reservation. A slot is a unit of
+     * computational power in BigQuery, and serves as the unit of parallelism.
+     * Queries using this reservation might use more slots during runtime if
+     * ignore_idle_slots is set to false.
+     * If the new reservation's slot capacity exceed the parent's slot capacity or
+     * if total slot capacity of the new reservation and its siblings exceeds the
+     * parent's slot capacity, the request will fail with
+     * `google.rpc.Code.RESOURCE_EXHAUSTED`.
+     * 
+ * + * int64 slot_capacity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSlotCapacity() { + + slotCapacity_ = 0L; + onChanged(); + return this; + } + + private boolean ignoreIdleSlots_; + /** + * + * + *
+     * 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.
+     * 
+ * + * bool ignore_idle_slots = 4; + * + * @return The ignoreIdleSlots. + */ + public boolean getIgnoreIdleSlots() { + return ignoreIdleSlots_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * bool ignore_idle_slots = 4; + * + * @param value The ignoreIdleSlots to set. + * @return This builder for chaining. + */ + public Builder setIgnoreIdleSlots(boolean value) { + + ignoreIdleSlots_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * bool ignore_idle_slots = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreIdleSlots() { + + ignoreIdleSlots_ = false; + 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.Reservation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.Reservation) + private static final com.google.cloud.bigquery.reservation.v1.Reservation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.Reservation(); + } + + public static com.google.cloud.bigquery.reservation.v1.Reservation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reservation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Reservation(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.Reservation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationName.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationName.java new file mode 100644 index 00000000..9636de27 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationName.java @@ -0,0 +1,215 @@ +/* + * 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. + */ + +package com.google.cloud.bigquery.reservation.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ReservationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reservations/{reservation}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String reservation; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReservation() { + return reservation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ReservationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + reservation = Preconditions.checkNotNull(builder.getReservation()); + } + + public static ReservationName of(String project, String location, String reservation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReservation(reservation) + .build(); + } + + public static String format(String project, String location, String reservation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReservation(reservation) + .build() + .toString(); + } + + public static ReservationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ReservationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("reservation")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ReservationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("reservation", reservation); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "reservation", reservation); + } + + /** Builder for ReservationName. */ + public static class Builder { + + private String project; + private String location; + private String reservation; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReservation() { + return reservation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + + private Builder() {} + + private Builder(ReservationName reservationName) { + project = reservationName.project; + location = reservationName.location; + reservation = reservationName.reservation; + } + + public ReservationName build() { + return new ReservationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ReservationName) { + ReservationName that = (ReservationName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.reservation.equals(that.reservation)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= reservation.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java new file mode 100644 index 00000000..fec82c83 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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 ReservationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.Reservation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the reservation, e.g.,
+   * "projects/*/locations/*/reservations/team1-prod".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the reservation, e.g.,
+   * "projects/*/locations/*/reservations/team1-prod".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Minimum slots available to this reservation. A slot is a unit of
+   * computational power in BigQuery, and serves as the unit of parallelism.
+   * Queries using this reservation might use more slots during runtime if
+   * ignore_idle_slots is set to false.
+   * If the new reservation's slot capacity exceed the parent's slot capacity or
+   * if total slot capacity of the new reservation and its siblings exceeds the
+   * parent's slot capacity, the request will fail with
+   * `google.rpc.Code.RESOURCE_EXHAUSTED`.
+   * 
+ * + * int64 slot_capacity = 2; + * + * @return The slotCapacity. + */ + 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.
+   * 
+ * + * bool ignore_idle_slots = 4; + * + * @return The ignoreIdleSlots. + */ + boolean getIgnoreIdleSlots(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java new file mode 100644 index 00000000..7ef47e0d --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/ReservationProto.java @@ -0,0 +1,644 @@ +/* + * 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 final class ReservationProto { + private ReservationProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_Reservation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_Reservation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_Assignment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_Assignment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_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_MoveAssignmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_BiReservation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_BiReservation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/bigquery/reservation/v1/r" + + "eservation.proto\022$google.cloud.bigquery." + + "reservation.v1\032\034google/api/annotations.p" + + "roto\032\027google/api/client.proto\032\037google/ap" + + "i/field_behavior.proto\032\031google/api/resou" + + "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" + + "\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}\"\340\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\"T\n\016CommitmentPlan\022\037\n\033COMMITME" + + "NT_PLAN_UNSPECIFIED\020\000\022\010\n\004FLEX\020\003\022\013\n\007MONTH" + + "LY\020\002\022\n\n\006ANNUAL\020\004\"C\n\005State\022\025\n\021STATE_UNSPE" + + "CIFIED\020\000\022\013\n\007PENDING\020\001\022\n\n\006ACTIVE\020\002\022\n\n\006FAI" + + "LED\020\003:\216\001\352A\212\001\n5bigqueryreservation.google" + + "apis.com/CapacityCommitment\022Qprojects/{p" + + "roject}/locations/{location}/capacityCom" + + "mitments/{capacity_commitment}\"\302\001\n\030Creat" + + "eReservationRequest\022F\n\006parent\030\001 \001(\tB6\340A\002" + + "\372A0\022.bigqueryreservation.googleapis.com/" + + "Reservation\022\026\n\016reservation_id\030\002 \001(\t\022F\n\013r" + + "eservation\030\003 \001(\01321.google.cloud.bigquery" + + ".reservation.v1.Reservation\"\210\001\n\027ListRese" + + "rvationsRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022" + + ".bigqueryreservation.googleapis.com/Rese" + + "rvation\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" + + "\030\003 \001(\t\"|\n\030ListReservationsResponse\022G\n\014re" + + "servations\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\030DeleteRes" + + "ervationRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.b" + + "igqueryreservation.googleapis.com/Reserv" + + "ation\"\223\001\n\030UpdateReservationRequest\022F\n\013re" + + "servation\030\001 \001(\01321.google.cloud.bigquery." + + "reservation.v1.Reservation\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"\226\001\n\036" + + "ListCapacityCommitmentsRequest\022M\n\006parent" + + "\030\001 \001(\tB=\340A\002\372A7\0225bigqueryreservation.goog" + + "leapis.com/CapacityCommitment\022\021\n\tpage_si" + + "ze\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\222\001\n\037ListCap" + + "acityCommitmentsResponse\022V\n\024capacity_com" + + "mitments\030\001 \003(\01328.google.cloud.bigquery.r" + + "eservation.v1.CapacityCommitment\022\027\n\017next" + + "_page_token\030\002 \001(\t\"k\n\034GetCapacityCommitme" + + "ntRequest\022K\n\004name\030\001 \001(\tB=\340A\002\372A7\n5bigquer" + + "yreservation.googleapis.com/CapacityComm" + + "itment\"n\n\037DeleteCapacityCommitmentReques" + + "t\022K\n\004name\030\001 \001(\tB=\340A\002\372A7\n5bigqueryreserva" + + "tion.googleapis.com/CapacityCommitment\"\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\022H\n\006second\030\002 \001(\01328.google.clo" + + "ud.bigquery.reservation.v1.CapacityCommi" + + "tment\"\216\001\n\037MergeCapacityCommitmentsReques" + + "t\022J\n\006parent\030\001 \001(\tB:\372A7\0225bigqueryreservat" + + "ion.googleapis.com/CapacityCommitment\022\037\n" + + "\027capacity_commitment_ids\030\002 \003(\t\"\323\003\n\nAssig" + + "nment\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(\01628.google.cloud.bigq" + + "uery.reservation.v1.Assignment.JobType\022J" + + "\n\005state\030\006 \001(\01626.google.cloud.bigquery.re" + + "servation.v1.Assignment.StateB\003\340A\003\"<\n\007Jo" + + "bType\022\030\n\024JOB_TYPE_UNSPECIFIED\020\000\022\014\n\010PIPEL" + + "INE\020\001\022\t\n\005QUERY\020\002\"7\n\005State\022\025\n\021STATE_UNSPE" + + "CIFIED\020\000\022\013\n\007PENDING\020\001\022\n\n\006ACTIVE\020\002:\220\001\352A\214\001" + + "\n-bigqueryreservation.googleapis.com/Ass" + + "ignment\022[projects/{project}/locations/{l" + + "ocation}/reservations/{reservation}/assi" + + "gnments/{assignment}\"\246\001\n\027CreateAssignmen" + + "tRequest\022E\n\006parent\030\001 \001(\tB5\340A\002\372A/\022-bigque" + + "ryreservation.googleapis.com/Assignment\022" + + "D\n\nassignment\030\002 \001(\01320.google.cloud.bigqu" + + "ery.reservation.v1.Assignment\"\207\001\n\026ListAs" + + "signmentsRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0" + + "\n.bigqueryreservation.googleapis.com/Res" + + "ervation\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\"y\n\027ListAssignmentsResponse\022E\n\013as" + + "signments\030\001 \003(\01320.google.cloud.bigquery." + + "reservation.v1.Assignment\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"^\n\027DeleteAssignmentRequest\022C\n" + + "\004name\030\001 \001(\tB5\340A\002\372A/\n-bigqueryreservation" + + ".googleapis.com/Assignment\"\227\001\n\030SearchAss" + + "ignmentsRequest\022E\n\006parent\030\001 \001(\tB5\340A\002\372A/\022" + + "-bigqueryreservation.googleapis.com/Assi" + + "gnment\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\031SearchAssignment" + + "sResponse\022E\n\013assignments\030\001 \003(\01320.google." + + "cloud.bigquery.reservation.v1.Assignment" + + "\022\027\n\017next_page_token\030\002 \001(\t\"t\n\025MoveAssignm" + + "entRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-bigque" + + "ryreservation.googleapis.com/Assignment\022" + + "\026\n\016destination_id\030\003 \001(\t\"\317\001\n\rBiReservatio" + + "n\022\014\n\004name\030\001 \001(\t\0224\n\013update_time\030\003 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\022\014\n\004size\030\004 " + + "\001(\003:l\352Ai\n0bigqueryreservation.googleapis" + + ".com/BiReservation\0225projects/{project}/l" + + "ocations/{location}/bireservation\"a\n\027Get" + + "BiReservationRequest\022F\n\004name\030\001 \001(\tB8\340A\002\372" + + "A2\n0bigqueryreservation.googleapis.com/B" + + "iReservation\"\232\001\n\032UpdateBiReservationRequ" + + "est\022K\n\016bi_reservation\030\001 \001(\01323.google.clo" + + "ud.bigquery.reservation.v1.BiReservation" + + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMask2\276!\n\022ReservationService\022\361\001\n\021Cre" + + "ateReservation\022>.google.cloud.bigquery.r" + + "eservation.v1.CreateReservationRequest\0321" + + ".google.cloud.bigquery.reservation.v1.Re" + + "servation\"i\202\323\344\223\002?\"0/v1/{parent=projects/" + + "*/locations/*}/reservations:\013reservation" + + "\332A!parent,reservation,reservation_id\022\324\001\n" + + "\020ListReservations\022=.google.cloud.bigquer" + + "y.reservation.v1.ListReservationsRequest" + + "\032>.google.cloud.bigquery.reservation.v1." + + "ListReservationsResponse\"A\202\323\344\223\0022\0220/v1/{p" + + "arent=projects/*/locations/*}/reservatio" + + "ns\332A\006parent\022\301\001\n\016GetReservation\022;.google." + + "cloud.bigquery.reservation.v1.GetReserva" + + "tionRequest\0321.google.cloud.bigquery.rese" + + "rvation.v1.Reservation\"?\202\323\344\223\0022\0220/v1/{nam" + + "e=projects/*/locations/*/reservations/*}" + + "\332A\004name\022\254\001\n\021DeleteReservation\022>.google.c" + + "loud.bigquery.reservation.v1.DeleteReser" + + "vationRequest\032\026.google.protobuf.Empty\"?\202" + + "\323\344\223\0022*0/v1/{name=projects/*/locations/*/" + + "reservations/*}\332A\004name\022\363\001\n\021UpdateReserva" + + "tion\022>.google.cloud.bigquery.reservation" + + ".v1.UpdateReservationRequest\0321.google.cl" + + "oud.bigquery.reservation.v1.Reservation\"" + + "k\202\323\344\223\002K2/v1/{parent=projects" + + "/*/locations/*/reservations/*}/assignmen" + + "ts:\nassignment\332A\021parent,assignment\022\337\001\n\017L" + + "istAssignments\022<.google.cloud.bigquery.r" + + "eservation.v1.ListAssignmentsRequest\032=.g" + + "oogle.cloud.bigquery.reservation.v1.List" + + "AssignmentsResponse\"O\202\323\344\223\002@\022>/v1/{parent" + + "=projects/*/locations/*/reservations/*}/" + + "assignments\332A\006parent\022\270\001\n\020DeleteAssignmen" + + "t\022=.google.cloud.bigquery.reservation.v1" + + ".DeleteAssignmentRequest\032\026.google.protob" + + "uf.Empty\"M\202\323\344\223\002@*>/v1/{name=projects/*/l" + + "ocations/*/reservations/*/assignments/*}" + + "\332A\004name\022\342\001\n\021SearchAssignments\022>.google.c" + + "loud.bigquery.reservation.v1.SearchAssig" + + "nmentsRequest\032?.google.cloud.bigquery.re" + + "servation.v1.SearchAssignmentsResponse\"L" + + "\202\323\344\223\0027\0225/v1/{parent=projects/*/locations" + + "/*}:searchAssignments\332A\014parent,query\022\345\001\n" + + "\016MoveAssignment\022;.google.cloud.bigquery." + + "reservation.v1.MoveAssignmentRequest\0320.g" + + "oogle.cloud.bigquery.reservation.v1.Assi" + + "gnment\"d\202\323\344\223\002H\"C/v1/{name=projects/*/loc" + + "ations/*/reservations/*/assignments/*}:m" + + "ove:\001*\332A\023name,destination_id\022\306\001\n\020GetBiRe" + + "servation\022=.google.cloud.bigquery.reserv" + + "ation.v1.GetBiReservationRequest\0323.googl" + + "e.cloud.bigquery.reservation.v1.BiReserv" + + "ation\">\202\323\344\223\0021\022//v1/{name=projects/*/loca" + + "tions/*/biReservation}\332A\004name\022\201\002\n\023Update" + + "BiReservation\022@.google.cloud.bigquery.re" + + "servation.v1.UpdateBiReservationRequest\032" + + "3.google.cloud.bigquery.reservation.v1.B" + + "iReservation\"s\202\323\344\223\002P2>/v1/{bi_reservatio" + + "n.name=projects/*/locations/*/biReservat" + + "ion}:\016bi_reservation\332A\032bi_reservation,up" + + "date_mask\032\177\312A\"bigqueryreservation.google" + + "apis.com\322AWhttps://www.googleapis.com/au" + + "th/bigquery,https://www.googleapis.com/a" + + "uth/cloud-platformB\217\001\n(com.google.cloud." + + "bigquery.reservation.v1B\020ReservationProt" + + "oP\001ZOgoogle.golang.org/genproto/googleap" + + "is/cloud/bigquery/reservation/v1;reserva" + + "tionb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_reservation_v1_Reservation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_reservation_v1_Reservation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_Reservation_descriptor, + new java.lang.String[] { + "Name", "SlotCapacity", "IgnoreIdleSlots", + }); + internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_CapacityCommitment_descriptor, + new java.lang.String[] { + "Name", + "SlotCount", + "Plan", + "State", + "CommitmentEndTime", + "FailureStatus", + "RenewalPlan", + }); + internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_CreateReservationRequest_descriptor, + new java.lang.String[] { + "Parent", "ReservationId", "Reservation", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListReservationsResponse_descriptor, + new java.lang.String[] { + "Reservations", "NextPageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_GetReservationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_DeleteReservationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_descriptor, + new java.lang.String[] { + "Reservation", "UpdateMask", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListCapacityCommitmentsResponse_descriptor, + new java.lang.String[] { + "CapacityCommitments", "NextPageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_GetCapacityCommitmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_DeleteCapacityCommitmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_descriptor, + new java.lang.String[] { + "CapacityCommitment", "UpdateMask", + }); + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_descriptor, + new java.lang.String[] { + "Name", "SlotCount", + }); + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_descriptor, + new java.lang.String[] { + "First", "Second", + }); + internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_MergeCapacityCommitmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "CapacityCommitmentIds", + }); + internal_static_google_cloud_bigquery_reservation_v1_Assignment_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_bigquery_reservation_v1_Assignment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_Assignment_descriptor, + new java.lang.String[] { + "Name", "Assignee", "JobType", "State", + }); + internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_CreateAssignmentRequest_descriptor, + new java.lang.String[] { + "Parent", "Assignment", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_ListAssignmentsResponse_descriptor, + new java.lang.String[] { + "Assignments", "NextPageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_DeleteAssignmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "Query", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(22); + 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_MoveAssignmentRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_MoveAssignmentRequest_descriptor, + new java.lang.String[] { + "Name", "DestinationId", + }); + internal_static_google_cloud_bigquery_reservation_v1_BiReservation_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_bigquery_reservation_v1_BiReservation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_BiReservation_descriptor, + new java.lang.String[] { + "Name", "UpdateTime", "Size", + }); + internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_GetBiReservationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_descriptor, + new java.lang.String[] { + "BiReservation", "UpdateMask", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequest.java new file mode 100644 index 00000000..5e29dc0d --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequest.java @@ -0,0 +1,1141 @@ +/* + * 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.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
+ * Note: "bigquery.reservationAssignments.search" permission is required on the
+ * related assignee.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} + */ +public final class SearchAssignmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + SearchAssignmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchAssignmentsRequest.newBuilder() to construct. + private SearchAssignmentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchAssignmentsRequest() { + parent_ = ""; + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchAssignmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchAssignmentsRequest( + 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_SearchAssignmentsRequest_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_SearchAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the admin project(containing project and location),
+   * e.g.:
+   *   "projects/myproject/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) { + 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 of the admin project(containing project and location),
+   * e.g.:
+   *   "projects/myproject/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 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.
+   * e.g., "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) { + 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.
+   * e.g., "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 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.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + 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. + */ + 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. + */ + 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.SearchAssignmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest other = + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) 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.SearchAssignmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest 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.SearchAssignmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest 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.SearchAssignmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest 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.SearchAssignmentsRequest 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.SearchAssignmentsRequest 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.SearchAssignmentsRequest + 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.SearchAssignmentsRequest + 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.SearchAssignmentsRequest 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.SearchAssignmentsRequest 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.SearchAssignmentsRequest 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.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
+   * Note: "bigquery.reservationAssignments.search" permission is required on the
+   * related assignee.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsRequest_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_SearchAssignmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.class, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.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_SearchAssignmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest build() { + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest result = + new com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(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.SearchAssignmentsRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.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.SearchAssignmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the admin project(containing project and location),
+     * e.g.:
+     *   "projects/myproject/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 of the admin project(containing project and location),
+     * e.g.:
+     *   "projects/myproject/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 of the admin project(containing project and location),
+     * e.g.:
+     *   "projects/myproject/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 of the admin project(containing project and location),
+     * e.g.:
+     *   "projects/myproject/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 of the admin project(containing project and location),
+     * e.g.:
+     *   "projects/myproject/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.
+     * e.g., "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.
+     * e.g., "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.
+     * e.g., "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.
+     * e.g., "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.
+     * e.g., "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.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * 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.
+     * 
+ * + * 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.SearchAssignmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + private static final com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchAssignmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchAssignmentsRequest(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.SearchAssignmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequestOrBuilder.java new file mode 100644 index 00000000..24289c4d --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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 SearchAssignmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the admin project(containing project and location),
+   * e.g.:
+   *   "projects/myproject/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 of the admin project(containing project and location),
+   * e.g.:
+   *   "projects/myproject/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.
+   * e.g., "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.
+   * e.g., "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.
+   * 
+ * + * 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-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponse.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponse.java new file mode 100644 index 00000000..4ec34f28 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponse.java @@ -0,0 +1,1153 @@ +/* + * 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.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} + */ +public final class SearchAssignmentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + SearchAssignmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchAssignmentsResponse.newBuilder() to construct. + private SearchAssignmentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchAssignmentsResponse() { + assignments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchAssignmentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchAssignmentsResponse( + 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_SearchAssignmentsResponse_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_SearchAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.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; + */ + public java.util.List getAssignmentsList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public java.util.List + getAssignmentsOrBuilderList() { + return assignments_; + } + /** + * + * + *
+   * List of assignments visible to the user.
+   * 
+ * + * repeated .google.cloud.bigquery.reservation.v1.Assignment assignments = 1; + */ + public int getAssignmentsCount() { + return assignments_.size(); + } + /** + * + * + *
+   * 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) { + return assignments_.get(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) { + 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. + */ + 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. + */ + 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.SearchAssignmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse other = + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) 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.SearchAssignmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse 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.SearchAssignmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse 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.SearchAssignmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse 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.SearchAssignmentsResponse 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.SearchAssignmentsResponse 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.SearchAssignmentsResponse + 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.SearchAssignmentsResponse + 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.SearchAssignmentsResponse 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.SearchAssignmentsResponse 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.SearchAssignmentsResponse 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.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SearchAssignmentsResponse_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_SearchAssignmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.class, + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.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_SearchAssignmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse build() { + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse result = + new com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(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.SearchAssignmentsResponse) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + .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.SearchAssignmentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + 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.SearchAssignmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + private static final com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchAssignmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchAssignmentsResponse(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.SearchAssignmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponseOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponseOrBuilder.java new file mode 100644 index 00000000..d2e3ca60 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SearchAssignmentsResponseOrBuilder.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 SearchAssignmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + 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-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequest.java new file mode 100644 index 00000000..82d93170 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequest.java @@ -0,0 +1,760 @@ +/* + * 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.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} + */ +public final class SplitCapacityCommitmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + SplitCapacityCommitmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SplitCapacityCommitmentRequest.newBuilder() to construct. + private SplitCapacityCommitmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SplitCapacityCommitmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SplitCapacityCommitmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SplitCapacityCommitmentRequest( + 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(); + + name_ = s; + break; + } + case 16: + { + slotCount_ = input.readInt64(); + 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_SplitCapacityCommitmentRequest_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_SplitCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name e.g.,:
+   *   projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name e.g.,:
+   *   projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SLOT_COUNT_FIELD_NUMBER = 2; + private long slotCount_; + /** + * + * + *
+   * Number of slots in the capacity commitment after the split.
+   * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + public long getSlotCount() { + return slotCount_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (slotCount_ != 0L) { + output.writeInt64(2, slotCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (slotCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, slotCount_); + } + 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.SplitCapacityCommitmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest other = + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getSlotCount() != other.getSlotCount()) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SLOT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSlotCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest + 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.SplitCapacityCommitmentRequest + 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.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest 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.SplitCapacityCommitmentRequest 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.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentRequest_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_SplitCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.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(); + name_ = ""; + + slotCount_ = 0L; + + 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_SplitCapacityCommitmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest build() { + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest result = + new com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(this); + result.name_ = name_; + result.slotCount_ = slotCount_; + 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.SplitCapacityCommitmentRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getSlotCount() != 0L) { + setSlotCount(other.getSlotCount()); + } + 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.SplitCapacityCommitmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name e.g.,:
+     *   projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name e.g.,:
+     *   projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name e.g.,:
+     *   projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name e.g.,:
+     *   projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name e.g.,:
+     *   projects/myproject/locations/US/capacityCommitments/123
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long slotCount_; + /** + * + * + *
+     * Number of slots in the capacity commitment after the split.
+     * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + public long getSlotCount() { + return slotCount_; + } + /** + * + * + *
+     * Number of slots in the capacity commitment after the split.
+     * 
+ * + * int64 slot_count = 2; + * + * @param value The slotCount to set. + * @return This builder for chaining. + */ + public Builder setSlotCount(long value) { + + slotCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of slots in the capacity commitment after the split.
+     * 
+ * + * int64 slot_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearSlotCount() { + + slotCount_ = 0L; + 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.SplitCapacityCommitmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SplitCapacityCommitmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SplitCapacityCommitmentRequest(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.SplitCapacityCommitmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequestOrBuilder.java new file mode 100644 index 00000000..06205b6b --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * 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 SplitCapacityCommitmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name e.g.,:
+   *   projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name e.g.,:
+   *   projects/myproject/locations/US/capacityCommitments/123
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Number of slots in the capacity commitment after the split.
+   * 
+ * + * int64 slot_count = 2; + * + * @return The slotCount. + */ + long getSlotCount(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponse.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponse.java new file mode 100644 index 00000000..8aae8a2b --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponse.java @@ -0,0 +1,1028 @@ +/* + * 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.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} + */ +public final class SplitCapacityCommitmentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + SplitCapacityCommitmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SplitCapacityCommitmentResponse.newBuilder() to construct. + private SplitCapacityCommitmentResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SplitCapacityCommitmentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SplitCapacityCommitmentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SplitCapacityCommitmentResponse( + 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: + { + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder subBuilder = null; + if (first_ != null) { + subBuilder = first_.toBuilder(); + } + first_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(first_); + first_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder subBuilder = null; + if (second_ != null) { + subBuilder = second_.toBuilder(); + } + second_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(second_); + second_ = subBuilder.buildPartial(); + } + + 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_SplitCapacityCommitmentResponse_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_SplitCapacityCommitmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.class, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.Builder.class); + } + + public static final int FIRST_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment first_; + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return Whether the first field is set. + */ + public boolean hasFirst() { + return first_ != null; + } + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return The first. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getFirst() { + return first_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : first_; + } + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder getFirstOrBuilder() { + return getFirst(); + } + + public static final int SECOND_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment second_; + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return Whether the second field is set. + */ + public boolean hasSecond() { + return second_ != null; + } + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return The second. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getSecond() { + return second_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : second_; + } + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder getSecondOrBuilder() { + return getSecond(); + } + + 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 (first_ != null) { + output.writeMessage(1, getFirst()); + } + if (second_ != null) { + output.writeMessage(2, getSecond()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (first_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFirst()); + } + if (second_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSecond()); + } + 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.SplitCapacityCommitmentResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse other = + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) obj; + + if (hasFirst() != other.hasFirst()) return false; + if (hasFirst()) { + if (!getFirst().equals(other.getFirst())) return false; + } + if (hasSecond() != other.hasSecond()) return false; + if (hasSecond()) { + if (!getSecond().equals(other.getSecond())) 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 (hasFirst()) { + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + getFirst().hashCode(); + } + if (hasSecond()) { + hash = (37 * hash) + SECOND_FIELD_NUMBER; + hash = (53 * hash) + getSecond().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse + 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.SplitCapacityCommitmentResponse + 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.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse 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.SplitCapacityCommitmentResponse 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.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_SplitCapacityCommitmentResponse_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_SplitCapacityCommitmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.class, + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.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(); + if (firstBuilder_ == null) { + first_ = null; + } else { + first_ = null; + firstBuilder_ = null; + } + if (secondBuilder_ == null) { + second_ = null; + } else { + second_ = null; + secondBuilder_ = null; + } + 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_SplitCapacityCommitmentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse build() { + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse buildPartial() { + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse result = + new com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(this); + if (firstBuilder_ == null) { + result.first_ = first_; + } else { + result.first_ = firstBuilder_.build(); + } + if (secondBuilder_ == null) { + result.second_ = second_; + } else { + result.second_ = secondBuilder_.build(); + } + 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.SplitCapacityCommitmentResponse) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse other) { + if (other + == com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + .getDefaultInstance()) return this; + if (other.hasFirst()) { + mergeFirst(other.getFirst()); + } + if (other.hasSecond()) { + mergeSecond(other.getSecond()); + } + 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.SplitCapacityCommitmentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment first_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + firstBuilder_; + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return Whether the first field is set. + */ + public boolean hasFirst() { + return firstBuilder_ != null || first_ != null; + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return The first. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getFirst() { + if (firstBuilder_ == null) { + return first_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : first_; + } else { + return firstBuilder_.getMessage(); + } + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public Builder setFirst(com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (firstBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + first_ = value; + onChanged(); + } else { + firstBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public Builder setFirst( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (firstBuilder_ == null) { + first_ = builderForValue.build(); + onChanged(); + } else { + firstBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public Builder mergeFirst(com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (firstBuilder_ == null) { + if (first_ != null) { + first_ = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.newBuilder(first_) + .mergeFrom(value) + .buildPartial(); + } else { + first_ = value; + } + onChanged(); + } else { + firstBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public Builder clearFirst() { + if (firstBuilder_ == null) { + first_ = null; + onChanged(); + } else { + first_ = null; + firstBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder getFirstBuilder() { + + onChanged(); + return getFirstFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getFirstOrBuilder() { + if (firstBuilder_ != null) { + return firstBuilder_.getMessageOrBuilder(); + } else { + return first_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : first_; + } + } + /** + * + * + *
+     * First capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getFirstFieldBuilder() { + if (firstBuilder_ == null) { + firstBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder>( + getFirst(), getParentForChildren(), isClean()); + first_ = null; + } + return firstBuilder_; + } + + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment second_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + secondBuilder_; + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return Whether the second field is set. + */ + public boolean hasSecond() { + return secondBuilder_ != null || second_ != null; + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return The second. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getSecond() { + if (secondBuilder_ == null) { + return second_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : second_; + } else { + return secondBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public Builder setSecond(com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (secondBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + second_ = value; + onChanged(); + } else { + secondBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public Builder setSecond( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (secondBuilder_ == null) { + second_ = builderForValue.build(); + onChanged(); + } else { + secondBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public Builder mergeSecond(com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (secondBuilder_ == null) { + if (second_ != null) { + second_ = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.newBuilder(second_) + .mergeFrom(value) + .buildPartial(); + } else { + second_ = value; + } + onChanged(); + } else { + secondBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public Builder clearSecond() { + if (secondBuilder_ == null) { + second_ = null; + onChanged(); + } else { + second_ = null; + secondBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder getSecondBuilder() { + + onChanged(); + return getSecondFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getSecondOrBuilder() { + if (secondBuilder_ != null) { + return secondBuilder_.getMessageOrBuilder(); + } else { + return second_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : second_; + } + } + /** + * + * + *
+     * Second capacity commitment, result of a split.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getSecondFieldBuilder() { + if (secondBuilder_ == null) { + secondBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder>( + getSecond(), getParentForChildren(), isClean()); + second_ = null; + } + return secondBuilder_; + } + + @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.SplitCapacityCommitmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + private static final com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(); + } + + public static com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SplitCapacityCommitmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SplitCapacityCommitmentResponse(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.SplitCapacityCommitmentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponseOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponseOrBuilder.java new file mode 100644 index 00000000..cd31f325 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/SplitCapacityCommitmentResponseOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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 SplitCapacityCommitmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return Whether the first field is set. + */ + boolean hasFirst(); + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + * + * @return The first. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment getFirst(); + /** + * + * + *
+   * First capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment first = 1; + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder getFirstOrBuilder(); + + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return Whether the second field is set. + */ + boolean hasSecond(); + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + * + * @return The second. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment getSecond(); + /** + * + * + *
+   * Second capacity commitment, result of a split.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment second = 2; + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder getSecondOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequest.java new file mode 100644 index 00000000..ac901e93 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequest.java @@ -0,0 +1,1017 @@ +/* + * 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; + +/** + * + * + *
+ * A request to update a BI reservation.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} + */ +public final class UpdateBiReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + UpdateBiReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBiReservationRequest.newBuilder() to construct. + private UpdateBiReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBiReservationRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBiReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBiReservationRequest( + 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: + { + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder subBuilder = null; + if (biReservation_ != null) { + subBuilder = biReservation_.toBuilder(); + } + biReservation_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.BiReservation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(biReservation_); + biReservation_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + 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_UpdateBiReservationRequest_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_UpdateBiReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.Builder.class); + } + + public static final int BI_RESERVATION_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.reservation.v1.BiReservation biReservation_; + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return Whether the biReservation field is set. + */ + public boolean hasBiReservation() { + return biReservation_ != null; + } + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return The biReservation. + */ + public com.google.cloud.bigquery.reservation.v1.BiReservation getBiReservation() { + return biReservation_ == null + ? com.google.cloud.bigquery.reservation.v1.BiReservation.getDefaultInstance() + : biReservation_; + } + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder + getBiReservationOrBuilder() { + return getBiReservation(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (biReservation_ != null) { + output.writeMessage(1, getBiReservation()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (biReservation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBiReservation()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateBiReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) obj; + + if (hasBiReservation() != other.hasBiReservation()) return false; + if (hasBiReservation()) { + if (!getBiReservation().equals(other.getBiReservation())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasBiReservation()) { + hash = (37 * hash) + BI_RESERVATION_FIELD_NUMBER; + hash = (53 * hash) + getBiReservation().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest 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.UpdateBiReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest 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.UpdateBiReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest 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.UpdateBiReservationRequest 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.UpdateBiReservationRequest 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.UpdateBiReservationRequest + 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.UpdateBiReservationRequest + 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.UpdateBiReservationRequest 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.UpdateBiReservationRequest 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.UpdateBiReservationRequest 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; + } + /** + * + * + *
+   * A request to update a BI reservation.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_UpdateBiReservationRequest_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_UpdateBiReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.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(); + if (biReservationBuilder_ == null) { + biReservation_ = null; + } else { + biReservation_ = null; + biReservationBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + 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_UpdateBiReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(this); + if (biReservationBuilder_ == null) { + result.biReservation_ = biReservation_; + } else { + result.biReservation_ = biReservationBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + 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.UpdateBiReservationRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + .getDefaultInstance()) return this; + if (other.hasBiReservation()) { + mergeBiReservation(other.getBiReservation()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateBiReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.reservation.v1.BiReservation biReservation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.BiReservation, + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder, + com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder> + biReservationBuilder_; + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return Whether the biReservation field is set. + */ + public boolean hasBiReservation() { + return biReservationBuilder_ != null || biReservation_ != null; + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return The biReservation. + */ + public com.google.cloud.bigquery.reservation.v1.BiReservation getBiReservation() { + if (biReservationBuilder_ == null) { + return biReservation_ == null + ? com.google.cloud.bigquery.reservation.v1.BiReservation.getDefaultInstance() + : biReservation_; + } else { + return biReservationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public Builder setBiReservation(com.google.cloud.bigquery.reservation.v1.BiReservation value) { + if (biReservationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + biReservation_ = value; + onChanged(); + } else { + biReservationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public Builder setBiReservation( + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder builderForValue) { + if (biReservationBuilder_ == null) { + biReservation_ = builderForValue.build(); + onChanged(); + } else { + biReservationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public Builder mergeBiReservation( + com.google.cloud.bigquery.reservation.v1.BiReservation value) { + if (biReservationBuilder_ == null) { + if (biReservation_ != null) { + biReservation_ = + com.google.cloud.bigquery.reservation.v1.BiReservation.newBuilder(biReservation_) + .mergeFrom(value) + .buildPartial(); + } else { + biReservation_ = value; + } + onChanged(); + } else { + biReservationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public Builder clearBiReservation() { + if (biReservationBuilder_ == null) { + biReservation_ = null; + onChanged(); + } else { + biReservation_ = null; + biReservationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.BiReservation.Builder + getBiReservationBuilder() { + + onChanged(); + return getBiReservationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder + getBiReservationOrBuilder() { + if (biReservationBuilder_ != null) { + return biReservationBuilder_.getMessageOrBuilder(); + } else { + return biReservation_ == null + ? com.google.cloud.bigquery.reservation.v1.BiReservation.getDefaultInstance() + : biReservation_; + } + } + /** + * + * + *
+     * A reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.BiReservation, + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder, + com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder> + getBiReservationFieldBuilder() { + if (biReservationBuilder_ == null) { + biReservationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.BiReservation, + com.google.cloud.bigquery.reservation.v1.BiReservation.Builder, + com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder>( + getBiReservation(), getParentForChildren(), isClean()); + biReservation_ = null; + } + return biReservationBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * A list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateBiReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBiReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBiReservationRequest(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.UpdateBiReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequestOrBuilder.java new file mode 100644 index 00000000..332d5efc --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateBiReservationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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 UpdateBiReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return Whether the biReservation field is set. + */ + boolean hasBiReservation(); + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + * + * @return The biReservation. + */ + com.google.cloud.bigquery.reservation.v1.BiReservation getBiReservation(); + /** + * + * + *
+   * A reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.BiReservation bi_reservation = 1; + */ + com.google.cloud.bigquery.reservation.v1.BiReservationOrBuilder getBiReservationOrBuilder(); + + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * A list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequest.java new file mode 100644 index 00000000..d9cfab15 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequest.java @@ -0,0 +1,1034 @@ +/* + * 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.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} + */ +public final class UpdateCapacityCommitmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + UpdateCapacityCommitmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCapacityCommitmentRequest.newBuilder() to construct. + private UpdateCapacityCommitmentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCapacityCommitmentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCapacityCommitmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCapacityCommitmentRequest( + 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: + { + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder subBuilder = null; + if (capacityCommitment_ != null) { + subBuilder = capacityCommitment_.toBuilder(); + } + capacityCommitment_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(capacityCommitment_); + capacityCommitment_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + 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_UpdateCapacityCommitmentRequest_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_UpdateCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.Builder.class); + } + + public static final int CAPACITY_COMMITMENT_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment capacityCommitment_; + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * @return Whether the capacityCommitment field is set. + */ + public boolean hasCapacityCommitment() { + return capacityCommitment_ != null; + } + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * @return The capacityCommitment. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitment() { + return capacityCommitment_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : capacityCommitment_; + } + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentOrBuilder() { + return getCapacityCommitment(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (capacityCommitment_ != null) { + output.writeMessage(1, getCapacityCommitment()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (capacityCommitment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCapacityCommitment()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateCapacityCommitmentRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest other = + (com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) obj; + + if (hasCapacityCommitment() != other.hasCapacityCommitment()) return false; + if (hasCapacityCommitment()) { + if (!getCapacityCommitment().equals(other.getCapacityCommitment())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasCapacityCommitment()) { + hash = (37 * hash) + CAPACITY_COMMITMENT_FIELD_NUMBER; + hash = (53 * hash) + getCapacityCommitment().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest + 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.UpdateCapacityCommitmentRequest + 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.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitmentRequest 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.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_UpdateCapacityCommitmentRequest_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_UpdateCapacityCommitmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.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(); + if (capacityCommitmentBuilder_ == null) { + capacityCommitment_ = null; + } else { + capacityCommitment_ = null; + capacityCommitmentBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + 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_UpdateCapacityCommitmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest build() { + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest result = + new com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(this); + if (capacityCommitmentBuilder_ == null) { + result.capacityCommitment_ = capacityCommitment_; + } else { + result.capacityCommitment_ = capacityCommitmentBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + 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.UpdateCapacityCommitmentRequest) { + return mergeFrom( + (com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + .getDefaultInstance()) return this; + if (other.hasCapacityCommitment()) { + mergeCapacityCommitment(other.getCapacityCommitment()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateCapacityCommitmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.reservation.v1.CapacityCommitment capacityCommitment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + capacityCommitmentBuilder_; + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * + * @return Whether the capacityCommitment field is set. + */ + public boolean hasCapacityCommitment() { + return capacityCommitmentBuilder_ != null || capacityCommitment_ != null; + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * + * @return The capacityCommitment. + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitment() { + if (capacityCommitmentBuilder_ == null) { + return capacityCommitment_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : capacityCommitment_; + } else { + return capacityCommitmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public Builder setCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (capacityCommitmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + capacityCommitment_ = value; + onChanged(); + } else { + capacityCommitmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public Builder setCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder builderForValue) { + if (capacityCommitmentBuilder_ == null) { + capacityCommitment_ = builderForValue.build(); + onChanged(); + } else { + capacityCommitmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public Builder mergeCapacityCommitment( + com.google.cloud.bigquery.reservation.v1.CapacityCommitment value) { + if (capacityCommitmentBuilder_ == null) { + if (capacityCommitment_ != null) { + capacityCommitment_ = + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.newBuilder( + capacityCommitment_) + .mergeFrom(value) + .buildPartial(); + } else { + capacityCommitment_ = value; + } + onChanged(); + } else { + capacityCommitmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public Builder clearCapacityCommitment() { + if (capacityCommitmentBuilder_ == null) { + capacityCommitment_ = null; + onChanged(); + } else { + capacityCommitment_ = null; + capacityCommitmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder + getCapacityCommitmentBuilder() { + + onChanged(); + return getCapacityCommitmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + public com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentOrBuilder() { + if (capacityCommitmentBuilder_ != null) { + return capacityCommitmentBuilder_.getMessageOrBuilder(); + } else { + return capacityCommitment_ == null + ? com.google.cloud.bigquery.reservation.v1.CapacityCommitment.getDefaultInstance() + : capacityCommitment_; + } + } + /** + * + * + *
+     * Content of the capacity commitment to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder> + getCapacityCommitmentFieldBuilder() { + if (capacityCommitmentBuilder_ == null) { + capacityCommitmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.CapacityCommitment, + com.google.cloud.bigquery.reservation.v1.CapacityCommitment.Builder, + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder>( + getCapacityCommitment(), getParentForChildren(), isClean()); + capacityCommitment_ = null; + } + return capacityCommitmentBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateCapacityCommitmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + private static final com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCapacityCommitmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCapacityCommitmentRequest(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.UpdateCapacityCommitmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequestOrBuilder.java new file mode 100644 index 00000000..cd655df6 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateCapacityCommitmentRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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 UpdateCapacityCommitmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * @return Whether the capacityCommitment field is set. + */ + boolean hasCapacityCommitment(); + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + * + * @return The capacityCommitment. + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitment getCapacityCommitment(); + /** + * + * + *
+   * Content of the capacity commitment to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 1; + */ + com.google.cloud.bigquery.reservation.v1.CapacityCommitmentOrBuilder + getCapacityCommitmentOrBuilder(); + + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequest.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequest.java new file mode 100644 index 00000000..5a69b104 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequest.java @@ -0,0 +1,1011 @@ +/* + * 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.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateReservationRequest} + */ +public final class UpdateReservationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + UpdateReservationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateReservationRequest.newBuilder() to construct. + private UpdateReservationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateReservationRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateReservationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateReservationRequest( + 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: + { + com.google.cloud.bigquery.reservation.v1.Reservation.Builder subBuilder = null; + if (reservation_ != null) { + subBuilder = reservation_.toBuilder(); + } + reservation_ = + input.readMessage( + com.google.cloud.bigquery.reservation.v1.Reservation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(reservation_); + reservation_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + 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_UpdateReservationRequest_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_UpdateReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.Builder.class); + } + + public static final int RESERVATION_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.reservation.v1.Reservation reservation_; + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return Whether the reservation field is set. + */ + public boolean hasReservation() { + return reservation_ != null; + } + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return The reservation. + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservation() { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder() { + return getReservation(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (reservation_ != null) { + output.writeMessage(1, getReservation()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reservation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReservation()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateReservationRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest other = + (com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) obj; + + if (hasReservation() != other.hasReservation()) return false; + if (hasReservation()) { + if (!getReservation().equals(other.getReservation())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasReservation()) { + hash = (37 * hash) + RESERVATION_FIELD_NUMBER; + hash = (53 * hash) + getReservation().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest 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.UpdateReservationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest 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.UpdateReservationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest 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.UpdateReservationRequest 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.UpdateReservationRequest 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.UpdateReservationRequest + 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.UpdateReservationRequest + 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.UpdateReservationRequest 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.UpdateReservationRequest 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.UpdateReservationRequest 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.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.reservation.v1.UpdateReservationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.reservation.v1.ReservationProto + .internal_static_google_cloud_bigquery_reservation_v1_UpdateReservationRequest_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_UpdateReservationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.class, + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.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(); + if (reservationBuilder_ == null) { + reservation_ = null; + } else { + reservation_ = null; + reservationBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + 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_UpdateReservationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest build() { + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest buildPartial() { + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest result = + new com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(this); + if (reservationBuilder_ == null) { + result.reservation_ = reservation_; + } else { + result.reservation_ = reservationBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + 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.UpdateReservationRequest) { + return mergeFrom((com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest other) { + if (other + == com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest.getDefaultInstance()) + return this; + if (other.hasReservation()) { + mergeReservation(other.getReservation()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateReservationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.reservation.v1.Reservation reservation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + reservationBuilder_; + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return Whether the reservation field is set. + */ + public boolean hasReservation() { + return reservationBuilder_ != null || reservation_ != null; + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return The reservation. + */ + public com.google.cloud.bigquery.reservation.v1.Reservation getReservation() { + if (reservationBuilder_ == null) { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } else { + return reservationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public Builder setReservation(com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reservation_ = value; + onChanged(); + } else { + reservationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public Builder setReservation( + com.google.cloud.bigquery.reservation.v1.Reservation.Builder builderForValue) { + if (reservationBuilder_ == null) { + reservation_ = builderForValue.build(); + onChanged(); + } else { + reservationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public Builder mergeReservation(com.google.cloud.bigquery.reservation.v1.Reservation value) { + if (reservationBuilder_ == null) { + if (reservation_ != null) { + reservation_ = + com.google.cloud.bigquery.reservation.v1.Reservation.newBuilder(reservation_) + .mergeFrom(value) + .buildPartial(); + } else { + reservation_ = value; + } + onChanged(); + } else { + reservationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public Builder clearReservation() { + if (reservationBuilder_ == null) { + reservation_ = null; + onChanged(); + } else { + reservation_ = null; + reservationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.Reservation.Builder getReservationBuilder() { + + onChanged(); + return getReservationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + public com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder() { + if (reservationBuilder_ != null) { + return reservationBuilder_.getMessageOrBuilder(); + } else { + return reservation_ == null + ? com.google.cloud.bigquery.reservation.v1.Reservation.getDefaultInstance() + : reservation_; + } + } + /** + * + * + *
+     * Content of the reservation to update.
+     * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder> + getReservationFieldBuilder() { + if (reservationBuilder_ == null) { + reservationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.reservation.v1.Reservation, + com.google.cloud.bigquery.reservation.v1.Reservation.Builder, + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder>( + getReservation(), getParentForChildren(), isClean()); + reservation_ = null; + } + return reservationBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Standard field mask for the set of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateReservationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + private static final com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(); + } + + public static com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateReservationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateReservationRequest(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.UpdateReservationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequestOrBuilder.java b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequestOrBuilder.java new file mode 100644 index 00000000..87c224a4 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/java/com/google/cloud/bigquery/reservation/v1/UpdateReservationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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 UpdateReservationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return Whether the reservation field is set. + */ + boolean hasReservation(); + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + * + * @return The reservation. + */ + com.google.cloud.bigquery.reservation.v1.Reservation getReservation(); + /** + * + * + *
+   * Content of the reservation to update.
+   * 
+ * + * .google.cloud.bigquery.reservation.v1.Reservation reservation = 1; + */ + com.google.cloud.bigquery.reservation.v1.ReservationOrBuilder getReservationOrBuilder(); + + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Standard field mask for the set of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-reservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto b/proto-google-cloud-bigquery-reservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto new file mode 100644 index 00000000..12602484 --- /dev/null +++ b/proto-google-cloud-bigquery-reservation-v1/src/main/proto/google/cloud/bigquery/reservation/v1/reservation.proto @@ -0,0 +1,779 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.bigquery.reservation.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation"; +option java_multiple_files = true; +option java_outer_classname = "ReservationProto"; +option java_package = "com.google.cloud.bigquery.reservation.v1"; + +// This API allows users to manage their flat-rate BigQuery reservations. +// +// A reservation provides computational resource guarantees, in the form of +// [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a +// unit of computational power in BigQuery, and serves as the basic unit of +// parallelism. In a scan of a multi-partitioned table, a single slot operates +// on a single partition of the table. A reservation resource exists as a child +// resource of the admin project and location, e.g.: +// projects/myproject/locations/US/reservations/reservationName. +// +// A capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. A capacity +// commitment resource exists as a child resource of the admin project and +// location, e.g.: +// projects/myproject/locations/US/capacityCommitments/id. +service ReservationService { + option (google.api.default_host) = "bigqueryreservation.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new reservation resource. + rpc CreateReservation(CreateReservationRequest) returns (Reservation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/reservations" + body: "reservation" + }; + option (google.api.method_signature) = "parent,reservation,reservation_id"; + } + + // Lists all the reservations for the project in the specified location. + rpc ListReservations(ListReservationsRequest) returns (ListReservationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/reservations" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the reservation. + rpc GetReservation(GetReservationRequest) returns (Reservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a reservation. + // Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + // assignments. + rpc DeleteReservation(DeleteReservationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing reservation resource. + rpc UpdateReservation(UpdateReservationRequest) returns (Reservation) { + option (google.api.http) = { + patch: "/v1/{reservation.name=projects/*/locations/*/reservations/*}" + body: "reservation" + }; + option (google.api.method_signature) = "reservation,update_mask"; + } + + // Lists all the capacity commitments for the admin project. + rpc ListCapacityCommitments(ListCapacityCommitmentsRequest) returns (ListCapacityCommitmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/capacityCommitments" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the capacity commitment. + rpc GetCapacityCommitment(GetCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a capacity commitment. Attempting to delete capacity commitment + // before its commitment_end_time will fail with the error code + // `google.rpc.Code.FAILED_PRECONDITION`. + rpc DeleteCapacityCommitment(DeleteCapacityCommitmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing capacity commitment. + // + // Only plan and renewal_plan fields can be updated. + // Plan can only be changed to a plan of a longer commitment period. + // Attempting to change to a plan with shorter commitment period will fail + // with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc UpdateCapacityCommitment(UpdateCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + patch: "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}" + body: "capacity_commitment" + }; + option (google.api.method_signature) = "capacity_commitment,update_mask"; + } + + // Splits capacity commitment to two commitments of the same plan and + // commitment_end_time. A common use case to do that is to perform a downgrade + // e.g., in order to downgrade from 10000 slots to 8000, one might split 10000 + // capacity commitment to 2000 and 8000, change the plan of the first one to + // flex and then delete it. + rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest) returns (SplitCapacityCommitmentResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split" + body: "*" + }; + option (google.api.method_signature) = "name,slot_count"; + } + + // Merges capacity commitments of the same plan into one. Resulting capacity + // commitment has the longer commitment_end_time out of the two. Attempting to + // merge capacity commitments of different plan will fail with the error code + // `google.rpc.Code.FAILED_PRECONDITION`. + rpc MergeCapacityCommitments(MergeCapacityCommitmentsRequest) returns (CapacityCommitment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge" + body: "*" + }; + option (google.api.method_signature) = "parent,capacity_commitment_ids"; + } + + // Creates an object which allows the given project to submit jobs + // of a certain type using slots from the specified reservation. Currently a + // resource (project, folder, organization) can only have one assignment per + // {job_type, location}, and that reservation will be used for all jobs of the + // matching type. Within the organization, different assignments can be + // created on projects, folders or organization level. During query execution, + // the assignment is looked up at the project, folder and organization levels + // in that order. The first assignment found is applied to the query. When + // creating assignments, it does not matter if other assignments exist at + // higher levels. E.g: organizationA contains project1, project2. Assignments + // for organizationA, project1 and project2 could all be created, mapping to + // the same or different reservations. + // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + // 'bigquery.admin' permissions on the project using the reservation + // and the project that owns this reservation. + // Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + // does not match location of the reservation. + rpc CreateAssignment(CreateAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + body: "assignment" + }; + option (google.api.method_signature) = "parent,assignment"; + } + + // Lists assignments. + // Only explicitly created assignments will be returned. E.g: + // organizationA contains project1 and project2. Reservation res1 exists. + // CreateAssignment was invoked previously and following assignments were + // created explicitly: + // + // + // Then this API will just return the above two assignments for reservation + // res1, and no expansion/merge will happen. Wildcard "-" can be used for + // reservations in the request. In that case all assignments belongs to the + // specified project and location will be listed. Note + // "-" cannot be used for projects nor locations. + rpc ListAssignments(ListAssignmentsRequest) returns (ListAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a assignment. No expansion will happen. + // E.g: + // organizationA contains project1 and project2. Reservation res1 exists. + // CreateAssignment was invoked previously and following assignments were + // created explicitly: + // + // + // Then deletion of won't affect . After + // deletion of , queries from project1 will still use + // res1, while queries from project2 will use on-demand mode. + rpc DeleteAssignment(DeleteAssignmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + // Same logic applies if the request is about a folder. + // If the request is about an organization, then assignments created on the + // organization will be returned (organization doesn't have ancestors). + // Comparing to ListAssignments, there are some behavior + // differences: + // 1) permission on the assignee will be verified in this API. + // 2) Hierarchy lookup (project->folder->organization) happens in this API. + // 3) Parent here is projects/*/locations/*, instead of + // projects/*/locations/*reservations/*. + // Note "-" cannot be used for projects + // nor locations. + rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + + // Moves a assignment under a new reservation. Customers can do this by + // deleting the existing assignment followed by creating another assignment + // under the new reservation, but this method provides a transactional way to + // do so, to make sure the assignee always has an associated reservation. + // Without the method customers might see some queries run on-demand which + // might be unexpected. + rpc MoveAssignment(MoveAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name,destination_id"; + } + + // Retrieves a BI reservation. + rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/biReservation}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a BI reservation. + // Only fields specified in the field_mask are updated. + // Singleton BI reservation always exists with default size 0. + // In order to reserve BI capacity it needs to be updated to an amount + // greater than 0. In order to release BI capacity reservation size + // must be set to 0. + rpc UpdateBiReservation(UpdateBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + patch: "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}" + body: "bi_reservation" + }; + option (google.api.method_signature) = "bi_reservation,update_mask"; + } +} + +// A reservation is a mechanism used to guarantee slots to users. +message Reservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Reservation" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}" + }; + + // The resource name of the reservation, e.g., + // "projects/*/locations/*/reservations/team1-prod". + string name = 1; + + // Minimum slots available to this reservation. A slot is a unit of + // computational power in BigQuery, and serves as the unit of parallelism. + // Queries using this reservation might use more slots during runtime if + // ignore_idle_slots is set to false. + // If the new reservation's slot capacity exceed the parent's slot capacity or + // if total slot capacity of the new reservation and its siblings exceeds the + // parent's slot capacity, the request will fail with + // `google.rpc.Code.RESOURCE_EXHAUSTED`. + 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. + bool ignore_idle_slots = 4; +} + +// Capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. Monthly and +// annual commitments renew by default. Only flex commitments can be removed. In +// order to remove monthly or annual commitments, their plan needs to be changed +// to flex first. +// +// A capacity commitment resource exists as a child resource of the admin +// project. +message CapacityCommitment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + pattern: "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}" + }; + + // Commitment plan defines the current committed period. Capacity commitment + // cannot be deleted during it's committed period. + enum CommitmentPlan { + // Invalid plan value. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + COMMITMENT_PLAN_UNSPECIFIED = 0; + + // Flex commitments have committed period of 1 minute after becoming ACTIVE. + // After that, they are not in a committed period anymore and can be removed + // any time. + FLEX = 3; + + // Monthly commitments have a committed period of 30 days after becoming + // ACTIVE. + MONTHLY = 2; + + // Annual commitments have a committed period of 365 days after becoming + // ACTIVE. + ANNUAL = 4; + } + + // Capacity commitment can either become ACTIVE right away or transition + // from PENDING to ACTIVE or FAILED. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Capacity commitment is pending provisioning. Pending capacity commitment + // does not contribute to the parent's slot_capacity. + PENDING = 1; + + // Once slots are provisioned, capacity commitment becomes active. + // slot_count is added to the parent's slot_capacity. + ACTIVE = 2; + + // Capacity commitment is failed to be activated by the backend. + FAILED = 3; + } + + // Output only. The resource name of the capacity commitment, e.g., + // projects/myproject/locations/US/capacityCommitments/123 + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of slots in this commitment. + int64 slot_count = 2; + + // Capacity commitment commitment plan. + CommitmentPlan plan = 3; + + // Output only. State of the commitment. + State state = 4 [(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]; + + // Output only. For FAILED commitment plan, provides the reason of failure. + google.rpc.Status failure_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The plan this capacity commitment is converted to after commitment_end_time + // passes. Once the plan is changed, committed period is extended according to + // commitment plan. Only applicable for MONTHLY and ANNUAL commitments. + CommitmentPlan renewal_plan = 8; +} + +// The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation]. +message CreateReservationRequest { + // Required. Project, location. E.g., + // projects/myproject/locations/US + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The reservation ID. This field must only contain lower case alphanumeric + // characters or dash. Max length is 64 characters. + string reservation_id = 2; + + // Content of the new reservation to create. + Reservation reservation = 3; +} + +// The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsRequest { + // Required. The parent resource name containing project and location, e.g.: + // "projects/myproject/locations/US" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsResponse { + // List of reservations visible to the user. + repeated Reservation reservations = 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.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation]. +message GetReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // projects/myproject/locations/US/reservations/team1-prod + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation]. +message DeleteReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // projects/myproject/locations/US/reservations/team1-prod + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation]. +message UpdateReservationRequest { + // Content of the reservation to update. + Reservation reservation = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsRequest { + // Required. Resource name of the parent reservation. E.g., + // projects/myproject/locations/US + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsResponse { + // List of capacity commitments visible to the user. + repeated CapacityCommitment capacity_commitments = 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.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment]. +message GetCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to retrieve. E.g., + // projects/myproject/locations/US/capacityCommitments/123 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; +} + +// The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment]. +message DeleteCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to delete. E.g., + // projects/myproject/locations/US/capacityCommitments/123 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; +} + +// The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment]. +message UpdateCapacityCommitmentRequest { + // Content of the capacity commitment to update. + CapacityCommitment capacity_commitment = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentRequest { + // Required. The resource name e.g.,: + // projects/myproject/locations/US/capacityCommitments/123 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Number of slots in the capacity commitment after the split. + int64 slot_count = 2; +} + +// The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentResponse { + // First capacity commitment, result of a split. + CapacityCommitment first = 1; + + // Second capacity commitment, result of a split. + CapacityCommitment second = 2; +} + +// The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments]. +message MergeCapacityCommitmentsRequest { + // Parent resource that identifies admin project and location e.g., + // projects/myproject/locations/us + string parent = 1 [(google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + }]; + + // Ids of capacity commitments to merge. + // These capacity commitments must exist under admin project and location + // specified in the parent. + repeated string capacity_commitment_ids = 2; +} + +// A Assignment allows a project to submit jobs +// of a certain type using slots from the specified reservation. +message Assignment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Assignment" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}" + }; + + // Types of job, which could be specified when using the reservation. + enum JobType { + // Invalid type. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + JOB_TYPE_UNSPECIFIED = 0; + + // Pipeline (load/export) jobs from the project will use the reservation. + PIPELINE = 1; + + // Query jobs from the project will use the reservation. + QUERY = 2; + } + + // Assignment will remain in PENDING state if no active capacity commitment is + // present. It will become ACTIVE when some capacity commitment becomes + // active. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Queries from assignee will be executed as on-demand, if related + // assignment is pending. + PENDING = 1; + + // Assignment is ready. + ACTIVE = 2; + } + + // Output only. Name of the resource. E.g.: + // projects/myproject/locations/US/reservations/team1-prod/assignments/123. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource which will use the reservation. E.g. + // projects/myproject, folders/123, organizations/456. + string assignee = 4; + + // Which type of jobs will use the reservation. + JobType job_type = 3; + + // Output only. State of the assignment. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. +// Note: "bigquery.reservationAssignments.create" permission is required on the +// related assignee. +message CreateAssignmentRequest { + // Required. The parent resource name of the assignment + // E.g.: projects/myproject/locations/US/reservations/team1-prod + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // Assignment resource to create. + Assignment assignment = 2; +} + +// The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsRequest { + // Required. The parent resource name e.g.: + // projects/myproject/locations/US/reservations/team1-prod + // Or: + // projects/myproject/locations/US/reservations/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsResponse { + // 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.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. +// Note: "bigquery.reservationAssignments.delete" permission is required on the +// related assignee. +message DeleteAssignmentRequest { + // Required. Name of the resource, e.g.: + // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; +} + +// The request for +// [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAssignmentsRequest { + // Required. The resource name of the admin project(containing project and location), + // e.g.: + // "projects/myproject/locations/US". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // Please specify resource name as assignee in the query. + // e.g., "assignee=projects/myproject" + // "assignee=folders/123" + // "assignee=organizations/456" + string query = 2; + + // The maximum number of items to return. + 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. + 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]. +// Note: "bigquery.reservationAssignments.create" permission is required on the +// destination_id. Note: "bigquery.reservationAssignments.create" and +// "bigquery.reservationAssignments.delete" permission is required on the +// related assignee. +message MoveAssignmentRequest { + // Required. The resource name of the assignment, + // e.g.: + // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // The new reservation ID, e.g.: + // projects/myotherproject/locations/US/reservations/team2-prod + string destination_id = 3; +} + +// Represents a BI Reservation. +message BiReservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/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`. + string name = 1; + + // Output only. The last update timestamp of a reservation. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Size of a reservation, in bytes. + int64 size = 4; +} + +// 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` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/BiReservation" + } + ]; +} + +// A request to update a BI reservation. +message UpdateBiReservationRequest { + // A reservation to update. + BiReservation bi_reservation = 1; + + // A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/proto-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml b/proto-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml new file mode 100644 index 00000000..0414f8c8 --- /dev/null +++ b/proto-google-cloud-bigqueryreservations-v1beta1/.flattened-pom.xml @@ -0,0 +1,190 @@ + + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-bigqueryreservations-v1beta1 + PROTO library for proto-google-cloud-bigqueryreservations-v1beta1 + https://github.com/googleapis/java-bigqueryreservations/proto-google-cloud-bigqueryreservations-v1beta1 + + Google LLC + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/proto-google-cloud-bigqueryreservations-v1beta1 + scm:git:git@github.com:googleapis/java-bigqueryreservations.git/proto-google-cloud-bigqueryreservations-v1beta1 + https://github.com/googleapis/java-bigqueryreservations/proto-google-cloud-bigqueryreservations-v1beta1 + + + GitHub Issues + https://github.com/googleapis/java-bigqueryreservations/issues + + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + + com.google.protobuf + protobuf-java + 3.11.4 + compile + false + + + com.google.api.grpc + proto-google-common-protos + 1.17.0 + compile + + + protobuf-java + com.google.protobuf + + + false + + + com.google.api + api-common + 1.9.0 + compile + + + jsr305 + com.google.code.findbugs + + + guava + com.google.guava + + + javax.annotation-api + javax.annotation + + + auto-value-annotations + com.google.auto.value + + + false + + + com.google.code.findbugs + jsr305 + 3.0.2 + compile + false + + + javax.annotation + javax.annotation-api + 1.3.2 + compile + false + + + com.google.auto.value + auto-value-annotations + 1.7 + compile + false + + + com.google.guava + guava + 29.0-android + compile + + + failureaccess + com.google.guava + + + listenablefuture + com.google.guava + + + jsr305 + com.google.code.findbugs + + + checker-compat-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + j2objc-annotations + com.google.j2objc + + + srczip + jdk + + + false + + + com.google.guava + failureaccess + 1.0.1 + compile + false + + + com.google.guava + listenablefuture + 9999.0-empty-to-avoid-conflict-with-guava + compile + false + + + org.checkerframework + checker-compat-qual + 2.5.5 + compile + false + + + com.google.errorprone + error_prone_annotations + 2.3.4 + compile + false + + + com.google.j2objc + j2objc-annotations + 1.3 + compile + false + + + diff --git a/proto-google-cloud-bigqueryreservations-v1beta1/pom.xml b/proto-google-cloud-bigqueryreservations-v1beta1/pom.xml new file mode 100644 index 00000000..0f6d787a --- /dev/null +++ b/proto-google-cloud-bigqueryreservations-v1beta1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigqueryreservations-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-bigqueryreservations-v1beta1 + PROTO library for proto-google-cloud-bigqueryreservations-v1beta1 + + com.google.cloud + google-cloud-bigqueryreservations-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..88e76db6 --- /dev/null +++ b/renovate.json @@ -0,0 +1,80 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-bigqueryreservations", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true +} \ No newline at end of file diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..4621d4b2 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + bigqueryreservations-install-without-bom + jar + Google Cloud BigQuery Reservations Install Without Bom + https://github.com/googleapis/java-bigqueryreservations + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-bigqueryreservations + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..ea86d0c4 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigqueryreservations-samples + 0.0.1-SNAPSHOT + pom + Google Cloud BigQuery Reservations Samples Parent + https://github.com/googleapis/java-bigqueryreservations + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..0ffb5d1d --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + bigqueryreservations-snapshot + jar + Google Cloud BigQuery Reservations Snapshot Samples + https://github.com/googleapis/java-bigqueryreservations + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-bigqueryreservations + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..06f7d318 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + com.google.cloud + bigqueryreservations-snippets + jar + Google Cloud BigQuery Reservations Snippets + https://github.com/googleapis/java-bigqueryreservations + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 5.1.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigqueryreservations + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..3de7d526 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://devrel/cloud/libraries/java/repo-splitter", + "sha": "7e3cf12eef6abffeac8067f0f100537aca3a1cdf" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2bf9f22da3f101aeb536e1e88fe036323b8e9188", + "internalRef": "307654927" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "21ce80f9d4785dc75aa36d26944bddd5a1b7e25b" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigquery-reservation", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..32bf929d --- /dev/null +++ b/synth.py @@ -0,0 +1,33 @@ +# 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +service = 'bigquery-reservation' +versions = ['v1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + package_pattern='com.google.cloud.{service}.{version}', + proto_path=f'google/cloud/bigquery/reservation/{version}', + bazel_target=f'//google/cloud/bigquery/reservation/{version}:google-cloud-bigquery-reservation-{version}-java', + ) + +java.common_templates() diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..e77404ac --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-bigqueryreservations:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-bigqueryreservations-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-bigqueryreservations-v1beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file