From cb2c4c47c25e8220729c5d22fccc3994f296ce71 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 11 Sep 2020 08:16:24 -0700 Subject: [PATCH] feat: initial code generation --- .github/CODEOWNERS | 8 + .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 + .github/workflows/ci.yaml | 79 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 111 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 59 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/dependencies.sh | 89 + .kokoro/linkage-monitor.sh | 46 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/integration.cfg | 37 + .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/samples.cfg | 38 + .kokoro/populate-secrets.sh | 43 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 33 + .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 | 33 + .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 | 29 + .kokoro/release/publish_javadoc.sh | 76 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 19 + .kokoro/release/stage.sh | 42 + .kokoro/trampoline.sh | 26 + .repo-metadata.json | 15 + CODE_OF_CONDUCT.md | 93 + CONTRIBUTING.md | 139 + LICENSE | 202 + README.md | 143 + codecov.yaml | 4 + google-cloud-assured-workloads-bom/pom.xml | 97 + google-cloud-assured-workloads/pom.xml | 111 + .../AssuredWorkloadsServiceClient.java | 826 ++ .../AssuredWorkloadsServiceSettings.java | 249 + .../v1beta1/package-info.java | 41 + .../stub/AssuredWorkloadsServiceStub.java | 85 + .../AssuredWorkloadsServiceStubSettings.java | 509 + ...ssuredWorkloadsServiceCallableFactory.java | 115 + .../stub/GrpcAssuredWorkloadsServiceStub.java | 323 + .../AssuredWorkloadsServiceClientTest.java | 329 + .../v1beta1/MockAssuredWorkloadsService.java | 57 + .../MockAssuredWorkloadsServiceImpl.java | 134 + .../pom.xml | 69 + .../v1beta1/AssuredWorkloadsServiceGrpc.java | 857 ++ java.header | 15 + license-checks.xml | 10 + pom.xml | 189 + .../pom.xml | 42 + .../v1beta1/AssuredworkloadsProto.java | 411 + .../CreateWorkloadOperationMetadata.java | 1305 +++ ...ateWorkloadOperationMetadataOrBuilder.java | 144 + .../v1beta1/CreateWorkloadRequest.java | 1168 ++ .../CreateWorkloadRequestOrBuilder.java | 128 + .../v1beta1/DeleteWorkloadRequest.java | 858 ++ .../DeleteWorkloadRequestOrBuilder.java | 85 + .../v1beta1/GetWorkloadRequest.java | 682 ++ .../v1beta1/GetWorkloadRequestOrBuilder.java | 62 + .../v1beta1/ListWorkloadsRequest.java | 1133 ++ .../ListWorkloadsRequestOrBuilder.java | 125 + .../v1beta1/ListWorkloadsResponse.java | 1147 ++ .../ListWorkloadsResponseOrBuilder.java | 102 + .../v1beta1/LocationName.java | 182 + .../v1beta1/UpdateWorkloadRequest.java | 1087 ++ .../UpdateWorkloadRequestOrBuilder.java | 113 + .../assuredworkloads/v1beta1/Workload.java | 9819 +++++++++++++++++ .../v1beta1/WorkloadName.java | 215 + .../v1beta1/WorkloadOrBuilder.java | 533 + .../v1beta1/assuredworkloads_v1beta1.proto | 403 + renovate.json | 81 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + synth.metadata | 134 + synth.py | 33 + versions.txt | 6 + 106 files changed, 26302 insertions(+) create mode 100644 .github/CODEOWNERS 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 .github/workflows/ci.yaml create mode 100644 .github/workflows/samples.yaml 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/java8.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/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/samples.cfg create mode 100755 .kokoro/populate-secrets.sh 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-assured-workloads-bom/pom.xml create mode 100644 google-cloud-assured-workloads/pom.xml create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClient.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceSettings.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/package-info.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStub.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStubSettings.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceCallableFactory.java create mode 100644 google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceStub.java create mode 100644 google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClientTest.java create mode 100644 google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsService.java create mode 100644 google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsServiceImpl.java create mode 100644 grpc-google-cloud-assured-workloads-v1beta1/pom.xml create mode 100644 grpc-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 pom.xml create mode 100644 proto-google-cloud-assured-workloads-v1beta1/pom.xml create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredworkloadsProto.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequestOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequestOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequestOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequestOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponseOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/LocationName.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequestOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadName.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadOrBuilder.java create mode 100644 proto-google-cloud-assured-workloads-v1beta1/src/main/proto/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto 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/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..6137bef2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6830cae9 --- /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-assured-workloads/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. assuredworkloads 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..b23a4d6a --- /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-assured-workloads/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/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..68302207 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr \ No newline at end of file diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..a1d50073 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..cc0bc34a --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..63569a0f --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,111 @@ +#!/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_GFILE_DIR}/${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 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-assured-workloads +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..2be69e97 --- /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-assured-workloads/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.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..fe05bfd7 --- /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-assured-workloads/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} 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/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..c91e5a56 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,89 @@ +#!/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 + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -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 \ No newline at end of file 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..fe05bfd7 --- /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-assured-workloads/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/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: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "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..8012de98 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-assured-workloads/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..ade8d3ad --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-assured-workloads/.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/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# 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: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/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. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done 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..c48fcf37 --- /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-assured-workloads/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.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..020167d2 --- /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-assured-workloads/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# 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: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "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..8012de98 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-assured-workloads/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..ade8d3ad --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-assured-workloads/.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..ade4e3b8 --- /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-assured-workloads/.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..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# 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: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..ea9c82eb --- /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-assured-workloads/.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-assured-workloads/.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..6adbe400 --- /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-assured-workloads/.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..af683656 --- /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-assured-workloads/.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..0cc9befd --- /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-assured-workloads/.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..8968d2c3 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,29 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2-staging" + # Production will be at: docs-staging-v2 +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.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..55a1ad29 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,76 @@ +#!/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 + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 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 -q -DskipTests=true + +NAME=google-cloud-assured-workloads +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +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 + +# V2 +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite + +# 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_V2} diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..7cd73ce2 --- /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-assured-workloads/.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..ad10fa5b --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-assured-workloads/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-assured-workloads/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-assured-workloads" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} 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..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/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 + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..ae58bb4c --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "assuredworkloads", + "name_pretty": "Assured Workloads for Government", + "product_documentation": "https://cloud.google.com/assured-workloads/", + "api_description": "allows you to secure your government workloads and accelerate your path to running compliant workloads on Google Cloud with Assured Workloads for Government.", + "client_documentation": "https://googleapis.dev/java/google-cloud-assured-workloads/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-assured-workloads", + "repo_short": "java-assured-workloads", + "distribution_name": "com.google.cloud:google-cloud-assured-workloads", + "api_id": "assuredworkloads.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..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# 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. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### 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..63e42e48 --- /dev/null +++ b/README.md @@ -0,0 +1,143 @@ +# Google Assured Workloads for Government Client for Java + +Java idiomatic client for [Assured Workloads for Government][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, add this to your pom.xml file: + +```xml + + com.google.cloud + google-cloud-assured-workloads + 0.0.0 + +``` + +[//]: # ({x-version-update-start:google-cloud-assured-workloads:released}) + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-assured-workloads:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-assured-workloads" % "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 Assured Workloads for Government [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Assured Workloads for Government. +[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-assured-workloads` library. See the [Quickstart](#quickstart) section +to add `google-cloud-assured-workloads` as a dependency in your code. + +## About Assured Workloads for Government + + +[Assured Workloads for Government][product-docs] allows you to secure your government workloads and accelerate your path to running compliant workloads on Google Cloud with Assured Workloads for Government. + +See the [Assured Workloads for Government client library docs][javadocs] to learn how to +use this Assured Workloads for Government Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Assured Workloads for Government 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/assured-workloads/ +[javadocs]: https://googleapis.dev/java/google-cloud-assured-workloads/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-assured-workloads/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-assured-workloads.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-assured-workloads&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-assured-workloads/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-assured-workloads/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-assured-workloads/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=assuredworkloads.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-assured-workloads-bom/pom.xml b/google-cloud-assured-workloads-bom/pom.xml new file mode 100644 index 00000000..a7cdd17e --- /dev/null +++ b/google-cloud-assured-workloads-bom/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + com.google.cloud + google-cloud-assured-workloads-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + Google Assured Workloads for Government BOM + https://github.com/googleapis/java-assured-workloads + + BOM for Assured Workloads for Government + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-assured-workloads.git + scm:git:git@github.com:googleapis/java-assured-workloads.git + https://github.com/googleapis/java-assured-workloads + + + + true + + + + + 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-assured-workloads + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-assured-workloads/pom.xml b/google-cloud-assured-workloads/pom.xml new file mode 100644 index 00000000..c2747d5f --- /dev/null +++ b/google-cloud-assured-workloads/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-assured-workloads + 0.0.1-SNAPSHOT + jar + Google Assured Workloads for Government + https://github.com/googleapis/java-assured-workloads + allows you to secure your government workloads and accelerate your path to running compliant workloads on Google Cloud with Assured Workloads for Government. + + com.google.cloud + google-cloud-assured-workloads-parent + 0.0.1-SNAPSHOT + + + google-cloud-assured-workloads + + + + 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-assured-workloads-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13 + + + + com.google.api.grpc + grpc-google-cloud-assured-workloads-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/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClient.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClient.java new file mode 100644 index 00000000..681bf00b --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClient.java @@ -0,0 +1,826 @@ +/* + * 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.assuredworkloads.v1beta1; + +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.longrunning.OperationFuture; +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.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.assuredworkloads.v1beta1.stub.AssuredWorkloadsServiceStub; +import com.google.cloud.assuredworkloads.v1beta1.stub.AssuredWorkloadsServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +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: Service to manage AssuredWorkloads. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+ *   Workload workload = Workload.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Workload response = assuredWorkloadsServiceClient.updateWorkload(workload, updateMask);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the assuredWorkloadsServiceClient 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 + * AssuredWorkloadsServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * AssuredWorkloadsServiceSettings assuredWorkloadsServiceSettings =
+ *     AssuredWorkloadsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+ *     AssuredWorkloadsServiceClient.create(assuredWorkloadsServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AssuredWorkloadsServiceSettings assuredWorkloadsServiceSettings =
+ *     AssuredWorkloadsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+ *     AssuredWorkloadsServiceClient.create(assuredWorkloadsServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssuredWorkloadsServiceClient implements BackgroundResource { + private final AssuredWorkloadsServiceSettings settings; + private final AssuredWorkloadsServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AssuredWorkloadsServiceClient with default settings. */ + public static final AssuredWorkloadsServiceClient create() throws IOException { + return create(AssuredWorkloadsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AssuredWorkloadsServiceClient, 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 AssuredWorkloadsServiceClient create(AssuredWorkloadsServiceSettings settings) + throws IOException { + return new AssuredWorkloadsServiceClient(settings); + } + + /** + * Constructs an instance of AssuredWorkloadsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer to use AssuredWorkloadsServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AssuredWorkloadsServiceClient create(AssuredWorkloadsServiceStub stub) { + return new AssuredWorkloadsServiceClient(stub); + } + + /** + * Constructs an instance of AssuredWorkloadsServiceClient, 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 AssuredWorkloadsServiceClient(AssuredWorkloadsServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((AssuredWorkloadsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AssuredWorkloadsServiceClient(AssuredWorkloadsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AssuredWorkloadsServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssuredWorkloadsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates Assured Workload. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Workload workload = Workload.newBuilder().build();
+   *   Workload response = assuredWorkloadsServiceClient.createWorkloadAsync(parent, workload).get();
+   * }
+   * 
+ * + * @param parent Required. The resource name of the new Workload's parent. Must be of the form + * `organizations/{org_id}/locations/{location_id}`. + * @param workload Required. Assured Workload to create + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createWorkloadAsync( + LocationName parent, Workload workload) { + CreateWorkloadRequest request = + CreateWorkloadRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWorkload(workload) + .build(); + return createWorkloadAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates Assured Workload. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Workload workload = Workload.newBuilder().build();
+   *   Workload response = assuredWorkloadsServiceClient.createWorkloadAsync(parent.toString(), workload).get();
+   * }
+   * 
+ * + * @param parent Required. The resource name of the new Workload's parent. Must be of the form + * `organizations/{org_id}/locations/{location_id}`. + * @param workload Required. Assured Workload to create + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createWorkloadAsync( + String parent, Workload workload) { + CreateWorkloadRequest request = + CreateWorkloadRequest.newBuilder().setParent(parent).setWorkload(workload).build(); + return createWorkloadAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates Assured Workload. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Workload workload = Workload.newBuilder().build();
+   *   CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkload(workload)
+   *     .build();
+   *   Workload response = assuredWorkloadsServiceClient.createWorkloadAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createWorkloadAsync( + CreateWorkloadRequest request) { + return createWorkloadOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates Assured Workload. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Workload workload = Workload.newBuilder().build();
+   *   CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkload(workload)
+   *     .build();
+   *   OperationFuture<Workload, CreateWorkloadOperationMetadata> future = assuredWorkloadsServiceClient.createWorkloadOperationCallable().futureCall(request);
+   *   // Do something
+   *   Workload response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createWorkloadOperationCallable() { + return stub.createWorkloadOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates Assured Workload. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Workload workload = Workload.newBuilder().build();
+   *   CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkload(workload)
+   *     .build();
+   *   ApiFuture<Operation> future = assuredWorkloadsServiceClient.createWorkloadCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createWorkloadCallable() { + return stub.createWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing workload. Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. Only one update operation per workload + * can be in progress. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   Workload workload = Workload.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Workload response = assuredWorkloadsServiceClient.updateWorkload(workload, updateMask);
+   * }
+   * 
+ * + * @param workload Required. The workload to update. The workload’s `name` field is used to + * identify the workload to be updated. Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param updateMask Required. The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload updateWorkload(Workload workload, FieldMask updateMask) { + UpdateWorkloadRequest request = + UpdateWorkloadRequest.newBuilder().setWorkload(workload).setUpdateMask(updateMask).build(); + return updateWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing workload. Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. Only one update operation per workload + * can be in progress. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   Workload workload = Workload.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateWorkloadRequest request = UpdateWorkloadRequest.newBuilder()
+   *     .setWorkload(workload)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Workload response = assuredWorkloadsServiceClient.updateWorkload(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 Workload updateWorkload(UpdateWorkloadRequest request) { + return updateWorkloadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing workload. Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. Only one update operation per workload + * can be in progress. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   Workload workload = Workload.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateWorkloadRequest request = UpdateWorkloadRequest.newBuilder()
+   *     .setWorkload(workload)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Workload> future = assuredWorkloadsServiceClient.updateWorkloadCallable().futureCall(request);
+   *   // Do something
+   *   Workload response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateWorkloadCallable() { + return stub.updateWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the workload. Make sure that workload's direct children are already in a deleted state, + * otherwise the request will fail with a FAILED_PRECONDITION error. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   assuredWorkloadsServiceClient.deleteWorkload(name);
+   * }
+   * 
+ * + * @param name Required. The `name` field is used to identify the workload. Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteWorkload(WorkloadName name) { + DeleteWorkloadRequest request = + DeleteWorkloadRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the workload. Make sure that workload's direct children are already in a deleted state, + * otherwise the request will fail with a FAILED_PRECONDITION error. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   assuredWorkloadsServiceClient.deleteWorkload(name.toString());
+   * }
+   * 
+ * + * @param name Required. The `name` field is used to identify the workload. Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteWorkload(String name) { + DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder().setName(name).build(); + deleteWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the workload. Make sure that workload's direct children are already in a deleted state, + * otherwise the request will fail with a FAILED_PRECONDITION error. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   assuredWorkloadsServiceClient.deleteWorkload(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 deleteWorkload(DeleteWorkloadRequest request) { + deleteWorkloadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the workload. Make sure that workload's direct children are already in a deleted state, + * otherwise the request will fail with a FAILED_PRECONDITION error. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = assuredWorkloadsServiceClient.deleteWorkloadCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteWorkloadCallable() { + return stub.deleteWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets Assured Workload associated with a CRM Node + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   Workload response = assuredWorkloadsServiceClient.getWorkload(name);
+   * }
+   * 
+ * + * @param name Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For + * example, "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(WorkloadName name) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets Assured Workload associated with a CRM Node + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   Workload response = assuredWorkloadsServiceClient.getWorkload(name.toString());
+   * }
+   * 
+ * + * @param name Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For + * example, "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(String name) { + GetWorkloadRequest request = GetWorkloadRequest.newBuilder().setName(name).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets Assured Workload associated with a CRM Node + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   GetWorkloadRequest request = GetWorkloadRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Workload response = assuredWorkloadsServiceClient.getWorkload(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 Workload getWorkload(GetWorkloadRequest request) { + return getWorkloadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets Assured Workload associated with a CRM Node + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   GetWorkloadRequest request = GetWorkloadRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Workload> future = assuredWorkloadsServiceClient.getWorkloadCallable().futureCall(request);
+   *   // Do something
+   *   Workload response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getWorkloadCallable() { + return stub.getWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists Assured Workloads under a CRM Node. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (Workload element : assuredWorkloadsServiceClient.listWorkloads(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. Parent Resource to list workloads from. Must be of the form + * `organizations/{org_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(LocationName parent) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists Assured Workloads under a CRM Node. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (Workload element : assuredWorkloadsServiceClient.listWorkloads(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. Parent Resource to list workloads from. Must be of the form + * `organizations/{org_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(String parent) { + ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder().setParent(parent).build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists Assured Workloads under a CRM Node. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Workload element : assuredWorkloadsServiceClient.listWorkloads(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 ListWorkloadsPagedResponse listWorkloads(ListWorkloadsRequest request) { + return listWorkloadsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists Assured Workloads under a CRM Node. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListWorkloadsPagedResponse> future = assuredWorkloadsServiceClient.listWorkloadsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Workload element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listWorkloadsPagedCallable() { + return stub.listWorkloadsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists Assured Workloads under a CRM Node. + * + *

Sample code: + * + *


+   * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListWorkloadsResponse response = assuredWorkloadsServiceClient.listWorkloadsCallable().call(request);
+   *     for (Workload element : response.getWorkloadsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listWorkloadsCallable() { + return stub.listWorkloadsCallable(); + } + + @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 ListWorkloadsPagedResponse + extends AbstractPagedListResponse< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkloadsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListWorkloadsPagedResponse apply(ListWorkloadsPage input) { + return new ListWorkloadsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListWorkloadsPagedResponse(ListWorkloadsPage page) { + super(page, ListWorkloadsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkloadsPage + extends AbstractPage< + ListWorkloadsRequest, ListWorkloadsResponse, Workload, ListWorkloadsPage> { + + private ListWorkloadsPage( + PageContext context, + ListWorkloadsResponse response) { + super(context, response); + } + + private static ListWorkloadsPage createEmptyPage() { + return new ListWorkloadsPage(null, null); + } + + @Override + protected ListWorkloadsPage createPage( + PageContext context, + ListWorkloadsResponse response) { + return new ListWorkloadsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkloadsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + private ListWorkloadsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkloadsFixedSizeCollection createEmptyCollection() { + return new ListWorkloadsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkloadsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkloadsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceSettings.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceSettings.java new file mode 100644 index 00000000..45a6f40a --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceSettings.java @@ -0,0 +1,249 @@ +/* + * 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.assuredworkloads.v1beta1; + +import static com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; + +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.OperationCallSettings; +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.assuredworkloads.v1beta1.stub.AssuredWorkloadsServiceStubSettings; +import com.google.longrunning.Operation; +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 AssuredWorkloadsServiceClient}. + * + *

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

    + *
  • The default service address (assuredworkloads.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 updateWorkload to 30 seconds: + * + *

+ * 
+ * AssuredWorkloadsServiceSettings.Builder assuredWorkloadsServiceSettingsBuilder =
+ *     AssuredWorkloadsServiceSettings.newBuilder();
+ * assuredWorkloadsServiceSettingsBuilder
+ *     .updateWorkloadSettings()
+ *     .setRetrySettings(
+ *         assuredWorkloadsServiceSettingsBuilder.updateWorkloadSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssuredWorkloadsServiceSettings assuredWorkloadsServiceSettings = assuredWorkloadsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssuredWorkloadsServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to createWorkload. */ + public UnaryCallSettings createWorkloadSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).createWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to createWorkload. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createWorkloadOperationSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()) + .createWorkloadOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkload. */ + public UnaryCallSettings updateWorkloadSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).updateWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkload. */ + public UnaryCallSettings deleteWorkloadSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).deleteWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).getWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).listWorkloadsSettings(); + } + + public static final AssuredWorkloadsServiceSettings create( + AssuredWorkloadsServiceStubSettings stub) throws IOException { + return new AssuredWorkloadsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AssuredWorkloadsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AssuredWorkloadsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AssuredWorkloadsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AssuredWorkloadsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AssuredWorkloadsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AssuredWorkloadsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AssuredWorkloadsServiceStubSettings.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 AssuredWorkloadsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AssuredWorkloadsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AssuredWorkloadsServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AssuredWorkloadsServiceStubSettings.newBuilder()); + } + + protected Builder(AssuredWorkloadsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AssuredWorkloadsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AssuredWorkloadsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AssuredWorkloadsServiceStubSettings.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 createWorkload. */ + public UnaryCallSettings.Builder createWorkloadSettings() { + return getStubSettingsBuilder().createWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkload. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> + createWorkloadOperationSettings() { + return getStubSettingsBuilder().createWorkloadOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkload. */ + public UnaryCallSettings.Builder updateWorkloadSettings() { + return getStubSettingsBuilder().updateWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkload. */ + public UnaryCallSettings.Builder deleteWorkloadSettings() { + return getStubSettingsBuilder().deleteWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getStubSettingsBuilder().getWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return getStubSettingsBuilder().listWorkloadsSettings(); + } + + @Override + public AssuredWorkloadsServiceSettings build() throws IOException { + return new AssuredWorkloadsServiceSettings(this); + } + } +} diff --git a/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/package-info.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/package-info.java new file mode 100644 index 00000000..222dc6e0 --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/package-info.java @@ -0,0 +1,41 @@ +/* + * 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 Assured Workloads API. + * + *

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

============================= AssuredWorkloadsServiceClient ============================= + * + *

Service Description: Service to manage AssuredWorkloads. + * + *

Sample for AssuredWorkloadsServiceClient: + * + *

+ * 
+ * try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = AssuredWorkloadsServiceClient.create()) {
+ *   Workload workload = Workload.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Workload response = assuredWorkloadsServiceClient.updateWorkload(workload, updateMask);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.assuredworkloads.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStub.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStub.java new file mode 100644 index 00000000..b8f0c3c9 --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStub.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. + */ +package com.google.cloud.assuredworkloads.v1beta1.stub; + +import static com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; +import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.Workload; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Assured Workloads 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 AssuredWorkloadsServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createWorkloadOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkloadOperationCallable()"); + } + + public UnaryCallable createWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkloadCallable()"); + } + + public UnaryCallable updateWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkloadCallable()"); + } + + public UnaryCallable deleteWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkloadCallable()"); + } + + public UnaryCallable getWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkloadCallable()"); + } + + public UnaryCallable + listWorkloadsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsPagedCallable()"); + } + + public UnaryCallable listWorkloadsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStubSettings.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStubSettings.java new file mode 100644 index 00000000..9d544ae1 --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStubSettings.java @@ -0,0 +1,509 @@ +/* + * 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.assuredworkloads.v1beta1.stub; + +import static com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; + +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.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +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.OperationCallSettings; +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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; +import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.Workload; +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.longrunning.Operation; +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 AssuredWorkloadsServiceStub}. + * + *

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

    + *
  • The default service address (assuredworkloads.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 updateWorkload to 30 seconds: + * + *

+ * 
+ * AssuredWorkloadsServiceStubSettings.Builder assuredWorkloadsServiceSettingsBuilder =
+ *     AssuredWorkloadsServiceStubSettings.newBuilder();
+ * assuredWorkloadsServiceSettingsBuilder
+ *     .updateWorkloadSettings()
+ *     .setRetrySettings(
+ *         assuredWorkloadsServiceSettingsBuilder.updateWorkloadSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssuredWorkloadsServiceStubSettings assuredWorkloadsServiceSettings = assuredWorkloadsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssuredWorkloadsServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createWorkloadSettings; + private final OperationCallSettings< + CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> + createWorkloadOperationSettings; + private final UnaryCallSettings updateWorkloadSettings; + private final UnaryCallSettings deleteWorkloadSettings; + private final UnaryCallSettings getWorkloadSettings; + private final PagedCallSettings< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + + /** Returns the object with the settings used for calls to createWorkload. */ + public UnaryCallSettings createWorkloadSettings() { + return createWorkloadSettings; + } + + /** Returns the object with the settings used for calls to createWorkload. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createWorkloadOperationSettings() { + return createWorkloadOperationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkload. */ + public UnaryCallSettings updateWorkloadSettings() { + return updateWorkloadSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkload. */ + public UnaryCallSettings deleteWorkloadSettings() { + return deleteWorkloadSettings; + } + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssuredWorkloadsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAssuredWorkloadsServiceStub.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 "assuredworkloads.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(AssuredWorkloadsServiceStubSettings.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 AssuredWorkloadsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createWorkloadSettings = settingsBuilder.createWorkloadSettings().build(); + createWorkloadOperationSettings = settingsBuilder.createWorkloadOperationSettings().build(); + updateWorkloadSettings = settingsBuilder.updateWorkloadSettings().build(); + deleteWorkloadSettings = settingsBuilder.deleteWorkloadSettings().build(); + getWorkloadSettings = settingsBuilder.getWorkloadSettings().build(); + listWorkloadsSettings = settingsBuilder.listWorkloadsSettings().build(); + } + + private static final PagedListDescriptor + LIST_WORKLOADS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkloadsRequest injectToken(ListWorkloadsRequest payload, String token) { + return ListWorkloadsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkloadsRequest injectPageSize(ListWorkloadsRequest payload, int pageSize) { + return ListWorkloadsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkloadsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkloadsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkloadsResponse payload) { + return payload.getWorkloadsList() != null + ? payload.getWorkloadsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + LIST_WORKLOADS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkloadsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WORKLOADS_PAGE_STR_DESC, request, context); + return ListWorkloadsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AssuredWorkloadsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createWorkloadSettings; + private final OperationCallSettings.Builder< + CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> + createWorkloadOperationSettings; + private final UnaryCallSettings.Builder updateWorkloadSettings; + private final UnaryCallSettings.Builder deleteWorkloadSettings; + private final UnaryCallSettings.Builder getWorkloadSettings; + private final PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_1_codes", 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(200L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createWorkloadOperationSettings = OperationCallSettings.newBuilder(); + + updateWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listWorkloadsSettings = PagedCallSettings.newBuilder(LIST_WORKLOADS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createWorkloadSettings, + updateWorkloadSettings, + deleteWorkloadSettings, + getWorkloadSettings, + listWorkloadsSettings); + + 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 + .createWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listWorkloadsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .createWorkloadOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workload.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateWorkloadOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(AssuredWorkloadsServiceStubSettings settings) { + super(settings); + + createWorkloadSettings = settings.createWorkloadSettings.toBuilder(); + createWorkloadOperationSettings = settings.createWorkloadOperationSettings.toBuilder(); + updateWorkloadSettings = settings.updateWorkloadSettings.toBuilder(); + deleteWorkloadSettings = settings.deleteWorkloadSettings.toBuilder(); + getWorkloadSettings = settings.getWorkloadSettings.toBuilder(); + listWorkloadsSettings = settings.listWorkloadsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createWorkloadSettings, + updateWorkloadSettings, + deleteWorkloadSettings, + getWorkloadSettings, + listWorkloadsSettings); + } + + // 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 createWorkload. */ + public UnaryCallSettings.Builder createWorkloadSettings() { + return createWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to createWorkload. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> + createWorkloadOperationSettings() { + return createWorkloadOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkload. */ + public UnaryCallSettings.Builder updateWorkloadSettings() { + return updateWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkload. */ + public UnaryCallSettings.Builder deleteWorkloadSettings() { + return deleteWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + @Override + public AssuredWorkloadsServiceStubSettings build() throws IOException { + return new AssuredWorkloadsServiceStubSettings(this); + } + } +} diff --git a/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceCallableFactory.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceCallableFactory.java new file mode 100644 index 00000000..72e5fd2c --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceCallableFactory.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.assuredworkloads.v1beta1.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 Assured Workloads 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 GrpcAssuredWorkloadsServiceCallableFactory 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-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceStub.java b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceStub.java new file mode 100644 index 00000000..c3f7f0ff --- /dev/null +++ b/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceStub.java @@ -0,0 +1,323 @@ +/* + * 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.assuredworkloads.v1beta1.stub; + +import static com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; + +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; +import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; +import com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1beta1.Workload; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +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 Assured Workloads 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 GrpcAssuredWorkloadsServiceStub extends AssuredWorkloadsServiceStub { + + private static final MethodDescriptor + createWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workload.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload") + .setRequestMarshaller(ProtoUtils.marshaller(GetWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workload.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listWorkloadsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkloadsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkloadsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createWorkloadCallable; + private final OperationCallable + createWorkloadOperationCallable; + private final UnaryCallable updateWorkloadCallable; + private final UnaryCallable deleteWorkloadCallable; + private final UnaryCallable getWorkloadCallable; + private final UnaryCallable listWorkloadsCallable; + private final UnaryCallable + listWorkloadsPagedCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAssuredWorkloadsServiceStub create( + AssuredWorkloadsServiceStubSettings settings) throws IOException { + return new GrpcAssuredWorkloadsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAssuredWorkloadsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAssuredWorkloadsServiceStub( + AssuredWorkloadsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAssuredWorkloadsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAssuredWorkloadsServiceStub( + AssuredWorkloadsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAssuredWorkloadsServiceStub, 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 GrpcAssuredWorkloadsServiceStub( + AssuredWorkloadsServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAssuredWorkloadsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAssuredWorkloadsServiceStub, 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 GrpcAssuredWorkloadsServiceStub( + AssuredWorkloadsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkloadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateWorkloadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWorkloadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateWorkloadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("workload.name", String.valueOf(request.getWorkload().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkloadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteWorkloadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkloadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetWorkloadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listWorkloadsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWorkloadsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListWorkloadsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.createWorkloadCallable = + callableFactory.createUnaryCallable( + createWorkloadTransportSettings, settings.createWorkloadSettings(), clientContext); + this.createWorkloadOperationCallable = + callableFactory.createOperationCallable( + createWorkloadTransportSettings, + settings.createWorkloadOperationSettings(), + clientContext, + this.operationsStub); + this.updateWorkloadCallable = + callableFactory.createUnaryCallable( + updateWorkloadTransportSettings, settings.updateWorkloadSettings(), clientContext); + this.deleteWorkloadCallable = + callableFactory.createUnaryCallable( + deleteWorkloadTransportSettings, settings.deleteWorkloadSettings(), clientContext); + this.getWorkloadCallable = + callableFactory.createUnaryCallable( + getWorkloadTransportSettings, settings.getWorkloadSettings(), clientContext); + this.listWorkloadsCallable = + callableFactory.createUnaryCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listWorkloadsPagedCallable = + callableFactory.createPagedCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createWorkloadOperationCallable() { + return createWorkloadOperationCallable; + } + + public UnaryCallable createWorkloadCallable() { + return createWorkloadCallable; + } + + public UnaryCallable updateWorkloadCallable() { + return updateWorkloadCallable; + } + + public UnaryCallable deleteWorkloadCallable() { + return deleteWorkloadCallable; + } + + public UnaryCallable getWorkloadCallable() { + return getWorkloadCallable; + } + + public UnaryCallable + listWorkloadsPagedCallable() { + return listWorkloadsPagedCallable; + } + + public UnaryCallable listWorkloadsCallable() { + return listWorkloadsCallable; + } + + @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-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClientTest.java b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClientTest.java new file mode 100644 index 00000000..9e66e71f --- /dev/null +++ b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClientTest.java @@ -0,0 +1,329 @@ +/* + * 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.assuredworkloads.v1beta1; + +import static com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; + +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.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +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.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 AssuredWorkloadsServiceClientTest { + private static MockAssuredWorkloadsService mockAssuredWorkloadsService; + private static MockServiceHelper serviceHelper; + private AssuredWorkloadsServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAssuredWorkloadsService = new MockAssuredWorkloadsService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAssuredWorkloadsService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AssuredWorkloadsServiceSettings settings = + AssuredWorkloadsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AssuredWorkloadsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createWorkloadTest() throws Exception { + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + String displayName = "displayName1615086568"; + String billingAccount = "billingAccount-545871767"; + String etag = "etag3123477"; + Workload expectedResponse = + Workload.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setBillingAccount(billingAccount) + .setEtag(etag) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkloadTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAssuredWorkloadsService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]"); + Workload workload = Workload.newBuilder().build(); + + Workload actualResponse = client.createWorkloadAsync(parent, workload).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkloadRequest actualRequest = (CreateWorkloadRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(workload, actualRequest.getWorkload()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]"); + Workload workload = Workload.newBuilder().build(); + + client.createWorkloadAsync(parent, workload).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateWorkloadTest() { + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + String displayName = "displayName1615086568"; + String billingAccount = "billingAccount-545871767"; + String etag = "etag3123477"; + Workload expectedResponse = + Workload.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setBillingAccount(billingAccount) + .setEtag(etag) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + Workload workload = Workload.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Workload actualResponse = client.updateWorkload(workload, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWorkloadRequest actualRequest = (UpdateWorkloadRequest) actualRequests.get(0); + + Assert.assertEquals(workload, actualRequest.getWorkload()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + Workload workload = Workload.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateWorkload(workload, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteWorkloadTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + + client.deleteWorkload(name); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkloadRequest actualRequest = (DeleteWorkloadRequest) actualRequests.get(0); + + Assert.assertEquals(name, WorkloadName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + + client.deleteWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getWorkloadTest() { + WorkloadName name2 = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + String displayName = "displayName1615086568"; + String billingAccount = "billingAccount-545871767"; + String etag = "etag3123477"; + Workload expectedResponse = + Workload.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setBillingAccount(billingAccount) + .setEtag(etag) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + + Workload actualResponse = client.getWorkload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkloadRequest actualRequest = (GetWorkloadRequest) actualRequests.get(0); + + Assert.assertEquals(name, WorkloadName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listWorkloadsTest() { + String nextPageToken = ""; + Workload workloadsElement = Workload.newBuilder().build(); + List workloads = Arrays.asList(workloadsElement); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllWorkloads(workloads) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().get(0), resources.get(0)); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkloadsRequest actualRequest = (ListWorkloadsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listWorkloadsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + LocationName parent = LocationName.of("[ORGANIZATION]", "[LOCATION]"); + + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsService.java b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsService.java new file mode 100644 index 00000000..d0099719 --- /dev/null +++ b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsService.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.assuredworkloads.v1beta1; + +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 MockAssuredWorkloadsService implements MockGrpcService { + private final MockAssuredWorkloadsServiceImpl serviceImpl; + + public MockAssuredWorkloadsService() { + serviceImpl = new MockAssuredWorkloadsServiceImpl(); + } + + @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-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsServiceImpl.java b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsServiceImpl.java new file mode 100644 index 00000000..95673f41 --- /dev/null +++ b/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsServiceImpl.java @@ -0,0 +1,134 @@ +/* + * 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.assuredworkloads.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceGrpc.AssuredWorkloadsServiceImplBase; +import com.google.longrunning.Operation; +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 MockAssuredWorkloadsServiceImpl extends AssuredWorkloadsServiceImplBase { + private List requests; + private Queue responses; + + public MockAssuredWorkloadsServiceImpl() { + 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 createWorkload( + CreateWorkloadRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateWorkload( + UpdateWorkloadRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Workload) { + requests.add(request); + responseObserver.onNext((Workload) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteWorkload( + DeleteWorkloadRequest 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 getWorkload(GetWorkloadRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Workload) { + requests.add(request); + responseObserver.onNext((Workload) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listWorkloads( + ListWorkloadsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListWorkloadsResponse) { + requests.add(request); + responseObserver.onNext((ListWorkloadsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-assured-workloads-v1beta1/pom.xml b/grpc-google-cloud-assured-workloads-v1beta1/pom.xml new file mode 100644 index 00000000..a46f45a2 --- /dev/null +++ b/grpc-google-cloud-assured-workloads-v1beta1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-assured-workloads-v1beta1 + GRPC library for google-cloud-assured-workloads + + com.google.cloud + google-cloud-assured-workloads-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-assured-workloads-v1beta1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-common-protos + + + + + + 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-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceGrpc.java b/grpc-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceGrpc.java new file mode 100644 index 00000000..0e5dc197 --- /dev/null +++ b/grpc-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceGrpc.java @@ -0,0 +1,857 @@ +/* + * 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.assuredworkloads.v1beta1; + +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; + +/** + * + * + *
+ * Service to manage AssuredWorkloads.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto") +public final class AssuredWorkloadsServiceGrpc { + + private AssuredWorkloadsServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, + com.google.longrunning.Operation> + getCreateWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkload", + requestType = com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, + com.google.longrunning.Operation> + getCreateWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, + com.google.longrunning.Operation> + getCreateWorkloadMethod; + if ((getCreateWorkloadMethod = AssuredWorkloadsServiceGrpc.getCreateWorkloadMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getCreateWorkloadMethod = AssuredWorkloadsServiceGrpc.getCreateWorkloadMethod) + == null) { + AssuredWorkloadsServiceGrpc.getCreateWorkloadMethod = + getCreateWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("CreateWorkload")) + .build(); + } + } + } + return getCreateWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getUpdateWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkload", + requestType = com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.class, + responseType = com.google.cloud.assuredworkloads.v1beta1.Workload.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getUpdateWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getUpdateWorkloadMethod; + if ((getUpdateWorkloadMethod = AssuredWorkloadsServiceGrpc.getUpdateWorkloadMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getUpdateWorkloadMethod = AssuredWorkloadsServiceGrpc.getUpdateWorkloadMethod) + == null) { + AssuredWorkloadsServiceGrpc.getUpdateWorkloadMethod = + getUpdateWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.Workload + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("UpdateWorkload")) + .build(); + } + } + } + return getUpdateWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, + com.google.protobuf.Empty> + getDeleteWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkload", + requestType = com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, + com.google.protobuf.Empty> + getDeleteWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, + com.google.protobuf.Empty> + getDeleteWorkloadMethod; + if ((getDeleteWorkloadMethod = AssuredWorkloadsServiceGrpc.getDeleteWorkloadMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getDeleteWorkloadMethod = AssuredWorkloadsServiceGrpc.getDeleteWorkloadMethod) + == null) { + AssuredWorkloadsServiceGrpc.getDeleteWorkloadMethod = + getDeleteWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("DeleteWorkload")) + .build(); + } + } + } + return getDeleteWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getGetWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkload", + requestType = com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.class, + responseType = com.google.cloud.assuredworkloads.v1beta1.Workload.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getGetWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload> + getGetWorkloadMethod; + if ((getGetWorkloadMethod = AssuredWorkloadsServiceGrpc.getGetWorkloadMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getGetWorkloadMethod = AssuredWorkloadsServiceGrpc.getGetWorkloadMethod) == null) { + AssuredWorkloadsServiceGrpc.getGetWorkloadMethod = + getGetWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.Workload + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("GetWorkload")) + .build(); + } + } + } + return getGetWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse> + getListWorkloadsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkloads", + requestType = com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.class, + responseType = com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse> + getListWorkloadsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse> + getListWorkloadsMethod; + if ((getListWorkloadsMethod = AssuredWorkloadsServiceGrpc.getListWorkloadsMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getListWorkloadsMethod = AssuredWorkloadsServiceGrpc.getListWorkloadsMethod) == null) { + AssuredWorkloadsServiceGrpc.getListWorkloadsMethod = + getListWorkloadsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWorkloads")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("ListWorkloads")) + .build(); + } + } + } + return getListWorkloadsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AssuredWorkloadsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssuredWorkloadsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceStub(channel, callOptions); + } + }; + return AssuredWorkloadsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AssuredWorkloadsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssuredWorkloadsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceBlockingStub(channel, callOptions); + } + }; + return AssuredWorkloadsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AssuredWorkloadsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssuredWorkloadsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceFutureStub(channel, callOptions); + } + }; + return AssuredWorkloadsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage AssuredWorkloads.
+   * 
+ */ + public abstract static class AssuredWorkloadsServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates Assured Workload.
+     * 
+ */ + public void createWorkload( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing workload.
+     * Currently allows updating of workload display_name and labels.
+     * For force updates don't set etag field in the Workload.
+     * Only one update operation per workload can be in progress.
+     * 
+ */ + public void updateWorkload( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the workload. Make sure that workload's direct children are already
+     * in a deleted state, otherwise the request will fail with a
+     * FAILED_PRECONDITION error.
+     * 
+ */ + public void deleteWorkload( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets Assured Workload associated with a CRM Node
+     * 
+ */ + public void getWorkload( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Assured Workloads under a CRM Node.
+     * 
+ */ + public void listWorkloads( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListWorkloadsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateWorkloadMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKLOAD))) + .addMethod( + getUpdateWorkloadMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload>( + this, METHODID_UPDATE_WORKLOAD))) + .addMethod( + getDeleteWorkloadMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_WORKLOAD))) + .addMethod( + getGetWorkloadMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, + com.google.cloud.assuredworkloads.v1beta1.Workload>( + this, METHODID_GET_WORKLOAD))) + .addMethod( + getListWorkloadsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse>( + this, METHODID_LIST_WORKLOADS))) + .build(); + } + } + + /** + * + * + *
+   * Service to manage AssuredWorkloads.
+   * 
+ */ + public static final class AssuredWorkloadsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AssuredWorkloadsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssuredWorkloadsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates Assured Workload.
+     * 
+ */ + public void createWorkload( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing workload.
+     * Currently allows updating of workload display_name and labels.
+     * For force updates don't set etag field in the Workload.
+     * Only one update operation per workload can be in progress.
+     * 
+ */ + public void updateWorkload( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the workload. Make sure that workload's direct children are already
+     * in a deleted state, otherwise the request will fail with a
+     * FAILED_PRECONDITION error.
+     * 
+ */ + public void deleteWorkload( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets Assured Workload associated with a CRM Node
+     * 
+ */ + public void getWorkload( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Assured Workloads under a CRM Node.
+     * 
+ */ + public void listWorkloads( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service to manage AssuredWorkloads.
+   * 
+ */ + public static final class AssuredWorkloadsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AssuredWorkloadsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssuredWorkloadsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates Assured Workload.
+     * 
+ */ + public com.google.longrunning.Operation createWorkload( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest request) { + return blockingUnaryCall(getChannel(), getCreateWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing workload.
+     * Currently allows updating of workload display_name and labels.
+     * For force updates don't set etag field in the Workload.
+     * Only one update operation per workload can be in progress.
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1beta1.Workload updateWorkload( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest request) { + return blockingUnaryCall(getChannel(), getUpdateWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the workload. Make sure that workload's direct children are already
+     * in a deleted state, otherwise the request will fail with a
+     * FAILED_PRECONDITION error.
+     * 
+ */ + public com.google.protobuf.Empty deleteWorkload( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest request) { + return blockingUnaryCall(getChannel(), getDeleteWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets Assured Workload associated with a CRM Node
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest request) { + return blockingUnaryCall(getChannel(), getGetWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Assured Workloads under a CRM Node.
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse listWorkloads( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest request) { + return blockingUnaryCall(getChannel(), getListWorkloadsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service to manage AssuredWorkloads.
+   * 
+ */ + public static final class AssuredWorkloadsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AssuredWorkloadsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssuredWorkloadsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssuredWorkloadsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates Assured Workload.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createWorkload(com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing workload.
+     * Currently allows updating of workload display_name and labels.
+     * For force updates don't set etag field in the Workload.
+     * Only one update operation per workload can be in progress.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1beta1.Workload> + updateWorkload(com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the workload. Make sure that workload's direct children are already
+     * in a deleted state, otherwise the request will fail with a
+     * FAILED_PRECONDITION error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWorkload(com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets Assured Workload associated with a CRM Node
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1beta1.Workload> + getWorkload(com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Assured Workloads under a CRM Node.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse> + listWorkloads(com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_WORKLOAD = 0; + private static final int METHODID_UPDATE_WORKLOAD = 1; + private static final int METHODID_DELETE_WORKLOAD = 2; + private static final int METHODID_GET_WORKLOAD = 3; + private static final int METHODID_LIST_WORKLOADS = 4; + + 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 AssuredWorkloadsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AssuredWorkloadsServiceImplBase 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_WORKLOAD: + serviceImpl.createWorkload( + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKLOAD: + serviceImpl.updateWorkload( + (com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_WORKLOAD: + serviceImpl.deleteWorkload( + (com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_WORKLOAD: + serviceImpl.getWorkload( + (com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKLOADS: + serviceImpl.listWorkloads( + (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse>) + 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 AssuredWorkloadsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AssuredWorkloadsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AssuredWorkloadsService"); + } + } + + private static final class AssuredWorkloadsServiceFileDescriptorSupplier + extends AssuredWorkloadsServiceBaseDescriptorSupplier { + AssuredWorkloadsServiceFileDescriptorSupplier() {} + } + + private static final class AssuredWorkloadsServiceMethodDescriptorSupplier + extends AssuredWorkloadsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AssuredWorkloadsServiceMethodDescriptorSupplier(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 (AssuredWorkloadsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AssuredWorkloadsServiceFileDescriptorSupplier()) + .addMethod(getCreateWorkloadMethod()) + .addMethod(getUpdateWorkloadMethod()) + .addMethod(getDeleteWorkloadMethod()) + .addMethod(getGetWorkloadMethod()) + .addMethod(getListWorkloadsMethod()) + .build(); + } + } + } + return result; + } +} 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..186d703e --- /dev/null +++ b/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + com.google.cloud + google-cloud-assured-workloads-parent + pom + 0.0.1-SNAPSHOT + Google Assured Workloads for Government Parent + https://github.com/googleapis/java- + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-.git + scm:git:git@github.com:googleapis/java-.git + https://github.com/googleapis/java- + HEAD + + + https://github.com/googleapis/java-/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-assured-workloads-parent + + + + + + com.google.cloud + google-cloud-assured-workloads + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.9.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-assured-workloads + proto-google-cloud-assured-workloads-v1beta1 + grpc-google-cloud-assured-workloads-v1beta1 + google-cloud-assured-workloads-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + 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.2.0 + + + 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-assured-workloads-v1beta1/pom.xml b/proto-google-cloud-assured-workloads-v1beta1/pom.xml new file mode 100644 index 00000000..c7021945 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-assured-workloads-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-assured-workloads-v1beta1 + Proto library for google-cloud-assured-workloads + + com.google.cloud + google-cloud-assured-workloads-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/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredworkloadsProto.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredworkloadsProto.java new file mode 100644 index 00000000..fe4f06a2 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredworkloadsProto.java @@ -0,0 +1,411 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public final class AssuredworkloadsProto { + private AssuredworkloadsProto() {} + + 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_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nDgoogle/cloud/assuredworkloads/v1beta1/" + + "assuredworkloads_v1beta1.proto\022%google.c" + + "loud.assuredworkloads.v1beta1\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032#google/longrun" + + "ning/operations.proto\032\036google/protobuf/d" + + "uration.proto\032\033google/protobuf/empty.pro" + + "to\032 google/protobuf/field_mask.proto\032\037go" + + "ogle/protobuf/timestamp.proto\"\273\001\n\025Create" + + "WorkloadRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\022" + + "(assuredworkloads.googleapis.com/Workloa" + + "d\022F\n\010workload\030\002 \001(\0132/.google.cloud.assur" + + "edworkloads.v1beta1.WorkloadB\003\340A\002\022\030\n\013ext" + + "ernal_id\030\003 \001(\tB\003\340A\001\"\225\001\n\025UpdateWorkloadRe" + + "quest\022F\n\010workload\030\001 \001(\0132/.google.cloud.a" + + "ssuredworkloads.v1beta1.WorkloadB\003\340A\002\0224\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.Fie" + + "ldMaskB\003\340A\002\"j\n\025DeleteWorkloadRequest\022>\n\004" + + "name\030\001 \001(\tB0\340A\002\372A*\n(assuredworkloads.goo" + + "gleapis.com/Workload\022\021\n\004etag\030\002 \001(\tB\003\340A\001\"" + + "T\n\022GetWorkloadRequest\022>\n\004name\030\001 \001(\tB0\340A\002" + + "\372A*\n(assuredworkloads.googleapis.com/Wor" + + "kload\"\217\001\n\024ListWorkloadsRequest\022@\n\006parent" + + "\030\001 \001(\tB0\340A\002\372A*\022(assuredworkloads.googlea" + + "pis.com/Workload\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" + + "age_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\"t\n\025ListW" + + "orkloadsResponse\022B\n\tworkloads\030\001 \003(\0132/.go" + + "ogle.cloud.assuredworkloads.v1beta1.Work" + + "load\022\027\n\017next_page_token\030\002 \001(\t\"\331\017\n\010Worklo" + + "ad\022\021\n\004name\030\001 \001(\tB\003\340A\001\022\031\n\014display_name\030\002 " + + "\001(\tB\003\340A\002\022T\n\tresources\030\003 \003(\0132<.google.clo" + + "ud.assuredworkloads.v1beta1.Workload.Res" + + "ourceInfoB\003\340A\003\022c\n\021compliance_regime\030\004 \001(" + + "\0162@.google.cloud.assuredworkloads.v1beta" + + "1.Workload.ComplianceRegimeB\006\340A\002\340A\005\0227\n\013c" + + "reate_time\030\005 \001(\0132\032.google.protobuf.Times" + + "tampB\006\340A\003\340A\005\022\037\n\017billing_account\030\006 \001(\tB\006\340" + + "A\002\340A\004\022^\n\014il4_settings\030\007 \001(\0132;.google.clo" + + "ud.assuredworkloads.v1beta1.Workload.IL4" + + "SettingsB\t\340A\002\340A\004\340A\005H\000\022`\n\rcjis_settings\030\010" + + " \001(\0132<.google.cloud.assuredworkloads.v1b" + + "eta1.Workload.CJISSettingsB\t\340A\002\340A\004\340A\005H\000\022" + + "o\n\025fedramp_high_settings\030\013 \001(\0132C.google." + + "cloud.assuredworkloads.v1beta1.Workload." + + "FedrampHighSettingsB\t\340A\002\340A\004\340A\005H\000\022w\n\031fedr" + + "amp_moderate_settings\030\014 \001(\0132G.google.clo" + + "ud.assuredworkloads.v1beta1.Workload.Fed" + + "rampModerateSettingsB\t\340A\002\340A\004\340A\005H\000\022\021\n\004eta" + + "g\030\t \001(\tB\003\340A\001\022P\n\006labels\030\n \003(\0132;.google.cl" + + "oud.assuredworkloads.v1beta1.Workload.La" + + "belsEntryB\003\340A\001\032\347\001\n\014ResourceInfo\022\023\n\013resou" + + "rce_id\030\001 \001(\003\022`\n\rresource_type\030\002 \001(\0162I.go" + + "ogle.cloud.assuredworkloads.v1beta1.Work" + + "load.ResourceInfo.ResourceType\"`\n\014Resour" + + "ceType\022\035\n\031RESOURCE_TYPE_UNSPECIFIED\020\000\022\024\n" + + "\020CONSUMER_PROJECT\020\001\022\033\n\027ENCRYPTION_KEYS_P" + + "ROJECT\020\002\032\217\001\n\013KMSSettings\022A\n\022next_rotatio" + + "n_time\030\001 \001(\0132\032.google.protobuf.Timestamp" + + "B\t\340A\002\340A\004\340A\005\022=\n\017rotation_period\030\002 \001(\0132\031.g" + + "oogle.protobuf.DurationB\t\340A\002\340A\004\340A\005\032k\n\013IL" + + "4Settings\022\\\n\014kms_settings\030\001 \001(\0132;.google" + + ".cloud.assuredworkloads.v1beta1.Workload" + + ".KMSSettingsB\t\340A\002\340A\004\340A\005\032l\n\014CJISSettings\022" + + "\\\n\014kms_settings\030\001 \001(\0132;.google.cloud.ass" + + "uredworkloads.v1beta1.Workload.KMSSettin" + + "gsB\t\340A\002\340A\004\340A\005\032s\n\023FedrampHighSettings\022\\\n\014" + + "kms_settings\030\001 \001(\0132;.google.cloud.assure" + + "dworkloads.v1beta1.Workload.KMSSettingsB" + + "\t\340A\002\340A\004\340A\005\032w\n\027FedrampModerateSettings\022\\\n" + + "\014kms_settings\030\001 \001(\0132;.google.cloud.assur" + + "edworkloads.v1beta1.Workload.KMSSettings" + + "B\t\340A\002\340A\004\340A\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001\"p\n\020ComplianceRegime\022!" + + "\n\035COMPLIANCE_REGIME_UNSPECIFIED\020\000\022\007\n\003IL4" + + "\020\001\022\010\n\004CJIS\020\002\022\020\n\014FEDRAMP_HIGH\020\003\022\024\n\020FEDRAM" + + "P_MODERATE\020\004:u\352Ar\n(assuredworkloads.goog" + + "leapis.com/Workload\022Forganizations/{orga" + + "nization}/locations/{location}/workloads" + + "/{workload}B\034\n\032compliance_regime_setting" + + "s\"\351\001\n\037CreateWorkloadOperationMetadata\0224\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\001\022\031\n\014display_name\030\002 \001(\tB\003\340A\001\022\023" + + "\n\006parent\030\003 \001(\tB\003\340A\001\022`\n\021compliance_regime" + + "\030\004 \001(\0162@.google.cloud.assuredworkloads.v" + + "1beta1.Workload.ComplianceRegimeB\003\340A\0012\243\t" + + "\n\027AssuredWorkloadsService\022\371\001\n\016CreateWork" + + "load\022<.google.cloud.assuredworkloads.v1b" + + "eta1.CreateWorkloadRequest\032\035.google.long" + + "running.Operation\"\211\001\202\323\344\223\002C\"7/v1beta1/{pa" + + "rent=organizations/*/locations/*}/worklo" + + "ads:\010workload\332A\017parent,workload\312A+\n\010Work" + + "load\022\037CreateWorkloadOperationMetadata\022\352\001" + + "\n\016UpdateWorkload\022<.google.cloud.assuredw" + + "orkloads.v1beta1.UpdateWorkloadRequest\032/" + + ".google.cloud.assuredworkloads.v1beta1.W" + + "orkload\"i\202\323\344\223\002L2@/v1beta1/{workload.name" + + "=organizations/*/locations/*/workloads/*" + + "}:\010workload\332A\024workload,update_mask\022\256\001\n\016D" + + "eleteWorkload\022<.google.cloud.assuredwork" + + "loads.v1beta1.DeleteWorkloadRequest\032\026.go" + + "ogle.protobuf.Empty\"F\202\323\344\223\0029*7/v1beta1/{n" + + "ame=organizations/*/locations/*/workload" + + "s/*}\332A\004name\022\301\001\n\013GetWorkload\0229.google.clo" + + "ud.assuredworkloads.v1beta1.GetWorkloadR" + + "equest\032/.google.cloud.assuredworkloads.v" + + "1beta1.Workload\"F\202\323\344\223\0029\0227/v1beta1/{name=" + + "organizations/*/locations/*/workloads/*}" + + "\332A\004name\022\324\001\n\rListWorkloads\022;.google.cloud" + + ".assuredworkloads.v1beta1.ListWorkloadsR" + + "equest\032<.google.cloud.assuredworkloads.v" + + "1beta1.ListWorkloadsResponse\"H\202\323\344\223\0029\0227/v" + + "1beta1/{parent=organizations/*/locations" + + "/*}/workloads\332A\006parent\032S\312A\037assuredworklo" + + "ads.googleapis.com\322A.https://www.googlea" + + "pis.com/auth/cloud-platformB\366\002\n)com.goog" + + "le.cloud.assuredworkloads.v1beta1B\025Assur" + + "edworkloadsProtoP\001ZUgoogle.golang.org/ge" + + "nproto/googleapis/cloud/assuredworkloads" + + "/v1beta1;assuredworkloads\252\002%Google.Cloud" + + ".AssuredWorkloads.V1Beta1\312\002%Google\\Cloud" + + "\\AssuredWorkloads\\V1beta1\352\002(Google::Clou" + + "d::AssuredWorkloads::V1beta1\352A]\n(assured" + + "workloads.googleapis.com/Location\0221organ" + + "izations/{organization}/locations/{locat" + + "ion}b\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.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor, + new java.lang.String[] { + "Parent", "Workload", "ExternalId", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor, + new java.lang.String[] { + "Workload", "UpdateMask", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor, + new java.lang.String[] { + "Workloads", "NextPageToken", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Resources", + "ComplianceRegime", + "CreateTime", + "BillingAccount", + "Il4Settings", + "CjisSettings", + "FedrampHighSettings", + "FedrampModerateSettings", + "Etag", + "Labels", + "ComplianceRegimeSettings", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor, + new java.lang.String[] { + "ResourceId", "ResourceType", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor, + new java.lang.String[] { + "NextRotationTime", "RotationPeriod", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor, + new java.lang.String[] { + "KmsSettings", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor, + new java.lang.String[] { + "KmsSettings", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor, + new java.lang.String[] { + "KmsSettings", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor, + new java.lang.String[] { + "KmsSettings", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_descriptor = + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor + .getNestedTypes() + .get(6); + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "DisplayName", "Parent", "ComplianceRegime", + }); + 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.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + 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.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java new file mode 100644 index 00000000..f4cc5337 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java @@ -0,0 +1,1305 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Operation metadata to give request details of CreateWorkload.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} + */ +public final class CreateWorkloadOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + CreateWorkloadOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkloadOperationMetadata.newBuilder() to construct. + private CreateWorkloadOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkloadOperationMetadata() { + displayName_ = ""; + parent_ = ""; + complianceRegime_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkloadOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateWorkloadOperationMetadata( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + complianceRegime_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.class, + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.Builder + .class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Optional. The display name of the workload.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The display name of the workload.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 3; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Optional. The parent of the workload.
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The parent of the workload.
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMPLIANCE_REGIME_FIELD_NUMBER = 4; + private int complianceRegime_; + /** + * + * + *
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + @java.lang.Override + public int getComplianceRegimeValue() { + return complianceRegime_; + } + /** + * + * + *
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The complianceRegime. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime getComplianceRegime() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.valueOf( + complianceRegime_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, parent_); + } + if (complianceRegime_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + .COMPLIANCE_REGIME_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, complianceRegime_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, parent_); + } + if (complianceRegime_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + .COMPLIANCE_REGIME_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, complianceRegime_); + } + 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata other = + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (complianceRegime_ != other.complianceRegime_) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + COMPLIANCE_REGIME_FIELD_NUMBER; + hash = (53 * hash) + complianceRegime_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata 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; + } + /** + * + * + *
+   * Operation metadata to give request details of CreateWorkload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.class, + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.Builder + .class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + displayName_ = ""; + + parent_ = ""; + + complianceRegime_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata build() { + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata result = + new com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.displayName_ = displayName_; + result.parent_ = parent_; + result.complianceRegime_ = complianceRegime_; + 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + .getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.complianceRegime_ != 0) { + setComplianceRegimeValue(other.getComplianceRegimeValue()); + } + 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Optional. Time when the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Optional. The display name of the workload.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The display name of the workload.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The display name of the workload.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The display name of the workload.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The display name of the workload.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Optional. The parent of the workload.
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The parent of the workload.
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The parent of the workload.
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. The parent of the workload.
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The parent of the workload.
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 complianceRegime_ = 0; + /** + * + * + *
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + @java.lang.Override + public int getComplianceRegimeValue() { + return complianceRegime_; + } + /** + * + * + *
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for complianceRegime to set. + * @return This builder for chaining. + */ + public Builder setComplianceRegimeValue(int value) { + + complianceRegime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The complianceRegime. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + getComplianceRegime() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.valueOf( + complianceRegime_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The complianceRegime to set. + * @return This builder for chaining. + */ + public Builder setComplianceRegime( + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime value) { + if (value == null) { + throw new NullPointerException(); + } + + complianceRegime_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearComplianceRegime() { + + complianceRegime_ = 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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + private static final com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkloadOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateWorkloadOperationMetadata(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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadataOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadataOrBuilder.java new file mode 100644 index 00000000..1b67d399 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadataOrBuilder.java @@ -0,0 +1,144 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface CreateWorkloadOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Optional. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The display name of the workload.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Optional. The display name of the workload.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The parent of the workload.
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Optional. The parent of the workload.
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + int getComplianceRegimeValue(); + /** + * + * + *
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The complianceRegime. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime getComplianceRegime(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java new file mode 100644 index 00000000..1dbd14d3 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java @@ -0,0 +1,1168 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Request for creating a workload.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} + */ +public final class CreateWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + CreateWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkloadRequest.newBuilder() to construct. + private CreateWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkloadRequest() { + parent_ = ""; + externalId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkloadRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateWorkloadRequest( + 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.assuredworkloads.v1beta1.Workload.Builder subBuilder = null; + if (workload_ != null) { + subBuilder = workload_.toBuilder(); + } + workload_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workload_); + workload_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + externalId_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the new Workload's parent.
+   * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the new Workload's parent.
+   * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKLOAD_FIELD_NUMBER = 2; + private com.google.cloud.assuredworkloads.v1beta1.Workload workload_; + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + @java.lang.Override + public boolean hasWorkload() { + return workload_ != null; + } + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload() { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder() { + return getWorkload(); + } + + public static final int EXTERNAL_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object externalId_; + /** + * + * + *
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
+   * provided for the identifier will add a label to the workload and contained
+   * projects with the identifier as the value.
+   * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalId. + */ + @java.lang.Override + public java.lang.String getExternalId() { + java.lang.Object ref = externalId_; + 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(); + externalId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
+   * provided for the identifier will add a label to the workload and contained
+   * projects with the identifier as the value.
+   * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExternalIdBytes() { + java.lang.Object ref = externalId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalId_ = 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 (workload_ != null) { + output.writeMessage(2, getWorkload()); + } + if (!getExternalIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, externalId_); + } + 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 (workload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getWorkload()); + } + if (!getExternalIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, externalId_); + } + 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.assuredworkloads.v1beta1.CreateWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest other = + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasWorkload() != other.hasWorkload()) return false; + if (hasWorkload()) { + if (!getWorkload().equals(other.getWorkload())) return false; + } + if (!getExternalId().equals(other.getExternalId())) 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 (hasWorkload()) { + hash = (37 * hash) + WORKLOAD_FIELD_NUMBER; + hash = (53 * hash) + getWorkload().hashCode(); + } + hash = (37 * hash) + EXTERNAL_ID_FIELD_NUMBER; + hash = (53 * hash) + getExternalId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest 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.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest 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.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest 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.assuredworkloads.v1beta1.CreateWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest 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.assuredworkloads.v1beta1.CreateWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest 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.assuredworkloads.v1beta1.CreateWorkloadRequest 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; + } + /** + * + * + *
+   * Request for creating a workload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.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 (workloadBuilder_ == null) { + workload_ = null; + } else { + workload_ = null; + workloadBuilder_ = null; + } + externalId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest build() { + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest result = + new com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest(this); + result.parent_ = parent_; + if (workloadBuilder_ == null) { + result.workload_ = workload_; + } else { + result.workload_ = workloadBuilder_.build(); + } + result.externalId_ = externalId_; + 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.assuredworkloads.v1beta1.CreateWorkloadRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasWorkload()) { + mergeWorkload(other.getWorkload()); + } + if (!other.getExternalId().isEmpty()) { + externalId_ = other.externalId_; + 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.assuredworkloads.v1beta1.CreateWorkloadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the new Workload's parent.
+     * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+     * 
+ * + * + * 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 new Workload's parent.
+     * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+     * 
+ * + * + * 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 new Workload's parent.
+     * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+     * 
+ * + * + * 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 new Workload's parent.
+     * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+     * 
+ * + * + * 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 new Workload's parent.
+     * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+     * 
+ * + * + * 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.assuredworkloads.v1beta1.Workload workload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + workloadBuilder_; + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + public boolean hasWorkload() { + return workloadBuilder_ != null || workload_ != null; + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload() { + if (workloadBuilder_ == null) { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } else { + return workloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkload(com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workload_ = value; + onChanged(); + } else { + workloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkload( + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder builderForValue) { + if (workloadBuilder_ == null) { + workload_ = builderForValue.build(); + onChanged(); + } else { + workloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkload(com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadBuilder_ == null) { + if (workload_ != null) { + workload_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.newBuilder(workload_) + .mergeFrom(value) + .buildPartial(); + } else { + workload_ = value; + } + onChanged(); + } else { + workloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkload() { + if (workloadBuilder_ == null) { + workload_ = null; + onChanged(); + } else { + workload_ = null; + workloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.Builder getWorkloadBuilder() { + + onChanged(); + return getWorkloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder() { + if (workloadBuilder_ != null) { + return workloadBuilder_.getMessageOrBuilder(); + } else { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } + } + /** + * + * + *
+     * Required. Assured Workload to create
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + getWorkloadFieldBuilder() { + if (workloadBuilder_ == null) { + workloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder>( + getWorkload(), getParentForChildren(), isClean()); + workload_ = null; + } + return workloadBuilder_; + } + + private java.lang.Object externalId_ = ""; + /** + * + * + *
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
+     * provided for the identifier will add a label to the workload and contained
+     * projects with the identifier as the value.
+     * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalId. + */ + public java.lang.String getExternalId() { + java.lang.Object ref = externalId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
+     * provided for the identifier will add a label to the workload and contained
+     * projects with the identifier as the value.
+     * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalId. + */ + public com.google.protobuf.ByteString getExternalIdBytes() { + java.lang.Object ref = externalId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
+     * provided for the identifier will add a label to the workload and contained
+     * projects with the identifier as the value.
+     * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The externalId to set. + * @return This builder for chaining. + */ + public Builder setExternalId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + externalId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
+     * provided for the identifier will add a label to the workload and contained
+     * projects with the identifier as the value.
+     * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearExternalId() { + + externalId_ = getDefaultInstance().getExternalId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
+     * provided for the identifier will add a label to the workload and contained
+     * projects with the identifier as the value.
+     * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for externalId to set. + * @return This builder for chaining. + */ + public Builder setExternalIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + externalId_ = 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.assuredworkloads.v1beta1.CreateWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + private static final com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkloadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateWorkloadRequest(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.assuredworkloads.v1beta1.CreateWorkloadRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequestOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequestOrBuilder.java new file mode 100644 index 00000000..39d41346 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface CreateWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the new Workload's parent.
+   * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+   * 
+ * + * + * 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 new Workload's parent.
+   * Must be of the form `organizations/{org_id}/locations/{location_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + boolean hasWorkload(); + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload(); + /** + * + * + *
+   * Required. Assured Workload to create
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder(); + + /** + * + * + *
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
+   * provided for the identifier will add a label to the workload and contained
+   * projects with the identifier as the value.
+   * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The externalId. + */ + java.lang.String getExternalId(); + /** + * + * + *
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
+   * provided for the identifier will add a label to the workload and contained
+   * projects with the identifier as the value.
+   * 
+ * + * string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for externalId. + */ + com.google.protobuf.ByteString getExternalIdBytes(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java new file mode 100644 index 00000000..f9d4c11c --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java @@ -0,0 +1,858 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Request for deleting a Workload.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} + */ +public final class DeleteWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + DeleteWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWorkloadRequest.newBuilder() to construct. + private DeleteWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWorkloadRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWorkloadRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteWorkloadRequest( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The `name` field is used to identify the workload.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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 `name` field is used to identify the workload.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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 ETAG_FIELD_NUMBER = 2; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. The etag of the workload.
+   * If this is provided, it must match the server's etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The etag of the workload.
+   * If this is provided, it must match the server's etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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 (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + 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 (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + 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.assuredworkloads.v1beta1.DeleteWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest other = + (com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest 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.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest 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.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest 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.assuredworkloads.v1beta1.DeleteWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest 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.assuredworkloads.v1beta1.DeleteWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest 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.assuredworkloads.v1beta1.DeleteWorkloadRequest 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; + } + /** + * + * + *
+   * Request for deleting a Workload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.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_ = ""; + + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest build() { + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest result = + new com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(this); + result.name_ = name_; + result.etag_ = etag_; + 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.assuredworkloads.v1beta1.DeleteWorkloadRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + 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.assuredworkloads.v1beta1.DeleteWorkloadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The `name` field is used to identify the workload.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * 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 `name` field is used to identify the workload.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * 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 `name` field is used to identify the workload.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * 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 `name` field is used to identify the workload.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * 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 `name` field is used to identify the workload.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * 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 etag_ = ""; + /** + * + * + *
+     * Optional. The etag of the workload.
+     * If this is provided, it must match the server's etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The etag of the workload.
+     * If this is provided, it must match the server's etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The etag of the workload.
+     * If this is provided, it must match the server's etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag of the workload.
+     * If this is provided, it must match the server's etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag of the workload.
+     * If this is provided, it must match the server's etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = 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.assuredworkloads.v1beta1.DeleteWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + private static final com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWorkloadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteWorkloadRequest(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.assuredworkloads.v1beta1.DeleteWorkloadRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequestOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequestOrBuilder.java new file mode 100644 index 00000000..6454e7e3 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequestOrBuilder.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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface DeleteWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The `name` field is used to identify the workload.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The `name` field is used to identify the workload.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The etag of the workload.
+   * If this is provided, it must match the server's etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The etag of the workload.
+   * If this is provided, it must match the server's etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java new file mode 100644 index 00000000..a2a2d469 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java @@ -0,0 +1,682 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Request for fetching a workload.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} + */ +public final class GetWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + GetWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkloadRequest.newBuilder() to construct. + private GetWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkloadRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkloadRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetWorkloadRequest( + 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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 Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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.assuredworkloads.v1beta1.GetWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest other = + (com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) 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.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest 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.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest 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.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest 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.assuredworkloads.v1beta1.GetWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest 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.assuredworkloads.v1beta1.GetWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest 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.assuredworkloads.v1beta1.GetWorkloadRequest 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; + } + /** + * + * + *
+   * Request for fetching a workload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest build() { + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest result = + new com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(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.assuredworkloads.v1beta1.GetWorkloadRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.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.assuredworkloads.v1beta1.GetWorkloadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * + * 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 Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * + * 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 Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * + * 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 Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * + * 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 Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * + * 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.assuredworkloads.v1beta1.GetWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + private static final com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkloadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorkloadRequest(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.assuredworkloads.v1beta1.GetWorkloadRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequestOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequestOrBuilder.java new file mode 100644 index 00000000..24e4f5ce --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface GetWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * + * 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 Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * + * 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-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java new file mode 100644 index 00000000..2f4828cb --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java @@ -0,0 +1,1133 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Request for fetching workloads in an organization.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} + */ +public final class ListWorkloadsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + ListWorkloadsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsRequest.newBuilder() to construct. + private ListWorkloadsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkloadsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWorkloadsRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.class, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Parent Resource to list workloads from.
+   * Must be of the form `organizations/{org_id}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent Resource to list workloads from.
+   * Must be of the form `organizations/{org_id}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token returned from previous request. Page token contains context from
+   * previous request. Page token needs to be passed in the second and following
+   * requests.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token returned from previous request. Page token contains context from
+   * previous request. Page token needs to be passed in the second and following
+   * requests.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A custom filter for filtering by properties of a workload. At this time,
+   * only filtering by labels is supported.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A custom filter for filtering by properties of a workload. At this time,
+   * only filtering by labels is supported.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = 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_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + 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_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.assuredworkloads.v1beta1.ListWorkloadsRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest other = + (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest 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.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest 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.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest 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.assuredworkloads.v1beta1.ListWorkloadsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest 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.assuredworkloads.v1beta1.ListWorkloadsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest 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.assuredworkloads.v1beta1.ListWorkloadsRequest 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; + } + /** + * + * + *
+   * Request for fetching workloads in an organization.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.class, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.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_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest build() { + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest result = + new com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.assuredworkloads.v1beta1.ListWorkloadsRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.assuredworkloads.v1beta1.ListWorkloadsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent Resource to list workloads from.
+     * Must be of the form `organizations/{org_id}/locations/{location}`.
+     * 
+ * + * + * 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. Parent Resource to list workloads from.
+     * Must be of the form `organizations/{org_id}/locations/{location}`.
+     * 
+ * + * + * 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. Parent Resource to list workloads from.
+     * Must be of the form `organizations/{org_id}/locations/{location}`.
+     * 
+ * + * + * 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. Parent Resource to list workloads from.
+     * Must be of the form `organizations/{org_id}/locations/{location}`.
+     * 
+ * + * + * 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. Parent Resource to list workloads from.
+     * Must be of the form `organizations/{org_id}/locations/{location}`.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token returned from previous request. Page token contains context from
+     * previous request. Page token needs to be passed in the second and following
+     * requests.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page token returned from previous request. Page token contains context from
+     * previous request. Page token needs to be passed in the second and following
+     * requests.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page token returned from previous request. Page token contains context from
+     * previous request. Page token needs to be passed in the second and following
+     * requests.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Page token returned from previous request. Page token contains context from
+     * previous request. Page token needs to be passed in the second and following
+     * requests.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token returned from previous request. Page token contains context from
+     * previous request. Page token needs to be passed in the second and following
+     * requests.
+     * 
+ * + * 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A custom filter for filtering by properties of a workload. At this time,
+     * only filtering by labels is supported.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A custom filter for filtering by properties of a workload. At this time,
+     * only filtering by labels is supported.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A custom filter for filtering by properties of a workload. At this time,
+     * only filtering by labels is supported.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A custom filter for filtering by properties of a workload. At this time,
+     * only filtering by labels is supported.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A custom filter for filtering by properties of a workload. At this time,
+     * only filtering by labels is supported.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = 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.assuredworkloads.v1beta1.ListWorkloadsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + private static final com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWorkloadsRequest(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.assuredworkloads.v1beta1.ListWorkloadsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequestOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequestOrBuilder.java new file mode 100644 index 00000000..808d6aa1 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface ListWorkloadsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent Resource to list workloads from.
+   * Must be of the form `organizations/{org_id}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent Resource to list workloads from.
+   * Must be of the form `organizations/{org_id}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token returned from previous request. Page token contains context from
+   * previous request. Page token needs to be passed in the second and following
+   * requests.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token returned from previous request. Page token contains context from
+   * previous request. Page token needs to be passed in the second and following
+   * requests.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A custom filter for filtering by properties of a workload. At this time,
+   * only filtering by labels is supported.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A custom filter for filtering by properties of a workload. At this time,
+   * only filtering by labels is supported.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java new file mode 100644 index 00000000..7c787d71 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java @@ -0,0 +1,1147 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Response of ListWorkloads endpoint.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} + */ +public final class ListWorkloadsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + ListWorkloadsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsResponse.newBuilder() to construct. + private ListWorkloadsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsResponse() { + workloads_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkloadsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWorkloadsResponse( + 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)) { + workloads_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + workloads_.add( + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.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)) { + workloads_ = java.util.Collections.unmodifiableList(workloads_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.class, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.Builder.class); + } + + public static final int WORKLOADS_FIELD_NUMBER = 1; + private java.util.List workloads_; + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List getWorkloadsList() { + return workloads_; + } + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List + getWorkloadsOrBuilderList() { + return workloads_; + } + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + @java.lang.Override + public int getWorkloadsCount() { + return workloads_.size(); + } + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkloads(int index) { + return workloads_.get(index); + } + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + return workloads_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token. Return empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token. Return empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workloads_.size(); i++) { + output.writeMessage(1, workloads_.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 < workloads_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workloads_.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.assuredworkloads.v1beta1.ListWorkloadsResponse)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse other = + (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) obj; + + if (!getWorkloadsList().equals(other.getWorkloadsList())) 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 (getWorkloadsCount() > 0) { + hash = (37 * hash) + WORKLOADS_FIELD_NUMBER; + hash = (53 * hash) + getWorkloadsList().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.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse 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.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse 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.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse 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.assuredworkloads.v1beta1.ListWorkloadsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse 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.assuredworkloads.v1beta1.ListWorkloadsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse 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.assuredworkloads.v1beta1.ListWorkloadsResponse 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; + } + /** + * + * + *
+   * Response of ListWorkloads endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.class, + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWorkloadsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + workloadsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse build() { + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse result = + new com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(this); + int from_bitField0_ = bitField0_; + if (workloadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workloads_ = java.util.Collections.unmodifiableList(workloads_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workloads_ = workloads_; + } else { + result.workloads_ = workloadsBuilder_.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.assuredworkloads.v1beta1.ListWorkloadsResponse) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.getDefaultInstance()) + return this; + if (workloadsBuilder_ == null) { + if (!other.workloads_.isEmpty()) { + if (workloads_.isEmpty()) { + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkloadsIsMutable(); + workloads_.addAll(other.workloads_); + } + onChanged(); + } + } else { + if (!other.workloads_.isEmpty()) { + if (workloadsBuilder_.isEmpty()) { + workloadsBuilder_.dispose(); + workloadsBuilder_ = null; + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + workloadsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkloadsFieldBuilder() + : null; + } else { + workloadsBuilder_.addAllMessages(other.workloads_); + } + } + } + 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.assuredworkloads.v1beta1.ListWorkloadsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List workloads_ = + java.util.Collections.emptyList(); + + private void ensureWorkloadsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workloads_ = + new java.util.ArrayList(workloads_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + workloadsBuilder_; + + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public java.util.List getWorkloadsList() { + if (workloadsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workloads_); + } else { + return workloadsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public int getWorkloadsCount() { + if (workloadsBuilder_ == null) { + return workloads_.size(); + } else { + return workloadsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkloads(int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.set(index, value); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.set(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder addWorkloads(com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(value); + onChanged(); + } else { + workloadsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(index, value); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder addWorkloads( + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder addAllWorkloads( + java.lang.Iterable values) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workloads_); + onChanged(); + } else { + workloadsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder clearWorkloads() { + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workloadsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public Builder removeWorkloads(int index) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.remove(index); + onChanged(); + } else { + workloadsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.Builder getWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public java.util.List + getWorkloadsOrBuilderList() { + if (workloadsBuilder_ != null) { + return workloadsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workloads_); + } + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.Builder addWorkloadsBuilder() { + return getWorkloadsFieldBuilder() + .addBuilder(com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.Builder addWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder() + .addBuilder( + index, com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of Workloads under a given parent.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + public java.util.List + getWorkloadsBuilderList() { + return getWorkloadsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + getWorkloadsFieldBuilder() { + if (workloadsBuilder_ == null) { + workloadsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder>( + workloads_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workloads_ = null; + } + return workloadsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token. Return empty if reached the last page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The next page token. Return empty if reached the last page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The next page token. Return empty if reached the last page.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The next page token. Return empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token. Return empty if reached the last page.
+     * 
+ * + * 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.assuredworkloads.v1beta1.ListWorkloadsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + private static final com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWorkloadsResponse(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.assuredworkloads.v1beta1.ListWorkloadsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponseOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponseOrBuilder.java new file mode 100644 index 00000000..5c6c0ad4 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface ListWorkloadsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + java.util.List getWorkloadsList(); + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + com.google.cloud.assuredworkloads.v1beta1.Workload getWorkloads(int index); + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + int getWorkloadsCount(); + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + java.util.List + getWorkloadsOrBuilderList(); + /** + * + * + *
+   * List of Workloads under a given parent.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; + */ + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadsOrBuilder(int index); + + /** + * + * + *
+   * The next page token. Return empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token. Return empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/LocationName.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/LocationName.java new file mode 100644 index 00000000..faf074db --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/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.assuredworkloads.v1beta1; + +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("organizations/{organization}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String location; + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).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("organization"), 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("organization", organization); + 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("organization", organization, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String organization; + private String location; + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + organization = locationName.organization; + 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.organization.equals(that.organization)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java new file mode 100644 index 00000000..ee129408 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java @@ -0,0 +1,1087 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * Request for Updating a workload.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} + */ +public final class UpdateWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + UpdateWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWorkloadRequest.newBuilder() to construct. + private UpdateWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWorkloadRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWorkloadRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateWorkloadRequest( + 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.assuredworkloads.v1beta1.Workload.Builder subBuilder = null; + if (workload_ != null) { + subBuilder = workload_.toBuilder(); + } + workload_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workload_); + workload_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.Builder.class); + } + + public static final int WORKLOAD_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1beta1.Workload workload_; + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + @java.lang.Override + public boolean hasWorkload() { + return workload_ != null; + } + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload() { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder() { + return getWorkload(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + 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 (workload_ != null) { + output.writeMessage(1, getWorkload()); + } + 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 (workload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWorkload()); + } + 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.assuredworkloads.v1beta1.UpdateWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest other = + (com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) obj; + + if (hasWorkload() != other.hasWorkload()) return false; + if (hasWorkload()) { + if (!getWorkload().equals(other.getWorkload())) 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 (hasWorkload()) { + hash = (37 * hash) + WORKLOAD_FIELD_NUMBER; + hash = (53 * hash) + getWorkload().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.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest 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.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest 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.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest 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.assuredworkloads.v1beta1.UpdateWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest 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.assuredworkloads.v1beta1.UpdateWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest 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.assuredworkloads.v1beta1.UpdateWorkloadRequest 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; + } + /** + * + * + *
+   * Request for Updating a workload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.class, + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.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 (workloadBuilder_ == null) { + workload_ = null; + } else { + workload_ = null; + workloadBuilder_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest build() { + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest result = + new com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest(this); + if (workloadBuilder_ == null) { + result.workload_ = workload_; + } else { + result.workload_ = workloadBuilder_.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.assuredworkloads.v1beta1.UpdateWorkloadRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.getDefaultInstance()) + return this; + if (other.hasWorkload()) { + mergeWorkload(other.getWorkload()); + } + 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.assuredworkloads.v1beta1.UpdateWorkloadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.assuredworkloads.v1beta1.Workload workload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + workloadBuilder_; + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + public boolean hasWorkload() { + return workloadBuilder_ != null || workload_ != null; + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload() { + if (workloadBuilder_ == null) { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } else { + return workloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkload(com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workload_ = value; + onChanged(); + } else { + workloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkload( + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder builderForValue) { + if (workloadBuilder_ == null) { + workload_ = builderForValue.build(); + onChanged(); + } else { + workloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkload(com.google.cloud.assuredworkloads.v1beta1.Workload value) { + if (workloadBuilder_ == null) { + if (workload_ != null) { + workload_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.newBuilder(workload_) + .mergeFrom(value) + .buildPartial(); + } else { + workload_ = value; + } + onChanged(); + } else { + workloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkload() { + if (workloadBuilder_ == null) { + workload_ = null; + onChanged(); + } else { + workload_ = null; + workloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.Builder getWorkloadBuilder() { + + onChanged(); + return getWorkloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder() { + if (workloadBuilder_ != null) { + return workloadBuilder_.getMessageOrBuilder(); + } else { + return workload_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance() + : workload_; + } + } + /** + * + * + *
+     * Required. The workload to update.
+     * The workload’s `name` field is used to identify the workload to be updated.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder> + getWorkloadFieldBuilder() { + if (workloadBuilder_ == null) { + workloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder, + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder>( + getWorkload(), getParentForChildren(), isClean()); + workload_ = null; + } + return workloadBuilder_; + } + + 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_; + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.assuredworkloads.v1beta1.UpdateWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + private static final com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWorkloadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateWorkloadRequest(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.assuredworkloads.v1beta1.UpdateWorkloadRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequestOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequestOrBuilder.java new file mode 100644 index 00000000..2b65f070 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface UpdateWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workload field is set. + */ + boolean hasWorkload(); + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workload. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload getWorkload(); + /** + * + * + *
+   * Required. The workload to update.
+   * The workload’s `name` field is used to identify the workload to be updated.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder getWorkloadOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java new file mode 100644 index 00000000..ecc4e7aa --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java @@ -0,0 +1,9819 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +/** + * + * + *
+ * An Workload object for managing highly regulated workloads of cloud
+ * customers.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload} + */ +public final class Workload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload) + WorkloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use Workload.newBuilder() to construct. + private Workload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Workload() { + name_ = ""; + displayName_ = ""; + resources_ = java.util.Collections.emptyList(); + complianceRegime_ = 0; + billingAccount_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Workload(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Workload( + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + resources_ = + new java.util.ArrayList< + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo>(); + mutable_bitField0_ |= 0x00000001; + } + resources_.add( + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.parser(), + extensionRegistry)); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + complianceRegime_ = rawValue; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + billingAccount_ = s; + break; + } + case 58: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder subBuilder = + null; + if (complianceRegimeSettingsCase_ == 7) { + subBuilder = + ((com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_) + .toBuilder(); + } + complianceRegimeSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_); + complianceRegimeSettings_ = subBuilder.buildPartial(); + } + complianceRegimeSettingsCase_ = 7; + break; + } + case 66: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder subBuilder = + null; + if (complianceRegimeSettingsCase_ == 8) { + subBuilder = + ((com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_) + .toBuilder(); + } + complianceRegimeSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_); + complianceRegimeSettings_ = subBuilder.buildPartial(); + } + complianceRegimeSettingsCase_ = 8; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 90: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder + subBuilder = null; + if (complianceRegimeSettingsCase_ == 11) { + subBuilder = + ((com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_) + .toBuilder(); + } + complianceRegimeSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_); + complianceRegimeSettings_ = subBuilder.buildPartial(); + } + complianceRegimeSettingsCase_ = 11; + break; + } + case 98: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder + subBuilder = null; + if (complianceRegimeSettingsCase_ == 12) { + subBuilder = + ((com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_) + .toBuilder(); + } + complianceRegimeSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_); + complianceRegimeSettings_ = subBuilder.buildPartial(); + } + complianceRegimeSettingsCase_ = 12; + 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)) { + resources_ = java.util.Collections.unmodifiableList(resources_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder.class); + } + + /** + * + * + *
+   * Supported Compliance Regimes.
+   * 
+ * + * Protobuf enum {@code google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} + */ + public enum ComplianceRegime implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown compliance regime.
+     * 
+ * + * COMPLIANCE_REGIME_UNSPECIFIED = 0; + */ + COMPLIANCE_REGIME_UNSPECIFIED(0), + /** + * + * + *
+     * Information protection as per DoD IL4 requirements.
+     * 
+ * + * IL4 = 1; + */ + IL4(1), + /** + * + * + *
+     * Criminal Justice Information Services (CJIS) Security policies.
+     * 
+ * + * CJIS = 2; + */ + CJIS(2), + /** + * + * + *
+     * FedRAMP High data protection controls
+     * 
+ * + * FEDRAMP_HIGH = 3; + */ + FEDRAMP_HIGH(3), + /** + * + * + *
+     * FedRAMP Moderate data protection controls
+     * 
+ * + * FEDRAMP_MODERATE = 4; + */ + FEDRAMP_MODERATE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown compliance regime.
+     * 
+ * + * COMPLIANCE_REGIME_UNSPECIFIED = 0; + */ + public static final int COMPLIANCE_REGIME_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Information protection as per DoD IL4 requirements.
+     * 
+ * + * IL4 = 1; + */ + public static final int IL4_VALUE = 1; + /** + * + * + *
+     * Criminal Justice Information Services (CJIS) Security policies.
+     * 
+ * + * CJIS = 2; + */ + public static final int CJIS_VALUE = 2; + /** + * + * + *
+     * FedRAMP High data protection controls
+     * 
+ * + * FEDRAMP_HIGH = 3; + */ + public static final int FEDRAMP_HIGH_VALUE = 3; + /** + * + * + *
+     * FedRAMP Moderate data protection controls
+     * 
+ * + * FEDRAMP_MODERATE = 4; + */ + public static final int FEDRAMP_MODERATE_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 ComplianceRegime 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 ComplianceRegime forNumber(int value) { + switch (value) { + case 0: + return COMPLIANCE_REGIME_UNSPECIFIED; + case 1: + return IL4; + case 2: + return CJIS; + case 3: + return FEDRAMP_HIGH; + case 4: + return FEDRAMP_MODERATE; + 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 ComplianceRegime findValueByNumber(int number) { + return ComplianceRegime.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.assuredworkloads.v1beta1.Workload.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ComplianceRegime[] VALUES = values(); + + public static ComplianceRegime 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 ComplianceRegime(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime) + } + + public interface ResourceInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Resource identifier.
+     * For a project this represents project_number.
+     * 
+ * + * int64 resource_id = 1; + * + * @return The resourceId. + */ + long getResourceId(); + + /** + * + * + *
+     * Indicates the type of resource.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + int getResourceTypeValue(); + /** + * + * + *
+     * Indicates the type of resource.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The resourceType. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType getResourceType(); + } + /** + * + * + *
+   * Represent the resources that are children of this Workload.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} + */ + public static final class ResourceInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + ResourceInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceInfo.newBuilder() to construct. + private ResourceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceInfo() { + resourceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResourceInfo( + 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 8: + { + resourceId_ = input.readInt64(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + resourceType_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder.class); + } + + /** + * + * + *
+     * The type of resource.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} + */ + public enum ResourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unknown resource type.
+       * 
+ * + * RESOURCE_TYPE_UNSPECIFIED = 0; + */ + RESOURCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Consumer project.
+       * 
+ * + * CONSUMER_PROJECT = 1; + */ + CONSUMER_PROJECT(1), + /** + * + * + *
+       * Consumer project containing encryption keys.
+       * 
+ * + * ENCRYPTION_KEYS_PROJECT = 2; + */ + ENCRYPTION_KEYS_PROJECT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unknown resource type.
+       * 
+ * + * RESOURCE_TYPE_UNSPECIFIED = 0; + */ + public static final int RESOURCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Consumer project.
+       * 
+ * + * CONSUMER_PROJECT = 1; + */ + public static final int CONSUMER_PROJECT_VALUE = 1; + /** + * + * + *
+       * Consumer project containing encryption keys.
+       * 
+ * + * ENCRYPTION_KEYS_PROJECT = 2; + */ + public static final int ENCRYPTION_KEYS_PROJECT_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 ResourceType 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 ResourceType forNumber(int value) { + switch (value) { + case 0: + return RESOURCE_TYPE_UNSPECIFIED; + case 1: + return CONSUMER_PROJECT; + case 2: + return ENCRYPTION_KEYS_PROJECT; + 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 ResourceType findValueByNumber(int number) { + return ResourceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.assuredworkloads.v1beta1.Workload.ResourceInfo.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ResourceType[] VALUES = values(); + + public static ResourceType 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 ResourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType) + } + + public static final int RESOURCE_ID_FIELD_NUMBER = 1; + private long resourceId_; + /** + * + * + *
+     * Resource identifier.
+     * For a project this represents project_number.
+     * 
+ * + * int64 resource_id = 1; + * + * @return The resourceId. + */ + @java.lang.Override + public long getResourceId() { + return resourceId_; + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 2; + private int resourceType_; + /** + * + * + *
+     * Indicates the type of resource.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + @java.lang.Override + public int getResourceTypeValue() { + return resourceType_; + } + /** + * + * + *
+     * Indicates the type of resource.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The resourceType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + getResourceType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType.valueOf( + resourceType_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + .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 (resourceId_ != 0L) { + output.writeInt64(1, resourceId_); + } + if (resourceType_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + .RESOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, resourceType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resourceId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, resourceId_); + } + if (resourceType_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + .RESOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, resourceType_); + } + 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.assuredworkloads.v1beta1.Workload.ResourceInfo)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) obj; + + if (getResourceId() != other.getResourceId()) return false; + if (resourceType_ != other.resourceType_) 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) + RESOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResourceId()); + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + resourceType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo 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.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo 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.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo 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.assuredworkloads.v1beta1.Workload.ResourceInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + 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.assuredworkloads.v1beta1.Workload.ResourceInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo 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.assuredworkloads.v1beta1.Workload.ResourceInfo 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; + } + /** + * + * + *
+     * Represent the resources that are children of this Workload.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.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(); + resourceId_ = 0L; + + resourceType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(this); + result.resourceId_ = resourceId_; + result.resourceType_ = resourceType_; + 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.assuredworkloads.v1beta1.Workload.ResourceInfo) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.getDefaultInstance()) + return this; + if (other.getResourceId() != 0L) { + setResourceId(other.getResourceId()); + } + if (other.resourceType_ != 0) { + setResourceTypeValue(other.getResourceTypeValue()); + } + 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.assuredworkloads.v1beta1.Workload.ResourceInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resourceId_; + /** + * + * + *
+       * Resource identifier.
+       * For a project this represents project_number.
+       * 
+ * + * int64 resource_id = 1; + * + * @return The resourceId. + */ + @java.lang.Override + public long getResourceId() { + return resourceId_; + } + /** + * + * + *
+       * Resource identifier.
+       * For a project this represents project_number.
+       * 
+ * + * int64 resource_id = 1; + * + * @param value The resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceId(long value) { + + resourceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Resource identifier.
+       * For a project this represents project_number.
+       * 
+ * + * int64 resource_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearResourceId() { + + resourceId_ = 0L; + onChanged(); + return this; + } + + private int resourceType_ = 0; + /** + * + * + *
+       * Indicates the type of resource.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The enum numeric value on the wire for resourceType. + */ + @java.lang.Override + public int getResourceTypeValue() { + return resourceType_; + } + /** + * + * + *
+       * Indicates the type of resource.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @param value The enum numeric value on the wire for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeValue(int value) { + + resourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates the type of resource.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return The resourceType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + getResourceType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType.valueOf( + resourceType_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Indicates the type of resource.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates the type of resource.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearResourceType() { + + resourceType_ = 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.assuredworkloads.v1beta1.Workload.ResourceInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResourceInfo(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.assuredworkloads.v1beta1.Workload.ResourceInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface KMSSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the nextRotationTime field is set. + */ + boolean hasNextRotationTime(); + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nextRotationTime. + */ + com.google.protobuf.Timestamp getNextRotationTime(); + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder(); + + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the rotationPeriod field is set. + */ + boolean hasRotationPeriod(); + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The rotationPeriod. + */ + com.google.protobuf.Duration getRotationPeriod(); + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder(); + } + /** + * + * + *
+   * Settings specific to the Key Management Service.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} + */ + public static final class KMSSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + KMSSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use KMSSettings.newBuilder() to construct. + private KMSSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private KMSSettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new KMSSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private KMSSettings( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (nextRotationTime_ != null) { + subBuilder = nextRotationTime_.toBuilder(); + } + nextRotationTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(nextRotationTime_); + nextRotationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (rotationPeriod_ != null) { + subBuilder = rotationPeriod_.toBuilder(); + } + rotationPeriod_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rotationPeriod_); + rotationPeriod_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder.class); + } + + public static final int NEXT_ROTATION_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp nextRotationTime_; + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the nextRotationTime field is set. + */ + @java.lang.Override + public boolean hasNextRotationTime() { + return nextRotationTime_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nextRotationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getNextRotationTime() { + return nextRotationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextRotationTime_; + } + /** + * + * + *
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
+     * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { + return getNextRotationTime(); + } + + public static final int ROTATION_PERIOD_FIELD_NUMBER = 2; + private com.google.protobuf.Duration rotationPeriod_; + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the rotationPeriod field is set. + */ + @java.lang.Override + public boolean hasRotationPeriod() { + return rotationPeriod_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The rotationPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRotationPeriod() { + return rotationPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : rotationPeriod_; + } + /** + * + * + *
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
+     * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { + return getRotationPeriod(); + } + + 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 (nextRotationTime_ != null) { + output.writeMessage(1, getNextRotationTime()); + } + if (rotationPeriod_ != null) { + output.writeMessage(2, getRotationPeriod()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nextRotationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getNextRotationTime()); + } + if (rotationPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRotationPeriod()); + } + 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.assuredworkloads.v1beta1.Workload.KMSSettings)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) obj; + + if (hasNextRotationTime() != other.hasNextRotationTime()) return false; + if (hasNextRotationTime()) { + if (!getNextRotationTime().equals(other.getNextRotationTime())) return false; + } + if (hasRotationPeriod() != other.hasRotationPeriod()) return false; + if (hasRotationPeriod()) { + if (!getRotationPeriod().equals(other.getRotationPeriod())) 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 (hasNextRotationTime()) { + hash = (37 * hash) + NEXT_ROTATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getNextRotationTime().hashCode(); + } + if (hasRotationPeriod()) { + hash = (37 * hash) + ROTATION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRotationPeriod().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings 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.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings 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.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings 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.assuredworkloads.v1beta1.Workload.KMSSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings 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.assuredworkloads.v1beta1.Workload.KMSSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings 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.assuredworkloads.v1beta1.Workload.KMSSettings 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; + } + /** + * + * + *
+     * Settings specific to the Key Management Service.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.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 (nextRotationTimeBuilder_ == null) { + nextRotationTime_ = null; + } else { + nextRotationTime_ = null; + nextRotationTimeBuilder_ = null; + } + if (rotationPeriodBuilder_ == null) { + rotationPeriod_ = null; + } else { + rotationPeriod_ = null; + rotationPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(this); + if (nextRotationTimeBuilder_ == null) { + result.nextRotationTime_ = nextRotationTime_; + } else { + result.nextRotationTime_ = nextRotationTimeBuilder_.build(); + } + if (rotationPeriodBuilder_ == null) { + result.rotationPeriod_ = rotationPeriod_; + } else { + result.rotationPeriod_ = rotationPeriodBuilder_.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.assuredworkloads.v1beta1.Workload.KMSSettings) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance()) + return this; + if (other.hasNextRotationTime()) { + mergeNextRotationTime(other.getNextRotationTime()); + } + if (other.hasRotationPeriod()) { + mergeRotationPeriod(other.getRotationPeriod()); + } + 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.assuredworkloads.v1beta1.Workload.KMSSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp nextRotationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + nextRotationTimeBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the nextRotationTime field is set. + */ + public boolean hasNextRotationTime() { + return nextRotationTimeBuilder_ != null || nextRotationTime_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nextRotationTime. + */ + public com.google.protobuf.Timestamp getNextRotationTime() { + if (nextRotationTimeBuilder_ == null) { + return nextRotationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextRotationTime_; + } else { + return nextRotationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setNextRotationTime(com.google.protobuf.Timestamp value) { + if (nextRotationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nextRotationTime_ = value; + onChanged(); + } else { + nextRotationTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setNextRotationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (nextRotationTimeBuilder_ == null) { + nextRotationTime_ = builderForValue.build(); + onChanged(); + } else { + nextRotationTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeNextRotationTime(com.google.protobuf.Timestamp value) { + if (nextRotationTimeBuilder_ == null) { + if (nextRotationTime_ != null) { + nextRotationTime_ = + com.google.protobuf.Timestamp.newBuilder(nextRotationTime_) + .mergeFrom(value) + .buildPartial(); + } else { + nextRotationTime_ = value; + } + onChanged(); + } else { + nextRotationTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearNextRotationTime() { + if (nextRotationTimeBuilder_ == null) { + nextRotationTime_ = null; + onChanged(); + } else { + nextRotationTime_ = null; + nextRotationTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.Timestamp.Builder getNextRotationTimeBuilder() { + + onChanged(); + return getNextRotationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { + if (nextRotationTimeBuilder_ != null) { + return nextRotationTimeBuilder_.getMessageOrBuilder(); + } else { + return nextRotationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextRotationTime_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
+       * 
+ * + * + * .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getNextRotationTimeFieldBuilder() { + if (nextRotationTimeBuilder_ == null) { + nextRotationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getNextRotationTime(), getParentForChildren(), isClean()); + nextRotationTime_ = null; + } + return nextRotationTimeBuilder_; + } + + private com.google.protobuf.Duration rotationPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + rotationPeriodBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the rotationPeriod field is set. + */ + public boolean hasRotationPeriod() { + return rotationPeriodBuilder_ != null || rotationPeriod_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The rotationPeriod. + */ + public com.google.protobuf.Duration getRotationPeriod() { + if (rotationPeriodBuilder_ == null) { + return rotationPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : rotationPeriod_; + } else { + return rotationPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setRotationPeriod(com.google.protobuf.Duration value) { + if (rotationPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotationPeriod_ = value; + onChanged(); + } else { + rotationPeriodBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setRotationPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (rotationPeriodBuilder_ == null) { + rotationPeriod_ = builderForValue.build(); + onChanged(); + } else { + rotationPeriodBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeRotationPeriod(com.google.protobuf.Duration value) { + if (rotationPeriodBuilder_ == null) { + if (rotationPeriod_ != null) { + rotationPeriod_ = + com.google.protobuf.Duration.newBuilder(rotationPeriod_) + .mergeFrom(value) + .buildPartial(); + } else { + rotationPeriod_ = value; + } + onChanged(); + } else { + rotationPeriodBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearRotationPeriod() { + if (rotationPeriodBuilder_ == null) { + rotationPeriod_ = null; + onChanged(); + } else { + rotationPeriod_ = null; + rotationPeriodBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.Duration.Builder getRotationPeriodBuilder() { + + onChanged(); + return getRotationPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { + if (rotationPeriodBuilder_ != null) { + return rotationPeriodBuilder_.getMessageOrBuilder(); + } else { + return rotationPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : rotationPeriod_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
+       * 
+ * + * + * .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRotationPeriodFieldBuilder() { + if (rotationPeriodBuilder_ == null) { + rotationPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRotationPeriod(), getParentForChildren(), isClean()); + rotationPeriod_ = null; + } + return rotationPeriodBuilder_; + } + + @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.assuredworkloads.v1beta1.Workload.KMSSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KMSSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KMSSettings(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.assuredworkloads.v1beta1.Workload.KMSSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IL4SettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + boolean hasKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder(); + } + /** + * + * + *
+   * Settings specific to resources needed for IL4.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} + */ + public static final class IL4Settings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + IL4SettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IL4Settings.newBuilder() to construct. + private IL4Settings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IL4Settings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IL4Settings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IL4Settings( + 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.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = + null; + if (kmsSettings_ != null) { + subBuilder = kmsSettings_.toBuilder(); + } + kmsSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kmsSettings_); + kmsSettings_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder.class); + } + + public static final int KMS_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + @java.lang.Override + public boolean hasKmsSettings() { + return kmsSettings_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + return getKmsSettings(); + } + + 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 (kmsSettings_ != null) { + output.writeMessage(1, getKmsSettings()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kmsSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.IL4Settings)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) obj; + + if (hasKmsSettings() != other.hasKmsSettings()) return false; + if (hasKmsSettings()) { + if (!getKmsSettings().equals(other.getKmsSettings())) 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 (hasKmsSettings()) { + hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getKmsSettings().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings 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.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings 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.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings 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.assuredworkloads.v1beta1.Workload.IL4Settings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings 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.assuredworkloads.v1beta1.Workload.IL4Settings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings 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.assuredworkloads.v1beta1.Workload.IL4Settings 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; + } + /** + * + * + *
+     * Settings specific to resources needed for IL4.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.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 (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(this); + if (kmsSettingsBuilder_ == null) { + result.kmsSettings_ = kmsSettings_; + } else { + result.kmsSettings_ = kmsSettingsBuilder_.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.assuredworkloads.v1beta1.Workload.IL4Settings) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance()) + return this; + if (other.hasKmsSettings()) { + mergeKmsSettings(other.getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.IL4Settings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + kmsSettingsBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + public boolean hasKmsSettings() { + return kmsSettingsBuilder_ != null || kmsSettings_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + if (kmsSettingsBuilder_ == null) { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } else { + return kmsSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kmsSettings_ = value; + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder builderForValue) { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = builderForValue.build(); + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (kmsSettings_ != null) { + kmsSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.newBuilder( + kmsSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + kmsSettings_ = value; + } + onChanged(); + } else { + kmsSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearKmsSettings() { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + onChanged(); + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder + getKmsSettingsBuilder() { + + onChanged(); + return getKmsSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + if (kmsSettingsBuilder_ != null) { + return kmsSettingsBuilder_.getMessageOrBuilder(); + } else { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + getKmsSettingsFieldBuilder() { + if (kmsSettingsBuilder_ == null) { + kmsSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder>( + getKmsSettings(), getParentForChildren(), isClean()); + kmsSettings_ = null; + } + return kmsSettingsBuilder_; + } + + @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.assuredworkloads.v1beta1.Workload.IL4Settings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IL4Settings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IL4Settings(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.assuredworkloads.v1beta1.Workload.IL4Settings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CJISSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + boolean hasKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder(); + } + /** + * + * + *
+   * Settings specific to resources needed for CJIS.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} + */ + public static final class CJISSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + CJISSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CJISSettings.newBuilder() to construct. + private CJISSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CJISSettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CJISSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CJISSettings( + 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.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = + null; + if (kmsSettings_ != null) { + subBuilder = kmsSettings_.toBuilder(); + } + kmsSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kmsSettings_); + kmsSettings_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder.class); + } + + public static final int KMS_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + @java.lang.Override + public boolean hasKmsSettings() { + return kmsSettings_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + return getKmsSettings(); + } + + 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 (kmsSettings_ != null) { + output.writeMessage(1, getKmsSettings()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kmsSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.CJISSettings)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) obj; + + if (hasKmsSettings() != other.hasKmsSettings()) return false; + if (hasKmsSettings()) { + if (!getKmsSettings().equals(other.getKmsSettings())) 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 (hasKmsSettings()) { + hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getKmsSettings().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings 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.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings 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.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings 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.assuredworkloads.v1beta1.Workload.CJISSettings + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + 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.assuredworkloads.v1beta1.Workload.CJISSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings 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.assuredworkloads.v1beta1.Workload.CJISSettings 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; + } + /** + * + * + *
+     * Settings specific to resources needed for CJIS.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.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 (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(this); + if (kmsSettingsBuilder_ == null) { + result.kmsSettings_ = kmsSettings_; + } else { + result.kmsSettings_ = kmsSettingsBuilder_.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.assuredworkloads.v1beta1.Workload.CJISSettings) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance()) + return this; + if (other.hasKmsSettings()) { + mergeKmsSettings(other.getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.CJISSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + kmsSettingsBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + public boolean hasKmsSettings() { + return kmsSettingsBuilder_ != null || kmsSettings_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + if (kmsSettingsBuilder_ == null) { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } else { + return kmsSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kmsSettings_ = value; + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder builderForValue) { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = builderForValue.build(); + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (kmsSettings_ != null) { + kmsSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.newBuilder( + kmsSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + kmsSettings_ = value; + } + onChanged(); + } else { + kmsSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearKmsSettings() { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + onChanged(); + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder + getKmsSettingsBuilder() { + + onChanged(); + return getKmsSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + if (kmsSettingsBuilder_ != null) { + return kmsSettingsBuilder_.getMessageOrBuilder(); + } else { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + getKmsSettingsFieldBuilder() { + if (kmsSettingsBuilder_ == null) { + kmsSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder>( + getKmsSettings(), getParentForChildren(), isClean()); + kmsSettings_ = null; + } + return kmsSettingsBuilder_; + } + + @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.assuredworkloads.v1beta1.Workload.CJISSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CJISSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CJISSettings(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.assuredworkloads.v1beta1.Workload.CJISSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FedrampHighSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + boolean hasKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder(); + } + /** + * + * + *
+   * Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} + */ + public static final class FedrampHighSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + FedrampHighSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FedrampHighSettings.newBuilder() to construct. + private FedrampHighSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FedrampHighSettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FedrampHighSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FedrampHighSettings( + 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.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = + null; + if (kmsSettings_ != null) { + subBuilder = kmsSettings_.toBuilder(); + } + kmsSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kmsSettings_); + kmsSettings_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder.class); + } + + public static final int KMS_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + @java.lang.Override + public boolean hasKmsSettings() { + return kmsSettings_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + return getKmsSettings(); + } + + 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 (kmsSettings_ != null) { + output.writeMessage(1, getKmsSettings()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kmsSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) obj; + + if (hasKmsSettings() != other.hasKmsSettings()) return false; + if (hasKmsSettings()) { + if (!getKmsSettings().equals(other.getKmsSettings())) 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 (hasKmsSettings()) { + hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getKmsSettings().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings 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; + } + /** + * + * + *
+     * Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder + .class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.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 (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(this); + if (kmsSettingsBuilder_ == null) { + result.kmsSettings_ = kmsSettings_; + } else { + result.kmsSettings_ = kmsSettingsBuilder_.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.assuredworkloads.v1beta1.Workload.FedrampHighSettings) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance()) return this; + if (other.hasKmsSettings()) { + mergeKmsSettings(other.getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.FedrampHighSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + kmsSettingsBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + public boolean hasKmsSettings() { + return kmsSettingsBuilder_ != null || kmsSettings_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + if (kmsSettingsBuilder_ == null) { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } else { + return kmsSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kmsSettings_ = value; + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder builderForValue) { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = builderForValue.build(); + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (kmsSettings_ != null) { + kmsSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.newBuilder( + kmsSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + kmsSettings_ = value; + } + onChanged(); + } else { + kmsSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearKmsSettings() { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + onChanged(); + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder + getKmsSettingsBuilder() { + + onChanged(); + return getKmsSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + if (kmsSettingsBuilder_ != null) { + return kmsSettingsBuilder_.getMessageOrBuilder(); + } else { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + getKmsSettingsFieldBuilder() { + if (kmsSettingsBuilder_ == null) { + kmsSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder>( + getKmsSettings(), getParentForChildren(), isClean()); + kmsSettings_ = null; + } + return kmsSettingsBuilder_; + } + + @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.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FedrampHighSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FedrampHighSettings(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.assuredworkloads.v1beta1.Workload.FedrampHighSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FedrampModerateSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + boolean hasKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings(); + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder(); + } + /** + * + * + *
+   * Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} + */ + public static final class FedrampModerateSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + FedrampModerateSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FedrampModerateSettings.newBuilder() to construct. + private FedrampModerateSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FedrampModerateSettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FedrampModerateSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FedrampModerateSettings( + 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.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = + null; + if (kmsSettings_ != null) { + subBuilder = kmsSettings_.toBuilder(); + } + kmsSettings_ = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kmsSettings_); + kmsSettings_ = 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.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder + .class); + } + + public static final int KMS_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + @java.lang.Override + public boolean hasKmsSettings() { + return kmsSettings_ != null; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + return getKmsSettings(); + } + + 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 (kmsSettings_ != null) { + output.writeMessage(1, getKmsSettings()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kmsSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings other = + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) obj; + + if (hasKmsSettings() != other.hasKmsSettings()) return false; + if (hasKmsSettings()) { + if (!getKmsSettings().equals(other.getKmsSettings())) 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 (hasKmsSettings()) { + hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getKmsSettings().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings 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; + } + /** + * + * + *
+     * Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder + .class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.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 (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings build() { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings result = + new com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(this); + if (kmsSettingsBuilder_ == null) { + result.kmsSettings_ = kmsSettings_; + } else { + result.kmsSettings_ = kmsSettingsBuilder_.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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings other) { + if (other + == com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance()) return this; + if (other.hasKmsSettings()) { + mergeKmsSettings(other.getKmsSettings()); + } + 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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kmsSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + kmsSettingsBuilder_; + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the kmsSettings field is set. + */ + public boolean hasKmsSettings() { + return kmsSettingsBuilder_ != null || kmsSettings_ != null; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The kmsSettings. + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings getKmsSettings() { + if (kmsSettingsBuilder_ == null) { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } else { + return kmsSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kmsSettings_ = value; + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder builderForValue) { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = builderForValue.build(); + onChanged(); + } else { + kmsSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeKmsSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings value) { + if (kmsSettingsBuilder_ == null) { + if (kmsSettings_ != null) { + kmsSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.newBuilder( + kmsSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + kmsSettings_ = value; + } + onChanged(); + } else { + kmsSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearKmsSettings() { + if (kmsSettingsBuilder_ == null) { + kmsSettings_ = null; + onChanged(); + } else { + kmsSettings_ = null; + kmsSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder + getKmsSettingsBuilder() { + + onChanged(); + return getKmsSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder + getKmsSettingsOrBuilder() { + if (kmsSettingsBuilder_ != null) { + return kmsSettingsBuilder_.getMessageOrBuilder(); + } else { + return kmsSettings_ == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.getDefaultInstance() + : kmsSettings_; + } + } + /** + * + * + *
+       * Required. Input only. Immutable. Settings used to create a CMEK crypto key.
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder> + getKmsSettingsFieldBuilder() { + if (kmsSettingsBuilder_ == null) { + kmsSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettingsOrBuilder>( + getKmsSettings(), getParentForChildren(), isClean()); + kmsSettings_ = null; + } + return kmsSettingsBuilder_; + } + + @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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FedrampModerateSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FedrampModerateSettings(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.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int complianceRegimeSettingsCase_ = 0; + private java.lang.Object complianceRegimeSettings_; + + public enum ComplianceRegimeSettingsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IL4_SETTINGS(7), + CJIS_SETTINGS(8), + FEDRAMP_HIGH_SETTINGS(11), + FEDRAMP_MODERATE_SETTINGS(12), + COMPLIANCEREGIMESETTINGS_NOT_SET(0); + private final int value; + + private ComplianceRegimeSettingsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ComplianceRegimeSettingsCase valueOf(int value) { + return forNumber(value); + } + + public static ComplianceRegimeSettingsCase forNumber(int value) { + switch (value) { + case 7: + return IL4_SETTINGS; + case 8: + return CJIS_SETTINGS; + case 11: + return FEDRAMP_HIGH_SETTINGS; + case 12: + return FEDRAMP_MODERATE_SETTINGS; + case 0: + return COMPLIANCEREGIMESETTINGS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ComplianceRegimeSettingsCase getComplianceRegimeSettingsCase() { + return ComplianceRegimeSettingsCase.forNumber(complianceRegimeSettingsCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Optional. The resource name of the workload.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}
+   * Read-only.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Optional. The resource name of the workload.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}
+   * Read-only.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + @java.lang.Override + 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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The user-assigned display name of the Workload.
+   * When present it must be between 4 to 30 characters.
+   * Allowed characters are: lowercase and uppercase letters, numbers,
+   * hyphen, single-quote, double-quote, space, and exclamation point.
+   * Example: My Workload
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The user-assigned display name of the Workload.
+   * When present it must be between 4 to 30 characters.
+   * Allowed characters are: lowercase and uppercase letters, numbers,
+   * hyphen, single-quote, double-quote, space, and exclamation point.
+   * Example: My Workload
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCES_FIELD_NUMBER = 3; + private java.util.List + resources_; + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getResourcesList() { + return resources_; + } + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder> + getResourcesOrBuilderList() { + return resources_; + } + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getResourcesCount() { + return resources_.size(); + } + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo getResources(int index) { + return resources_.get(index); + } + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder + getResourcesOrBuilder(int index) { + return resources_.get(index); + } + + public static final int COMPLIANCE_REGIME_FIELD_NUMBER = 4; + private int complianceRegime_; + /** + * + * + *
+   * Required. Immutable. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + @java.lang.Override + public int getComplianceRegimeValue() { + return complianceRegime_; + } + /** + * + * + *
+   * Required. Immutable. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The complianceRegime. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime getComplianceRegime() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.valueOf( + complianceRegime_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int BILLING_ACCOUNT_FIELD_NUMBER = 6; + private volatile java.lang.Object billingAccount_; + /** + * + * + *
+   * Required. Input only. The billing account used for the resources which are
+   * direct children of workload. This billing account is initially associated
+   * with the resources created as part of Workload creation.
+   * After the initial creation of these resources, the customer can change
+   * the assigned billing account.
+   * The resource name has the form
+   * `billingAccounts/{billing_account_id}`. For example,
+   * `billingAccounts/012345-567890-ABCDEF`.
+   * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The billingAccount. + */ + @java.lang.Override + public java.lang.String getBillingAccount() { + java.lang.Object ref = billingAccount_; + 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(); + billingAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Input only. The billing account used for the resources which are
+   * direct children of workload. This billing account is initially associated
+   * with the resources created as part of Workload creation.
+   * After the initial creation of these resources, the customer can change
+   * the assigned billing account.
+   * The resource name has the form
+   * `billingAccounts/{billing_account_id}`. For example,
+   * `billingAccounts/012345-567890-ABCDEF`.
+   * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The bytes for billingAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBillingAccountBytes() { + java.lang.Object ref = billingAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + billingAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IL4_SETTINGS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the il4Settings field is set. + */ + @java.lang.Override + public boolean hasIl4Settings() { + return complianceRegimeSettingsCase_ == 7; + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The il4Settings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings getIl4Settings() { + if (complianceRegimeSettingsCase_ == 7) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder + getIl4SettingsOrBuilder() { + if (complianceRegimeSettingsCase_ == 7) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + + public static final int CJIS_SETTINGS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the cjisSettings field is set. + */ + @java.lang.Override + public boolean hasCjisSettings() { + return complianceRegimeSettingsCase_ == 8; + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The cjisSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings getCjisSettings() { + if (complianceRegimeSettingsCase_ == 8) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder + getCjisSettingsOrBuilder() { + if (complianceRegimeSettingsCase_ == 8) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + + public static final int FEDRAMP_HIGH_SETTINGS_FIELD_NUMBER = 11; + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampHighSettings field is set. + */ + @java.lang.Override + public boolean hasFedrampHighSettings() { + return complianceRegimeSettingsCase_ == 11; + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampHighSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + getFedrampHighSettings() { + if (complianceRegimeSettingsCase_ == 11) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder + getFedrampHighSettingsOrBuilder() { + if (complianceRegimeSettingsCase_ == 11) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + + public static final int FEDRAMP_MODERATE_SETTINGS_FIELD_NUMBER = 12; + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampModerateSettings field is set. + */ + @java.lang.Override + public boolean hasFedrampModerateSettings() { + return complianceRegimeSettingsCase_ == 12; + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampModerateSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getFedrampModerateSettings() { + if (complianceRegimeSettingsCase_ == 12) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder + getFedrampModerateSettingsOrBuilder() { + if (complianceRegimeSettingsCase_ == 12) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + + public static final int ETAG_FIELD_NUMBER = 9; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. ETag of the workload, it is calculated on the basis
+   * of the Workload contents. It will be used in Update & Delete operations.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. ETag of the workload, it is calculated on the basis
+   * of the Workload contents. It will be used in Update & Delete operations.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 10; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < resources_.size(); i++) { + output.writeMessage(3, resources_.get(i)); + } + if (complianceRegime_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + .COMPLIANCE_REGIME_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, complianceRegime_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (!getBillingAccountBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, billingAccount_); + } + if (complianceRegimeSettingsCase_ == 7) { + output.writeMessage( + 7, + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_); + } + if (complianceRegimeSettingsCase_ == 8) { + output.writeMessage( + 8, + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 10); + if (complianceRegimeSettingsCase_ == 11) { + output.writeMessage( + 11, + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_); + } + if (complianceRegimeSettingsCase_ == 12) { + output.writeMessage( + 12, + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < resources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, resources_.get(i)); + } + if (complianceRegime_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + .COMPLIANCE_REGIME_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, complianceRegime_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (!getBillingAccountBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, billingAccount_); + } + if (complianceRegimeSettingsCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_); + } + if (complianceRegimeSettingsCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, etag_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, labels__); + } + if (complianceRegimeSettingsCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_); + } + if (complianceRegimeSettingsCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_); + } + 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.assuredworkloads.v1beta1.Workload)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1beta1.Workload other = + (com.google.cloud.assuredworkloads.v1beta1.Workload) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getResourcesList().equals(other.getResourcesList())) return false; + if (complianceRegime_ != other.complianceRegime_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getBillingAccount().equals(other.getBillingAccount())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getComplianceRegimeSettingsCase().equals(other.getComplianceRegimeSettingsCase())) + return false; + switch (complianceRegimeSettingsCase_) { + case 7: + if (!getIl4Settings().equals(other.getIl4Settings())) return false; + break; + case 8: + if (!getCjisSettings().equals(other.getCjisSettings())) return false; + break; + case 11: + if (!getFedrampHighSettings().equals(other.getFedrampHighSettings())) return false; + break; + case 12: + if (!getFedrampModerateSettings().equals(other.getFedrampModerateSettings())) return false; + break; + case 0: + default: + } + 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getResourcesCount() > 0) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResourcesList().hashCode(); + } + hash = (37 * hash) + COMPLIANCE_REGIME_FIELD_NUMBER; + hash = (53 * hash) + complianceRegime_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + BILLING_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getBillingAccount().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (complianceRegimeSettingsCase_) { + case 7: + hash = (37 * hash) + IL4_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getIl4Settings().hashCode(); + break; + case 8: + hash = (37 * hash) + CJIS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getCjisSettings().hashCode(); + break; + case 11: + hash = (37 * hash) + FEDRAMP_HIGH_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getFedrampHighSettings().hashCode(); + break; + case 12: + hash = (37 * hash) + FEDRAMP_MODERATE_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getFedrampModerateSettings().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload 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.assuredworkloads.v1beta1.Workload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload 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.assuredworkloads.v1beta1.Workload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload 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.assuredworkloads.v1beta1.Workload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload 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.assuredworkloads.v1beta1.Workload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload 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.assuredworkloads.v1beta1.Workload 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; + } + /** + * + * + *
+   * An Workload object for managing highly regulated workloads of cloud
+   * customers.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1beta1.Workload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1beta1.Workload) + com.google.cloud.assuredworkloads.v1beta1.WorkloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 10: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1beta1.Workload.class, + com.google.cloud.assuredworkloads.v1beta1.Workload.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourcesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (resourcesBuilder_ == null) { + resources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resourcesBuilder_.clear(); + } + complianceRegime_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + billingAccount_ = ""; + + etag_ = ""; + + internalGetMutableLabels().clear(); + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload build() { + com.google.cloud.assuredworkloads.v1beta1.Workload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload buildPartial() { + com.google.cloud.assuredworkloads.v1beta1.Workload result = + new com.google.cloud.assuredworkloads.v1beta1.Workload(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (resourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + resources_ = java.util.Collections.unmodifiableList(resources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resources_ = resources_; + } else { + result.resources_ = resourcesBuilder_.build(); + } + result.complianceRegime_ = complianceRegime_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.billingAccount_ = billingAccount_; + if (complianceRegimeSettingsCase_ == 7) { + if (il4SettingsBuilder_ == null) { + result.complianceRegimeSettings_ = complianceRegimeSettings_; + } else { + result.complianceRegimeSettings_ = il4SettingsBuilder_.build(); + } + } + if (complianceRegimeSettingsCase_ == 8) { + if (cjisSettingsBuilder_ == null) { + result.complianceRegimeSettings_ = complianceRegimeSettings_; + } else { + result.complianceRegimeSettings_ = cjisSettingsBuilder_.build(); + } + } + if (complianceRegimeSettingsCase_ == 11) { + if (fedrampHighSettingsBuilder_ == null) { + result.complianceRegimeSettings_ = complianceRegimeSettings_; + } else { + result.complianceRegimeSettings_ = fedrampHighSettingsBuilder_.build(); + } + } + if (complianceRegimeSettingsCase_ == 12) { + if (fedrampModerateSettingsBuilder_ == null) { + result.complianceRegimeSettings_ = complianceRegimeSettings_; + } else { + result.complianceRegimeSettings_ = fedrampModerateSettingsBuilder_.build(); + } + } + result.etag_ = etag_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.complianceRegimeSettingsCase_ = complianceRegimeSettingsCase_; + 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.assuredworkloads.v1beta1.Workload) { + return mergeFrom((com.google.cloud.assuredworkloads.v1beta1.Workload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.Workload other) { + if (other == com.google.cloud.assuredworkloads.v1beta1.Workload.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (resourcesBuilder_ == null) { + if (!other.resources_.isEmpty()) { + if (resources_.isEmpty()) { + resources_ = other.resources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourcesIsMutable(); + resources_.addAll(other.resources_); + } + onChanged(); + } + } else { + if (!other.resources_.isEmpty()) { + if (resourcesBuilder_.isEmpty()) { + resourcesBuilder_.dispose(); + resourcesBuilder_ = null; + resources_ = other.resources_; + bitField0_ = (bitField0_ & ~0x00000001); + resourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResourcesFieldBuilder() + : null; + } else { + resourcesBuilder_.addAllMessages(other.resources_); + } + } + } + if (other.complianceRegime_ != 0) { + setComplianceRegimeValue(other.getComplianceRegimeValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getBillingAccount().isEmpty()) { + billingAccount_ = other.billingAccount_; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + switch (other.getComplianceRegimeSettingsCase()) { + case IL4_SETTINGS: + { + mergeIl4Settings(other.getIl4Settings()); + break; + } + case CJIS_SETTINGS: + { + mergeCjisSettings(other.getCjisSettings()); + break; + } + case FEDRAMP_HIGH_SETTINGS: + { + mergeFedrampHighSettings(other.getFedrampHighSettings()); + break; + } + case FEDRAMP_MODERATE_SETTINGS: + { + mergeFedrampModerateSettings(other.getFedrampModerateSettings()); + break; + } + case COMPLIANCEREGIMESETTINGS_NOT_SET: + { + break; + } + } + 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.assuredworkloads.v1beta1.Workload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.assuredworkloads.v1beta1.Workload) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int complianceRegimeSettingsCase_ = 0; + private java.lang.Object complianceRegimeSettings_; + + public ComplianceRegimeSettingsCase getComplianceRegimeSettingsCase() { + return ComplianceRegimeSettingsCase.forNumber(complianceRegimeSettingsCase_); + } + + public Builder clearComplianceRegimeSettings() { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Optional. The resource name of the workload.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}
+     * Read-only.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The resource name of the workload.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}
+     * Read-only.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The resource name of the workload.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}
+     * Read-only.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. The resource name of the workload.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}
+     * Read-only.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The resource name of the workload.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}
+     * Read-only.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 displayName_ = ""; + /** + * + * + *
+     * Required. The user-assigned display name of the Workload.
+     * When present it must be between 4 to 30 characters.
+     * Allowed characters are: lowercase and uppercase letters, numbers,
+     * hyphen, single-quote, double-quote, space, and exclamation point.
+     * Example: My Workload
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The user-assigned display name of the Workload.
+     * When present it must be between 4 to 30 characters.
+     * Allowed characters are: lowercase and uppercase letters, numbers,
+     * hyphen, single-quote, double-quote, space, and exclamation point.
+     * Example: My Workload
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The user-assigned display name of the Workload.
+     * When present it must be between 4 to 30 characters.
+     * Allowed characters are: lowercase and uppercase letters, numbers,
+     * hyphen, single-quote, double-quote, space, and exclamation point.
+     * Example: My Workload
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The user-assigned display name of the Workload.
+     * When present it must be between 4 to 30 characters.
+     * Allowed characters are: lowercase and uppercase letters, numbers,
+     * hyphen, single-quote, double-quote, space, and exclamation point.
+     * Example: My Workload
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The user-assigned display name of the Workload.
+     * When present it must be between 4 to 30 characters.
+     * Allowed characters are: lowercase and uppercase letters, numbers,
+     * hyphen, single-quote, double-quote, space, and exclamation point.
+     * Example: My Workload
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.util.List + resources_ = java.util.Collections.emptyList(); + + private void ensureResourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + resources_ = + new java.util.ArrayList< + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo>(resources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder> + resourcesBuilder_; + + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getResourcesList() { + if (resourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(resources_); + } else { + return resourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getResourcesCount() { + if (resourcesBuilder_ == null) { + return resources_.size(); + } else { + return resourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo getResources(int index) { + if (resourcesBuilder_ == null) { + return resources_.get(index); + } else { + return resourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResources( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.set(index, value); + onChanged(); + } else { + resourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResources( + int index, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder builderForValue) { + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.set(index, builderForValue.build()); + onChanged(); + } else { + resourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addResources( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + onChanged(); + } else { + resourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addResources( + int index, com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(index, value); + onChanged(); + } else { + resourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addResources( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder builderForValue) { + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.add(builderForValue.build()); + onChanged(); + } else { + resourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addResources( + int index, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder builderForValue) { + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.add(index, builderForValue.build()); + onChanged(); + } else { + resourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllResources( + java.lang.Iterable< + ? extends com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo> + values) { + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); + onChanged(); + } else { + resourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearResources() { + if (resourcesBuilder_ == null) { + resources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeResources(int index) { + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.remove(index); + onChanged(); + } else { + resourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder + getResourcesBuilder(int index) { + return getResourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder + getResourcesOrBuilder(int index) { + if (resourcesBuilder_ == null) { + return resources_.get(index); + } else { + return resourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder> + getResourcesOrBuilderList() { + if (resourcesBuilder_ != null) { + return resourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resources_); + } + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder + addResourcesBuilder() { + return getResourcesFieldBuilder() + .addBuilder( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder + addResourcesBuilder(int index) { + return getResourcesFieldBuilder() + .addBuilder( + index, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The resources associated with this workload.
+     * These resources will be created when creating the workload.
+     * If any of the projects already exist, the workload creation will fail.
+     * Always read only.
+     * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getResourcesBuilderList() { + return getResourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder> + getResourcesFieldBuilder() { + if (resourcesBuilder_ == null) { + resourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder>( + resources_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + resources_ = null; + } + return resourcesBuilder_; + } + + private int complianceRegime_ = 0; + /** + * + * + *
+     * Required. Immutable. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + @java.lang.Override + public int getComplianceRegimeValue() { + return complianceRegime_; + } + /** + * + * + *
+     * Required. Immutable. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for complianceRegime to set. + * @return This builder for chaining. + */ + public Builder setComplianceRegimeValue(int value) { + + complianceRegime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The complianceRegime. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + getComplianceRegime() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime result = + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.valueOf( + complianceRegime_); + return result == null + ? com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Immutable. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The complianceRegime to set. + * @return This builder for chaining. + */ + public Builder setComplianceRegime( + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime value) { + if (value == null) { + throw new NullPointerException(); + } + + complianceRegime_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearComplianceRegime() { + + complianceRegime_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Immutable. The Workload creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object billingAccount_ = ""; + /** + * + * + *
+     * Required. Input only. The billing account used for the resources which are
+     * direct children of workload. This billing account is initially associated
+     * with the resources created as part of Workload creation.
+     * After the initial creation of these resources, the customer can change
+     * the assigned billing account.
+     * The resource name has the form
+     * `billingAccounts/{billing_account_id}`. For example,
+     * `billingAccounts/012345-567890-ABCDEF`.
+     * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The billingAccount. + */ + public java.lang.String getBillingAccount() { + java.lang.Object ref = billingAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + billingAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Input only. The billing account used for the resources which are
+     * direct children of workload. This billing account is initially associated
+     * with the resources created as part of Workload creation.
+     * After the initial creation of these resources, the customer can change
+     * the assigned billing account.
+     * The resource name has the form
+     * `billingAccounts/{billing_account_id}`. For example,
+     * `billingAccounts/012345-567890-ABCDEF`.
+     * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The bytes for billingAccount. + */ + public com.google.protobuf.ByteString getBillingAccountBytes() { + java.lang.Object ref = billingAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + billingAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Input only. The billing account used for the resources which are
+     * direct children of workload. This billing account is initially associated
+     * with the resources created as part of Workload creation.
+     * After the initial creation of these resources, the customer can change
+     * the assigned billing account.
+     * The resource name has the form
+     * `billingAccounts/{billing_account_id}`. For example,
+     * `billingAccounts/012345-567890-ABCDEF`.
+     * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The billingAccount to set. + * @return This builder for chaining. + */ + public Builder setBillingAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + billingAccount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input only. The billing account used for the resources which are
+     * direct children of workload. This billing account is initially associated
+     * with the resources created as part of Workload creation.
+     * After the initial creation of these resources, the customer can change
+     * the assigned billing account.
+     * The resource name has the form
+     * `billingAccounts/{billing_account_id}`. For example,
+     * `billingAccounts/012345-567890-ABCDEF`.
+     * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBillingAccount() { + + billingAccount_ = getDefaultInstance().getBillingAccount(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input only. The billing account used for the resources which are
+     * direct children of workload. This billing account is initially associated
+     * with the resources created as part of Workload creation.
+     * After the initial creation of these resources, the customer can change
+     * the assigned billing account.
+     * The resource name has the form
+     * `billingAccounts/{billing_account_id}`. For example,
+     * `billingAccounts/012345-567890-ABCDEF`.
+     * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The bytes for billingAccount to set. + * @return This builder for chaining. + */ + public Builder setBillingAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + billingAccount_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder> + il4SettingsBuilder_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the il4Settings field is set. + */ + @java.lang.Override + public boolean hasIl4Settings() { + return complianceRegimeSettingsCase_ == 7; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The il4Settings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings getIl4Settings() { + if (il4SettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 7) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } else { + if (complianceRegimeSettingsCase_ == 7) { + return il4SettingsBuilder_.getMessage(); + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setIl4Settings( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings value) { + if (il4SettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + complianceRegimeSettings_ = value; + onChanged(); + } else { + il4SettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 7; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setIl4Settings( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder builderForValue) { + if (il4SettingsBuilder_ == null) { + complianceRegimeSettings_ = builderForValue.build(); + onChanged(); + } else { + il4SettingsBuilder_.setMessage(builderForValue.build()); + } + complianceRegimeSettingsCase_ = 7; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeIl4Settings( + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings value) { + if (il4SettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 7 + && complianceRegimeSettings_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + .getDefaultInstance()) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.newBuilder( + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + complianceRegimeSettings_ = value; + } + onChanged(); + } else { + if (complianceRegimeSettingsCase_ == 7) { + il4SettingsBuilder_.mergeFrom(value); + } + il4SettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 7; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearIl4Settings() { + if (il4SettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 7) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + onChanged(); + } + } else { + if (complianceRegimeSettingsCase_ == 7) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + } + il4SettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder + getIl4SettingsBuilder() { + return getIl4SettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder + getIl4SettingsOrBuilder() { + if ((complianceRegimeSettingsCase_ == 7) && (il4SettingsBuilder_ != null)) { + return il4SettingsBuilder_.getMessageOrBuilder(); + } else { + if (complianceRegimeSettingsCase_ == 7) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder> + getIl4SettingsFieldBuilder() { + if (il4SettingsBuilder_ == null) { + if (!(complianceRegimeSettingsCase_ == 7)) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.getDefaultInstance(); + } + il4SettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder>( + (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + complianceRegimeSettings_, + getParentForChildren(), + isClean()); + complianceRegimeSettings_ = null; + } + complianceRegimeSettingsCase_ = 7; + onChanged(); + ; + return il4SettingsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder> + cjisSettingsBuilder_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the cjisSettings field is set. + */ + @java.lang.Override + public boolean hasCjisSettings() { + return complianceRegimeSettingsCase_ == 8; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The cjisSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings getCjisSettings() { + if (cjisSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 8) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } else { + if (complianceRegimeSettingsCase_ == 8) { + return cjisSettingsBuilder_.getMessage(); + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setCjisSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings value) { + if (cjisSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + complianceRegimeSettings_ = value; + onChanged(); + } else { + cjisSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 8; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setCjisSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder builderForValue) { + if (cjisSettingsBuilder_ == null) { + complianceRegimeSettings_ = builderForValue.build(); + onChanged(); + } else { + cjisSettingsBuilder_.setMessage(builderForValue.build()); + } + complianceRegimeSettingsCase_ = 8; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeCjisSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings value) { + if (cjisSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 8 + && complianceRegimeSettings_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + .getDefaultInstance()) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.newBuilder( + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + complianceRegimeSettings_ = value; + } + onChanged(); + } else { + if (complianceRegimeSettingsCase_ == 8) { + cjisSettingsBuilder_.mergeFrom(value); + } + cjisSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 8; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearCjisSettings() { + if (cjisSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 8) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + onChanged(); + } + } else { + if (complianceRegimeSettingsCase_ == 8) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + } + cjisSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder + getCjisSettingsBuilder() { + return getCjisSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder + getCjisSettingsOrBuilder() { + if ((complianceRegimeSettingsCase_ == 8) && (cjisSettingsBuilder_ != null)) { + return cjisSettingsBuilder_.getMessageOrBuilder(); + } else { + if (complianceRegimeSettingsCase_ == 8) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder> + getCjisSettingsFieldBuilder() { + if (cjisSettingsBuilder_ == null) { + if (!(complianceRegimeSettingsCase_ == 8)) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.getDefaultInstance(); + } + cjisSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder>( + (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + complianceRegimeSettings_, + getParentForChildren(), + isClean()); + complianceRegimeSettings_ = null; + } + complianceRegimeSettingsCase_ = 8; + onChanged(); + ; + return cjisSettingsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder> + fedrampHighSettingsBuilder_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampHighSettings field is set. + */ + @java.lang.Override + public boolean hasFedrampHighSettings() { + return complianceRegimeSettingsCase_ == 11; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampHighSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + getFedrampHighSettings() { + if (fedrampHighSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 11) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } else { + if (complianceRegimeSettingsCase_ == 11) { + return fedrampHighSettingsBuilder_.getMessage(); + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setFedrampHighSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings value) { + if (fedrampHighSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + complianceRegimeSettings_ = value; + onChanged(); + } else { + fedrampHighSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setFedrampHighSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder + builderForValue) { + if (fedrampHighSettingsBuilder_ == null) { + complianceRegimeSettings_ = builderForValue.build(); + onChanged(); + } else { + fedrampHighSettingsBuilder_.setMessage(builderForValue.build()); + } + complianceRegimeSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeFedrampHighSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings value) { + if (fedrampHighSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 11 + && complianceRegimeSettings_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance()) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.newBuilder( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + complianceRegimeSettings_ = value; + } + onChanged(); + } else { + if (complianceRegimeSettingsCase_ == 11) { + fedrampHighSettingsBuilder_.mergeFrom(value); + } + fedrampHighSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearFedrampHighSettings() { + if (fedrampHighSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 11) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + onChanged(); + } + } else { + if (complianceRegimeSettingsCase_ == 11) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + } + fedrampHighSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder + getFedrampHighSettingsBuilder() { + return getFedrampHighSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder + getFedrampHighSettingsOrBuilder() { + if ((complianceRegimeSettingsCase_ == 11) && (fedrampHighSettingsBuilder_ != null)) { + return fedrampHighSettingsBuilder_.getMessageOrBuilder(); + } else { + if (complianceRegimeSettingsCase_ == 11) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder> + getFedrampHighSettingsFieldBuilder() { + if (fedrampHighSettingsBuilder_ == null) { + if (!(complianceRegimeSettingsCase_ == 11)) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + .getDefaultInstance(); + } + fedrampHighSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder>( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + complianceRegimeSettings_, + getParentForChildren(), + isClean()); + complianceRegimeSettings_ = null; + } + complianceRegimeSettingsCase_ = 11; + onChanged(); + ; + return fedrampHighSettingsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder> + fedrampModerateSettingsBuilder_; + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampModerateSettings field is set. + */ + @java.lang.Override + public boolean hasFedrampModerateSettings() { + return complianceRegimeSettingsCase_ == 12; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampModerateSettings. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getFedrampModerateSettings() { + if (fedrampModerateSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 12) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } else { + if (complianceRegimeSettingsCase_ == 12) { + return fedrampModerateSettingsBuilder_.getMessage(); + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setFedrampModerateSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings value) { + if (fedrampModerateSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + complianceRegimeSettings_ = value; + onChanged(); + } else { + fedrampModerateSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 12; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setFedrampModerateSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder + builderForValue) { + if (fedrampModerateSettingsBuilder_ == null) { + complianceRegimeSettings_ = builderForValue.build(); + onChanged(); + } else { + fedrampModerateSettingsBuilder_.setMessage(builderForValue.build()); + } + complianceRegimeSettingsCase_ = 12; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeFedrampModerateSettings( + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings value) { + if (fedrampModerateSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 12 + && complianceRegimeSettings_ + != com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance()) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.newBuilder( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + complianceRegimeSettings_ = value; + } + onChanged(); + } else { + if (complianceRegimeSettingsCase_ == 12) { + fedrampModerateSettingsBuilder_.mergeFrom(value); + } + fedrampModerateSettingsBuilder_.setMessage(value); + } + complianceRegimeSettingsCase_ = 12; + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearFedrampModerateSettings() { + if (fedrampModerateSettingsBuilder_ == null) { + if (complianceRegimeSettingsCase_ == 12) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + onChanged(); + } + } else { + if (complianceRegimeSettingsCase_ == 12) { + complianceRegimeSettingsCase_ = 0; + complianceRegimeSettings_ = null; + } + fedrampModerateSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder + getFedrampModerateSettingsBuilder() { + return getFedrampModerateSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder + getFedrampModerateSettingsOrBuilder() { + if ((complianceRegimeSettingsCase_ == 12) && (fedrampModerateSettingsBuilder_ != null)) { + return fedrampModerateSettingsBuilder_.getMessageOrBuilder(); + } else { + if (complianceRegimeSettingsCase_ == 12) { + return (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_; + } + return com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder> + getFedrampModerateSettingsFieldBuilder() { + if (fedrampModerateSettingsBuilder_ == null) { + if (!(complianceRegimeSettingsCase_ == 12)) { + complianceRegimeSettings_ = + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + .getDefaultInstance(); + } + fedrampModerateSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings, + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder, + com.google.cloud.assuredworkloads.v1beta1.Workload + .FedrampModerateSettingsOrBuilder>( + (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + complianceRegimeSettings_, + getParentForChildren(), + isClean()); + complianceRegimeSettings_ = null; + } + complianceRegimeSettingsCase_ = 12; + onChanged(); + ; + return fedrampModerateSettingsBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. ETag of the workload, it is calculated on the basis
+     * of the Workload contents. It will be used in Update & Delete operations.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. ETag of the workload, it is calculated on the basis
+     * of the Workload contents. It will be used in Update & Delete operations.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. ETag of the workload, it is calculated on the basis
+     * of the Workload contents. It will be used in Update & Delete operations.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. ETag of the workload, it is calculated on the basis
+     * of the Workload contents. It will be used in Update & Delete operations.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. ETag of the workload, it is calculated on the basis
+     * of the Workload contents. It will be used in Update & Delete operations.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Labels applied to the workload.
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + 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.assuredworkloads.v1beta1.Workload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1beta1.Workload) + private static final com.google.cloud.assuredworkloads.v1beta1.Workload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1beta1.Workload(); + } + + public static com.google.cloud.assuredworkloads.v1beta1.Workload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Workload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Workload(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.assuredworkloads.v1beta1.Workload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadName.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadName.java new file mode 100644 index 00000000..b95aacdd --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadName.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.assuredworkloads.v1beta1; + +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 WorkloadName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/workloads/{workload}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String location; + private final String workload; + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private WorkloadName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public static WorkloadName of(String organization, String location, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setWorkload(workload) + .build(); + } + + public static String format(String organization, String location, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setWorkload(workload) + .build() + .toString(); + } + + public static WorkloadName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "WorkloadName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location"), matchMap.get("workload")); + } + + 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 (WorkloadName 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("organization", organization); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("workload", workload); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "organization", organization, "location", location, "workload", workload); + } + + /** Builder for WorkloadName. */ + public static class Builder { + + private String organization; + private String location; + private String workload; + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder() {} + + private Builder(WorkloadName workloadName) { + organization = workloadName.organization; + location = workloadName.location; + workload = workloadName.workload; + } + + public WorkloadName build() { + return new WorkloadName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof WorkloadName) { + WorkloadName that = (WorkloadName) o; + return (this.organization.equals(that.organization)) + && (this.location.equals(that.location)) + && (this.workload.equals(that.workload)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= workload.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadOrBuilder.java b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadOrBuilder.java new file mode 100644 index 00000000..8ebc5368 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadOrBuilder.java @@ -0,0 +1,533 @@ +/* + * 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/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto + +package com.google.cloud.assuredworkloads.v1beta1; + +public interface WorkloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1beta1.Workload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The resource name of the workload.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}
+   * Read-only.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Optional. The resource name of the workload.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}
+   * Read-only.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The user-assigned display name of the Workload.
+   * When present it must be between 4 to 30 characters.
+   * Allowed characters are: lowercase and uppercase letters, numbers,
+   * hyphen, single-quote, double-quote, space, and exclamation point.
+   * Example: My Workload
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The user-assigned display name of the Workload.
+   * When present it must be between 4 to 30 characters.
+   * Allowed characters are: lowercase and uppercase letters, numbers,
+   * hyphen, single-quote, double-quote, space, and exclamation point.
+   * Example: My Workload
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getResourcesList(); + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo getResources(int index); + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getResourcesCount(); + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getResourcesOrBuilderList(); + /** + * + * + *
+   * Output only. The resources associated with this workload.
+   * These resources will be created when creating the workload.
+   * If any of the projects already exist, the workload creation will fail.
+   * Always read only.
+   * 
+ * + * + * repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfoOrBuilder getResourcesOrBuilder( + int index); + + /** + * + * + *
+   * Required. Immutable. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for complianceRegime. + */ + int getComplianceRegimeValue(); + /** + * + * + *
+   * Required. Immutable. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The complianceRegime. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime getComplianceRegime(); + + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Immutable. The Workload creation timestamp.
+   * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Required. Input only. The billing account used for the resources which are
+   * direct children of workload. This billing account is initially associated
+   * with the resources created as part of Workload creation.
+   * After the initial creation of these resources, the customer can change
+   * the assigned billing account.
+   * The resource name has the form
+   * `billingAccounts/{billing_account_id}`. For example,
+   * `billingAccounts/012345-567890-ABCDEF`.
+   * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The billingAccount. + */ + java.lang.String getBillingAccount(); + /** + * + * + *
+   * Required. Input only. The billing account used for the resources which are
+   * direct children of workload. This billing account is initially associated
+   * with the resources created as part of Workload creation.
+   * After the initial creation of these resources, the customer can change
+   * the assigned billing account.
+   * The resource name has the form
+   * `billingAccounts/{billing_account_id}`. For example,
+   * `billingAccounts/012345-567890-ABCDEF`.
+   * 
+ * + * + * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The bytes for billingAccount. + */ + com.google.protobuf.ByteString getBillingAccountBytes(); + + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the il4Settings field is set. + */ + boolean hasIl4Settings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The il4Settings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings getIl4Settings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for IL4.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.IL4SettingsOrBuilder getIl4SettingsOrBuilder(); + + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the cjisSettings field is set. + */ + boolean hasCjisSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The cjisSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings getCjisSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for CJIS.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettingsOrBuilder + getCjisSettingsOrBuilder(); + + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampHighSettings field is set. + */ + boolean hasFedrampHighSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampHighSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings getFedrampHighSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettingsOrBuilder + getFedrampHighSettingsOrBuilder(); + + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the fedrampModerateSettings field is set. + */ + boolean hasFedrampModerateSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fedrampModerateSettings. + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + getFedrampModerateSettings(); + /** + * + * + *
+   * Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettingsOrBuilder + getFedrampModerateSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. ETag of the workload, it is calculated on the basis
+   * of the Workload contents. It will be used in Update & Delete operations.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. ETag of the workload, it is calculated on the basis
+   * of the Workload contents. It will be used in Update & Delete operations.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Labels applied to the workload.
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegimeSettingsCase + getComplianceRegimeSettingsCase(); +} diff --git a/proto-google-cloud-assured-workloads-v1beta1/src/main/proto/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/proto-google-cloud-assured-workloads-v1beta1/src/main/proto/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto new file mode 100644 index 00000000..b610d2e0 --- /dev/null +++ b/proto-google-cloud-assured-workloads-v1beta1/src/main/proto/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -0,0 +1,403 @@ +// 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.assuredworkloads.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads"; +option java_multiple_files = true; +option java_outer_classname = "AssuredworkloadsProto"; +option java_package = "com.google.cloud.assuredworkloads.v1beta1"; +option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1beta1"; +option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1"; +option (google.api.resource_definition) = { + type: "assuredworkloads.googleapis.com/Location" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service to manage AssuredWorkloads. +service AssuredWorkloadsService { + option (google.api.default_host) = "assuredworkloads.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates Assured Workload. + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + body: "workload" + }; + option (google.api.method_signature) = "parent,workload"; + option (google.longrunning.operation_info) = { + response_type: "Workload" + metadata_type: "CreateWorkloadOperationMetadata" + }; + } + + // Updates an existing workload. + // Currently allows updating of workload display_name and labels. + // For force updates don't set etag field in the Workload. + // Only one update operation per workload can be in progress. + rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { + option (google.api.http) = { + patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" + body: "workload" + }; + option (google.api.method_signature) = "workload,update_mask"; + } + + // Deletes the workload. Make sure that workload's direct children are already + // in a deleted state, otherwise the request will fail with a + // FAILED_PRECONDITION error. + rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets Assured Workload associated with a CRM Node + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Assured Workloads under a CRM Node. + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for creating a workload. +message CreateWorkloadRequest { + // Required. The resource name of the new Workload's parent. + // Must be of the form `organizations/{org_id}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Required. Assured Workload to create + Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value + // provided for the identifier will add a label to the workload and contained + // projects with the identifier as the value. + string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for Updating a workload. +message UpdateWorkloadRequest { + // Required. The workload to update. + // The workload’s `name` field is used to identify the workload to be updated. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for deleting a Workload. +message DeleteWorkloadRequest { + // Required. The `name` field is used to identify the workload. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Optional. The etag of the workload. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for fetching a workload. +message GetWorkloadRequest { + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; +} + +// Request for fetching workloads in an organization. +message ListWorkloadsRequest { + // Required. Parent Resource to list workloads from. + // Must be of the form `organizations/{org_id}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token returned from previous request. Page token contains context from + // previous request. Page token needs to be passed in the second and following + // requests. + string page_token = 3; + + // A custom filter for filtering by properties of a workload. At this time, + // only filtering by labels is supported. + string filter = 4; +} + +// Response of ListWorkloads endpoint. +message ListWorkloadsResponse { + // List of Workloads under a given parent. + repeated Workload workloads = 1; + + // The next page token. Return empty if reached the last page. + string next_page_token = 2; +} + +// An Workload object for managing highly regulated workloads of cloud +// customers. +message Workload { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}" + }; + + // Represent the resources that are children of this Workload. + message ResourceInfo { + // The type of resource. + enum ResourceType { + // Unknown resource type. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Consumer project. + CONSUMER_PROJECT = 1; + + // Consumer project containing encryption keys. + ENCRYPTION_KEYS_PROJECT = 2; + } + + // Resource identifier. + // For a project this represents project_number. + int64 resource_id = 1; + + // Indicates the type of resource. + ResourceType resource_type = 2; + } + + // Settings specific to the Key Management Service. + message KMSSettings { + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. + google.protobuf.Timestamp next_rotation_time = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. + google.protobuf.Duration rotation_period = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for IL4. + message IL4Settings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for CJIS. + message CJISSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP High. + message FedrampHighSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP Moderate. + message FedrampModerateSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + } + + // Optional. The resource name of the workload. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload} + // + // Read-only. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The user-assigned display name of the Workload. + // When present it must be between 4 to 30 characters. + // Allowed characters are: lowercase and uppercase letters, numbers, + // hyphen, single-quote, double-quote, space, and exclamation point. + // + // Example: My Workload + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The resources associated with this workload. + // These resources will be created when creating the workload. + // If any of the projects already exist, the workload creation will fail. + // Always read only. + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Compliance Regime associated with this workload. + ComplianceRegime compliance_regime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. The Workload creation timestamp. + google.protobuf.Timestamp create_time = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. The billing account used for the resources which are + // direct children of workload. This billing account is initially associated + // with the resources created as part of Workload creation. + // After the initial creation of these resources, the customer can change + // the assigned billing account. + // The resource name has the form + // `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF`. + string billing_account = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Settings specific to the selected [compliance_regime] + oneof compliance_regime_settings { + // Required. Input only. Immutable. Settings specific to resources needed for IL4. + IL4Settings il4_settings = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for CJIS. + CJISSettings cjis_settings = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High. + FedrampHighSettings fedramp_high_settings = 11 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + FedrampModerateSettings fedramp_moderate_settings = 12 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Optional. ETag of the workload, it is calculated on the basis + // of the Workload contents. It will be used in Update & Delete operations. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels applied to the workload. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Operation metadata to give request details of CreateWorkload. +message CreateWorkloadOperationMetadata { + // Optional. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The display name of the workload. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The parent of the workload. + string parent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..767c4dce --- /dev/null +++ b/renovate.json @@ -0,0 +1,81 @@ +{ + "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-assured-workloads", + "^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, + "masterIssue": 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..5c0c787d --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + assured-workloads-install-without-bom + jar + Google Assured Workloads for Government Install Without Bom + https://github.com/googleapis/java-assured-workloads + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-assured-workloads + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.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..8faa95b5 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-assured-workloads-samples + 0.0.1-SNAPSHOT + pom + Google Assured Workloads for Government Samples Parent + https://github.com/googleapis/java-assured-workloads + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 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..14b0fa6e --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + assured-workloads-snapshot + jar + Google Assured Workloads for Government Snapshot Samples + https://github.com/googleapis/java-assured-workloads + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-assured-workloads + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.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..6b54854b --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + assured-workloads-snippets + jar + Google Assured Workloads for Government Snippets + https://github.com/googleapis/java-assured-workloads + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-assured-workloads + 0.0.0 + + + + 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..676e8bc3 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,134 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "sha": "a6770519ed78c87df27e39e8573ea75582d48ece" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "8d370db1a5c7f48f5baca6bf1ead32993398b0cd", + "internalRef": "331868116" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "assuredworkloads", + "apiVersion": "v1beta1", + "language": "java", + "generator": "bazel" + } + } + ], + "generatedFiles": [ + ".github/CODEOWNERS", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/trusted-contribution.yml", + ".github/workflows/ci.yaml", + ".github/workflows/samples.yaml", + ".kokoro/build.bat", + ".kokoro/build.sh", + ".kokoro/coerce_logs.sh", + ".kokoro/common.cfg", + ".kokoro/common.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/java8.cfg", + ".kokoro/dependencies.sh", + ".kokoro/linkage-monitor.sh", + ".kokoro/nightly/common.cfg", + ".kokoro/nightly/integration.cfg", + ".kokoro/nightly/java11.cfg", + ".kokoro/nightly/java7.cfg", + ".kokoro/nightly/java8-osx.cfg", + ".kokoro/nightly/java8-win.cfg", + ".kokoro/nightly/java8.cfg", + ".kokoro/nightly/samples.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/clirr.cfg", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/dependencies.cfg", + ".kokoro/presubmit/integration.cfg", + ".kokoro/presubmit/java11.cfg", + ".kokoro/presubmit/java7.cfg", + ".kokoro/presubmit/java8-osx.cfg", + ".kokoro/presubmit/java8-win.cfg", + ".kokoro/presubmit/java8.cfg", + ".kokoro/presubmit/linkage-monitor.cfg", + ".kokoro/presubmit/lint.cfg", + ".kokoro/presubmit/samples.cfg", + ".kokoro/release/bump_snapshot.cfg", + ".kokoro/release/common.cfg", + ".kokoro/release/common.sh", + ".kokoro/release/drop.cfg", + ".kokoro/release/drop.sh", + ".kokoro/release/promote.cfg", + ".kokoro/release/promote.sh", + ".kokoro/release/publish_javadoc.cfg", + ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/snapshot.cfg", + ".kokoro/release/snapshot.sh", + ".kokoro/release/stage.cfg", + ".kokoro/release/stage.sh", + ".kokoro/trampoline.sh", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "codecov.yaml", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClient.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceSettings.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/package-info.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStub.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/AssuredWorkloadsServiceStubSettings.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceCallableFactory.java", + "google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1beta1/stub/GrpcAssuredWorkloadsServiceStub.java", + "google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceClientTest.java", + "google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsService.java", + "google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1beta1/MockAssuredWorkloadsServiceImpl.java", + "grpc-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredWorkloadsServiceGrpc.java", + "java.header", + "license-checks.xml", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AssuredworkloadsProto.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadataOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequestOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequestOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequestOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequestOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponseOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/LocationName.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequestOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadName.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/WorkloadOrBuilder.java", + "proto-google-cloud-assured-workloads-v1beta1/src/main/proto/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", + "renovate.json", + "samples/install-without-bom/pom.xml", + "samples/pom.xml", + "samples/snapshot/pom.xml", + "samples/snippets/pom.xml" + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..f953dfd6 --- /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 = 'assuredworkloads' +versions = ['v1beta1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/assuredworkloads/{version}', + bazel_target=f'//google/cloud/assuredworkloads/{version}:google-cloud-{service}-{version}-java', + destination_name='assured-workloads', + ) + +java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..d1f4f779 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-assured-workloads:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-assured-workloads-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-assured-workloads-v1beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file