diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml deleted file mode 100644 index 5ff6c87c..00000000 --- a/.github/.OwlBot.lock.yaml +++ /dev/null @@ -1,3 +0,0 @@ -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:13b7387edb404234610d30473ac48210ae7fe42a136335ee2b2f8a07c4c7f6a5 diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index 21a244ba..00000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# 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. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" - -deep-remove-regex: -- "/grpc-google-.*/src" -- "/proto-google-.*/src" -- "/google-.*/src" - -deep-copy-regex: -- source: "/google/cloud/binaryauthorization/(v.*)/.*-java/proto-google-.*/src" - dest: "/owl-bot-staging/$1/proto-google-cloud-binary-authorization-$1/src" -- source: "/google/cloud/binaryauthorization/(v.*)/.*-java/grpc-google-.*/src" - dest: "/owl-bot-staging/$1/grpc-google-cloud-binary-authorization-$1/src" -- source: "/google/cloud/binaryauthorization/(v.*)/.*-java/gapic-google-.*/src" - dest: "/owl-bot-staging/$1/google-cloud-binary-authorization/src" \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 30fdb7b9..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# 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 - -* @googleapis/yoshi-java - -# 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 deleted file mode 100644 index d7580dac..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -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-binary-authorization/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. binary-authorization 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 deleted file mode 100644 index 754e30c6..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -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 deleted file mode 100644 index 99586903..00000000 --- a/.github/ISSUE_TEMPLATE/support_request.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -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 deleted file mode 100644 index d392928e..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ -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-binary-authorization/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/blunderbuss.yml b/.github/blunderbuss.yml deleted file mode 100644 index 2176b054..00000000 --- a/.github/blunderbuss.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss -assign_prs_by: -- labels: - - samples - to: - - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml deleted file mode 100644 index c644a24e..00000000 --- a/.github/generated-files-bot.yml +++ /dev/null @@ -1,12 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index d4ca9418..15010af9 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ enabled: true +multiScmName: java-binary-authorization diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml deleted file mode 100644 index 6f09d695..00000000 --- a/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,42 +0,0 @@ -rebaseMergeAllowed: false -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: java7 - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor -permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml deleted file mode 100644 index a0ba1f7d..00000000 --- a/.github/trusted-contribution.yml +++ /dev/null @@ -1,3 +0,0 @@ -trustedContributors: -- renovate-bot -- gcf-owl-bot[bot] diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml deleted file mode 100644 index 7513acae..00000000 --- a/.github/workflows/approve-readme.yaml +++ /dev/null @@ -1,54 +0,0 @@ -on: - pull_request: -name: auto-merge-readme -jobs: - approve: - runs-on: ubuntu-latest - if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' - steps: - - uses: actions/github-script@v3 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - script: | - // only approve PRs from yoshi-automation - if (context.payload.pull_request.user.login !== "yoshi-automation") { - return; - } - - // only approve PRs like "chore: release " - if (!context.payload.pull_request.title === "chore: regenerate README") { - return; - } - - // only approve PRs with README.md and synth.metadata changes - const files = new Set( - ( - await github.paginate( - github.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }) - ) - ).map(file => file.filename) - ); - if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { - return; - } - - // approve README regeneration PR - await github.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped PR!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach automerge label - await github.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['automerge'] - }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml deleted file mode 100644 index 9b4fd4d8..00000000 --- a/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,88 +0,0 @@ -on: - pull_request: -name: auto-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v3 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - debug: true - script: | - // only approve PRs from release-please[bot] - if (context.payload.pull_request.user.login !== "release-please[bot]") { - return; - } - - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }); - const changed_files = await github.paginate(filesPromise) - - if ( changed_files.length < 1 ) { - console.log( "Not proceeding since PR is empty!" ) - return; - } - - if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { - console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) - return; - } - - // trigger auto-release when - // 1) it is a SNAPSHOT release (auto-generated post regular release) - // 2) there are dependency updates only - // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) - if ( - context.payload.pull_request.body.includes("Fix") || - context.payload.pull_request.body.includes("Build") || - context.payload.pull_request.body.includes("Documentation") || - context.payload.pull_request.body.includes("BREAKING CHANGES") || - context.payload.pull_request.body.includes("Features") - ) { - console.log( "Not auto-releasing since it is not a dependency-update-only release." ); - return; - } - - const promise = github.pulls.list.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - const open_pulls = await github.paginate(promise) - - if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { - for ( const pull of open_pulls ) { - if ( pull.title.startsWith("deps: update dependency") ) { - console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); - return; - } - } - } - - // approve release PR - await github.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped release!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach kokoro:force-run and automerge labels - await github.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['kokoro:force-run', 'automerge'] - }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 2425d723..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,86 +0,0 @@ -on: - push: - branches: - - main - pull_request: -name: ci -jobs: - units: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: test - windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test - dependencies: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v2 - with: - distribution: zulu - 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: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml deleted file mode 100644 index c46230a7..00000000 --- a/.github/workflows/samples.yaml +++ /dev/null @@ -1,14 +0,0 @@ -on: - pull_request: -name: samples -jobs: - checkstyle: - 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 deleted file mode 100644 index 069d08fc..00000000 --- a/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Maven -target/ - -# Eclipse -.classpath -.project -.settings - -# Intellij -*.iml -.idea/ - -# python utilities -*.pyc -__pycache__ - -.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat deleted file mode 100644 index 05826ad9..00000000 --- a/.kokoro/build.bat +++ /dev/null @@ -1,3 +0,0 @@ -:: 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 deleted file mode 100755 index 01b016df..00000000 --- a/.kokoro/build.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/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 Maven & Java version -mvn -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 -ntp \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# if GOOGLE_APPLICATION_CREDENTIALS 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} \ - -ntp \ - -Penable-integration-tests \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; -samples) - SAMPLES_DIR=samples - # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. - if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] - then - SAMPLES_DIR=samples/snapshot - fi - - if [[ -f ${SAMPLES_DIR}/pom.xml ]] - then - for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do - [[ -f "$FILE" ]] || continue - source "$FILE" - done - - pushd ${SAMPLES_DIR} - mvn -B \ - -Penable-samples \ - -ntp \ - -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_FLAKYBOT}" == "true" ]] -then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot - ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-binary-authorization -fi - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh deleted file mode 100755 index 46edbf7f..00000000 --- a/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/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 - 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 deleted file mode 100644 index 42c6b5c1..00000000 --- a/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# 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-binary-authorization/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/build.sh" -} diff --git a/.kokoro/common.sh b/.kokoro/common.sh deleted file mode 100644 index ace89f45..00000000 --- a/.kokoro/common.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/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 - ${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 deleted file mode 100644 index 5f5d8564..00000000 --- a/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# 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-binary-authorization/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# 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 deleted file mode 100755 index 9a5105d7..00000000 --- a/.kokoro/dependencies.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/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 -shopt -s nullglob - -## 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 - -function determineMavenOpts() { - local javaVersion=$( - # filter down to the version line, then pull out the version between quotes, - # then trim the version number down to its minimal number (removing any - # update or suffix number). - java -version 2>&1 | grep "version" \ - | sed -E 's/^.*"(.*?)".*$/\1/g' \ - | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' - ) - - case $javaVersion in - "17") - # MaxPermSize is no longer supported as of jdk 17 - echo -n "-Xmx1024m" - ;; - *) - echo -n "-Xmx1024m -XX:MaxPermSize=128m" - ;; - esac -} - -export MAVEN_OPTS=$(determineMavenOpts) - -# this should run maven enforcer -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dmaven.javadoc.skip=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/ --.*//' >.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 **/.flattened-pom.xml -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg deleted file mode 100644 index 5f5d8564..00000000 --- a/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# 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-binary-authorization/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg deleted file mode 100644 index e51c7b4c..00000000 --- a/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# 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_FLAKYBOT" - 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 deleted file mode 100644 index 709f2b4c..00000000 --- a/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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 deleted file mode 100644 index cb24f44e..00000000 --- a/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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 deleted file mode 100644 index cb766dbe..00000000 --- a/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-binary-authorization/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index ca60e33b..00000000 --- a/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-binary-authorization/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# 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 deleted file mode 100644 index 9761fd86..00000000 --- a/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# 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_FLAKYBOT" - value: "true" -} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh deleted file mode 100755 index f5251425..00000000 --- a/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/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 deleted file mode 100644 index ec572442..00000000 --- a/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# 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 deleted file mode 100644 index e58f7a4d..00000000 --- a/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# 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-binary-authorization/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.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 deleted file mode 100644 index 58c93201..00000000 --- a/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# 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-binary-authorization/.kokoro/dependencies.sh" -} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9..00000000 --- a/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 709f2b4c..00000000 --- a/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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 deleted file mode 100644 index cb24f44e..00000000 --- a/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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 deleted file mode 100644 index cb766dbe..00000000 --- a/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-binary-authorization/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index ca60e33b..00000000 --- a/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-binary-authorization/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# 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 deleted file mode 100644 index 4c4a0971..00000000 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# 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-binary-authorization/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8a..00000000 --- a/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# 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 deleted file mode 100644 index 01e09600..00000000 --- a/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# 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/readme.sh b/.kokoro/readme.sh deleted file mode 100755 index a0a6e060..00000000 --- a/.kokoro/readme.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/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 - -cd ${KOKORO_ARTIFACTS_DIR}/github/java-binary-authorization - -# Disable buffering, so that the logs stream through. -export PYTHONUNBUFFERED=1 - -# Kokoro exposes this as a file, but the scripts expect just a plain variable. -export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) - -# Setup git credentials -echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials -git config --global credential.helper 'store --file ~/.git-credentials' - -python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool - -set +e -python3.6 -m autosynth.synth \ - --repository=googleapis/java-binary-authorization \ - --synth-file-name=.github/readme/synth.py \ - --metadata-path=.github/readme/synth.metadata \ - --pr-title="chore: regenerate README" \ - --branch-suffix="readme" - -# autosynth returns 28 to signal there are no changes -RETURN_CODE=$? -if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] -then - exit ${RETURN_CODE} -fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index 726dcdac..00000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# 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-binary-authorization/.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-binary-authorization/.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 deleted file mode 100644 index 8a423de1..00000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# 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-binary-authorization/.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 deleted file mode 100755 index 7f78ee41..00000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 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 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 deleted file mode 100644 index 0c53e2c0..00000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index 742ec1a8..00000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 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 - -# 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 deleted file mode 100644 index 5dd5fc4d..00000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 3cac3d8a..00000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 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 - -# 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 deleted file mode 100644 index b6345fd8..00000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# 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: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.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 deleted file mode 100755 index 1c3669e8..00000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-binary-authorization -export 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} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 04a7beac..00000000 --- a/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index b08ffaab..00000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# 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_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 - -export NAME=google-cloud-binary-authorization -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# V3 generates docfx yml from javadoc -# generate yml -mvn clean site -B -q -P docFX - -# copy README to docfx-yml dir and rename index.md -cp README.md target/docfx-yml/index.md -# copy CHANGELOG to docfx-yml dir and rename history.md -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index 5871ccab..00000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 1f55b770..00000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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 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 deleted file mode 100644 index 909ebce4..00000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-binary-authorization/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-binary-authorization/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-binary-authorization" - } -} - -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 deleted file mode 100755 index 77dc4e8f..00000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2018 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 - -# 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 -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" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean 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 deleted file mode 100644 index 8b69b793..00000000 --- a/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 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 -# 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 deleted file mode 100644 index 120a761a..00000000 --- a/.repo-metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "binary-authorization", - "name_pretty": "Binary Authorization", - "product_documentation": "https://cloud.google.com/binary-authorization/docs", - "api_description": " is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and Anthos clusters on VMware", - "client_documentation": "https://googleapis.dev/java/google-cloud-binary-authorization/latest/index.html", - "release_level": "beta", - "transport": "grpc", - "language": "java", - "repo": "googleapis/java-binary-authorization", - "repo_short": "java-binary-authorization", - "distribution_name": "com.google.cloud:google-cloud-binary-authorization", - "api_id": "binary-authorization.googleapis.com", - "requires_billing": true, - "library_type": "GAPIC_AUTO" -} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e1e93252..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,89 +0,0 @@ -# Changelog - -### [0.3.2](https://www.github.com/googleapis/java-binary-authorization/compare/v0.3.1...v0.3.2) (2021-09-22) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#87](https://www.github.com/googleapis/java-binary-authorization/issues/87)) ([e801b46](https://www.github.com/googleapis/java-binary-authorization/commit/e801b46bc4862105f99ae95424fe393fb08e9a61)) - -### [0.3.1](https://www.github.com/googleapis/java-binary-authorization/compare/v0.3.0...v0.3.1) (2021-09-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#80](https://www.github.com/googleapis/java-binary-authorization/issues/80)) ([9043edc](https://www.github.com/googleapis/java-binary-authorization/commit/9043edc5244823b6b6dacd38e5f346cdc963cf5d)) - -## [0.3.0](https://www.github.com/googleapis/java-binary-authorization/compare/v0.2.2...v0.3.0) (2021-09-10) - - -### Features - -* Remove use of deprecated gradle command in java README ([#1196](https://www.github.com/googleapis/java-binary-authorization/issues/1196)) ([#65](https://www.github.com/googleapis/java-binary-authorization/issues/65)) ([8cb0da3](https://www.github.com/googleapis/java-binary-authorization/commit/8cb0da37f9c387a79c9255bca3402ec22643ded8)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#69](https://www.github.com/googleapis/java-binary-authorization/issues/69)) ([4843a90](https://www.github.com/googleapis/java-binary-authorization/commit/4843a904a0e402ed6ae9677e940faec9f1d1f71e)) - -### [0.2.2](https://www.github.com/googleapis/java-binary-authorization/compare/v0.2.1...v0.2.2) (2021-08-23) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#59](https://www.github.com/googleapis/java-binary-authorization/issues/59)) ([4a04949](https://www.github.com/googleapis/java-binary-authorization/commit/4a04949edb28e1db63b565d07b30d2308d2ad4f2)) - -### [0.2.1](https://www.github.com/googleapis/java-binary-authorization/compare/v0.2.0...v0.2.1) (2021-08-12) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#53](https://www.github.com/googleapis/java-binary-authorization/issues/53)) ([dfdd993](https://www.github.com/googleapis/java-binary-authorization/commit/dfdd9932eee97318d4aa74b45106b83faedd323f)) - -## [0.2.0](https://www.github.com/googleapis/java-binary-authorization/compare/v0.1.1...v0.2.0) (2021-08-09) - - -### ⚠ BREAKING CHANGES - -* release gapic-generator-java v2.0.0 (#47) - -### Features - -* release gapic-generator-java v2.0.0 ([#47](https://www.github.com/googleapis/java-binary-authorization/issues/47)) ([6e8fd4b](https://www.github.com/googleapis/java-binary-authorization/commit/6e8fd4b1fb93b8075af8c2536655e7d213c1622a)) - - -### Bug Fixes - -* Add `shopt -s nullglob` to dependencies script ([#1130](https://www.github.com/googleapis/java-binary-authorization/issues/1130)) ([#26](https://www.github.com/googleapis/java-binary-authorization/issues/26)) ([0b7ea96](https://www.github.com/googleapis/java-binary-authorization/commit/0b7ea968aedb1824a84e1a9abd35feae17ee3b3b)) -* owlbot post-processor should generate README ([#1154](https://www.github.com/googleapis/java-binary-authorization/issues/1154)) ([#31](https://www.github.com/googleapis/java-binary-authorization/issues/31)) ([d40ffa2](https://www.github.com/googleapis/java-binary-authorization/commit/d40ffa289be02aa3e6bcfe9c50d688e2905addd1)), closes [#1146](https://www.github.com/googleapis/java-binary-authorization/issues/1146) [#1147](https://www.github.com/googleapis/java-binary-authorization/issues/1147) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#28](https://www.github.com/googleapis/java-binary-authorization/issues/28)) ([4dda105](https://www.github.com/googleapis/java-binary-authorization/commit/4dda105fe56704810a5157afd17af47aadb4e67e)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#48](https://www.github.com/googleapis/java-binary-authorization/issues/48)) ([c069652](https://www.github.com/googleapis/java-binary-authorization/commit/c06965200207f3784ff1517c8e5da7275649d254)) - - -### Documentation - -* Replace "global policy" with "system policy" in Binary Authorization documentation ([#45](https://www.github.com/googleapis/java-binary-authorization/issues/45)) ([7ee7f88](https://www.github.com/googleapis/java-binary-authorization/commit/7ee7f88b06bd51c018f7e43b28b415b069d92ccd)) - -### [0.1.1](https://www.github.com/googleapis/java-binary-authorization/compare/v0.1.0...v0.1.1) (2021-06-09) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#16](https://www.github.com/googleapis/java-binary-authorization/issues/16)) ([5221465](https://www.github.com/googleapis/java-binary-authorization/commit/522146545b9f56a65a87a282f7bb057c626a6b47)) - -## 0.1.0 (2021-06-03) - - -### Features - -* initial generation ([24afde1](https://www.github.com/googleapis/java-binary-authorization/commit/24afde139af21fbe16d6b8ebe949ab3b3dfd66d5)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#8](https://www.github.com/googleapis/java-binary-authorization/issues/8)) ([b041dc9](https://www.github.com/googleapis/java-binary-authorization/commit/b041dc9dec1919fabb3110a6480543f6dbf3c0b6)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#10](https://www.github.com/googleapis/java-binary-authorization/issues/10)) ([4ae303c](https://www.github.com/googleapis/java-binary-authorization/commit/4ae303c0e43747dc6dcc2619b82b7889d8dd9028)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2dbdee0..b65dd279 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,12 +53,12 @@ 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`. +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. 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 +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. 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. @@ -68,39 +68,16 @@ The samples must be separate from the primary project for a few reasons: ### Building ```bash -mvn -Penable-samples clean verify +mvn 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 +mvn 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 @@ -110,30 +87,6 @@ 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 +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/README.md b/README.md index dd3a8c10..dccfa613 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,14 @@ Java idiomatic client for [Binary Authorization][product-docs]. - [Product Documentation][product-docs] - [Client Library Documentation][javadocs] -> Note: This client is a work-in-progress, and may occasionally -> make backwards-incompatible changes. +:bus: In October 2022, this library has moved to +[google-cloud-java/java-binary-authorization]( +https://github.com/googleapis/google-cloud-java/tree/main/java-binary-authorization). +This repository will be archived in the future. +Future releases will appear in the new repository (https://github.com/googleapis/google-cloud-java/releases). +The Maven artifact coordinates (`com.google.cloud:google-cloud-binary-authorization`) remain the same. +Sample code is in https://github.com/GoogleCloudPlatform/java-docs-samples. ## Quickstart @@ -22,20 +27,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-binary-authorization - 0.3.1 + 1.4.0 ``` -If you are using Gradle without BOM, add this to your dependencies +If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-binary-authorization:0.3.1' +implementation 'com.google.cloud:google-cloud-binary-authorization:1.4.0' ``` -If you are using SBT, add this to your dependencies +If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-binary-authorization" % "0.3.1" +libraryDependencies += "com.google.cloud" % "google-cloud-binary-authorization" % "1.4.0" ``` ## Authentication @@ -84,7 +89,7 @@ Binary Authorization uses gRPC for the transport layer. ## Supported Java Versions -Java 7 or above is required for using this client. +Java 8 or above is required for using this client. Google's Java client libraries, [Google Cloud Client Libraries][cloudlibs] @@ -132,9 +137,6 @@ and on [google-cloud-java][g-c-j]. 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 @@ -156,7 +158,6 @@ Apache 2.0 - See [LICENSE][license] for more information. 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] @@ -165,7 +166,7 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/binary-authorization/docs -[javadocs]: https://googleapis.dev/java/google-cloud-binary-authorization/latest/index.html +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-binary-authorization/latest/history [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java7.svg [kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java7.html [kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java8.svg @@ -176,7 +177,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java8-win.html [kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java11.svg [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-binary-authorization/java11.html -[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-binary-authorization.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-binary-authorization&core=gav [authentication]: https://github.com/googleapis/google-cloud-java#authentication diff --git a/codecov.yaml b/codecov.yaml deleted file mode 100644 index 5724ea94..00000000 --- a/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/google-cloud-binary-authorization-bom/pom.xml b/google-cloud-binary-authorization-bom/pom.xml deleted file mode 100644 index dcec3b04..00000000 --- a/google-cloud-binary-authorization-bom/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-binary-authorization-bom - 0.3.3-SNAPSHOT - pom - - com.google.cloud - google-cloud-shared-config - 1.0.3 - - - Google Binary Authorization BOM - https://github.com/googleapis/java-binary-authorization - - BOM for Binary Authorization - - - - Google LLC - - - - - chingor13 - Jeff Ching - chingor@google.com - Google LLC - - Developer - - - - - - scm:git:https://github.com/googleapis/java-binary-authorization.git - scm:git:git@github.com:googleapis/java-binary-authorization.git - https://github.com/googleapis/java-binary-authorization - - - - true - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - - com.google.cloud - google-cloud-binary-authorization - 0.3.3-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - - - - diff --git a/google-cloud-binary-authorization/pom.xml b/google-cloud-binary-authorization/pom.xml deleted file mode 100644 index a32c1737..00000000 --- a/google-cloud-binary-authorization/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-binary-authorization - 0.3.3-SNAPSHOT - jar - Google Binary Authorization - https://github.com/googleapis/java-binary-authorization - Binary Authorization is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and Anthos clusters on VMware - - com.google.cloud - google-cloud-binary-authorization-parent - 0.3.3-SNAPSHOT - - - google-cloud-binary-authorization - - - - 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-binary-authorization-v1beta1 - - - com.google.guava - guava - - - com.google.api - gax - - - com.google.api - gax-grpc - - - org.threeten - threetenbp - - - - - junit - junit - test - 4.13.2 - - - - com.google.api.grpc - grpc-google-cloud-binary-authorization-v1beta1 - test - - - - com.google.api - gax-grpc - testlib - test - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java deleted file mode 100644 index 99b13ea5..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java +++ /dev/null @@ -1,1043 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1Stub; -import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1StubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Google Cloud Management Service for Binary Authorization admission policies - * and attestation authorities. - * - *

This API implements a REST model with the following objects: - * - *

    - *
  • [Policy][google.cloud.binaryauthorization.v1beta1.Policy] - *
  • [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor] - *
- * - *

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: - * - *

{@code
- * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
- *     BinauthzManagementServiceV1Beta1Client.create()) {
- *   PolicyName name = PolicyName.of("[PROJECT]");
- *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
- * }
- * }
- * - *

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

To customize credentials: - * - *

{@code
- * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
- *     BinauthzManagementServiceV1Beta1Settings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
- *     BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
- *     BinauthzManagementServiceV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
- * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
- *     BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class BinauthzManagementServiceV1Beta1Client implements BackgroundResource { - private final BinauthzManagementServiceV1Beta1Settings settings; - private final BinauthzManagementServiceV1Beta1Stub stub; - - /** Constructs an instance of BinauthzManagementServiceV1Beta1Client with default settings. */ - public static final BinauthzManagementServiceV1Beta1Client create() throws IOException { - return create(BinauthzManagementServiceV1Beta1Settings.newBuilder().build()); - } - - /** - * Constructs an instance of BinauthzManagementServiceV1Beta1Client, 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 BinauthzManagementServiceV1Beta1Client create( - BinauthzManagementServiceV1Beta1Settings settings) throws IOException { - return new BinauthzManagementServiceV1Beta1Client(settings); - } - - /** - * Constructs an instance of BinauthzManagementServiceV1Beta1Client, using the given stub for - * making calls. This is for advanced usage - prefer using - * create(BinauthzManagementServiceV1Beta1Settings). - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final BinauthzManagementServiceV1Beta1Client create( - BinauthzManagementServiceV1Beta1Stub stub) { - return new BinauthzManagementServiceV1Beta1Client(stub); - } - - /** - * Constructs an instance of BinauthzManagementServiceV1Beta1Client, 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 BinauthzManagementServiceV1Beta1Client( - BinauthzManagementServiceV1Beta1Settings settings) throws IOException { - this.settings = settings; - this.stub = - ((BinauthzManagementServiceV1Beta1StubSettings) settings.getStubSettings()).createStub(); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Stub stub) { - this.settings = null; - this.stub = stub; - } - - public final BinauthzManagementServiceV1Beta1Settings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public BinauthzManagementServiceV1Beta1Stub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to a container - * image, before the project is allowed to deploy that image. There is at most one policy per - * project. All image admission requests are permitted if a project has no policy. - * - *

Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns - * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not - * have one. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   PolicyName name = PolicyName.of("[PROJECT]");
-   *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
-   * }
-   * }
- * - * @param name Required. The resource name of the - * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format - * `projects/*/policy`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getPolicy(PolicyName name) { - GetPolicyRequest request = - GetPolicyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to a container - * image, before the project is allowed to deploy that image. There is at most one policy per - * project. All image admission requests are permitted if a project has no policy. - * - *

Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns - * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not - * have one. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   String name = PolicyName.of("[PROJECT]").toString();
-   *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
-   * }
-   * }
- * - * @param name Required. The resource name of the - * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format - * `projects/*/policy`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getPolicy(String name) { - GetPolicyRequest request = GetPolicyRequest.newBuilder().setName(name).build(); - return getPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to a container - * image, before the project is allowed to deploy that image. There is at most one policy per - * project. All image admission requests are permitted if a project has no policy. - * - *

Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns - * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not - * have one. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   GetPolicyRequest request =
-   *       GetPolicyRequest.newBuilder().setName(PolicyName.of("[PROJECT]").toString()).build();
-   *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(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 Policy getPolicy(GetPolicyRequest request) { - return getPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to a container - * image, before the project is allowed to deploy that image. There is at most one policy per - * project. All image admission requests are permitted if a project has no policy. - * - *

Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns - * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not - * have one. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   GetPolicyRequest request =
-   *       GetPolicyRequest.newBuilder().setName(PolicyName.of("[PROJECT]").toString()).build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.getPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getPolicyCallable() { - return stub.getPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and - * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy - * is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or - * management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the - * request is malformed. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(policy);
-   * }
-   * }
- * - * @param policy Required. A new or updated - * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will overwrite - * the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the - * resource name in the request URL, in the format `projects/*/policy`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy updatePolicy(Policy policy) { - UpdatePolicyRequest request = UpdatePolicyRequest.newBuilder().setPolicy(policy).build(); - return updatePolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and - * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy - * is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or - * management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the - * request is malformed. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   UpdatePolicyRequest request =
-   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
-   *   Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(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 Policy updatePolicy(UpdatePolicyRequest request) { - return updatePolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and - * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy - * is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or - * management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the - * request is malformed. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   UpdatePolicyRequest request =
-   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.updatePolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updatePolicyCallable() { - return stub.updatePolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of - * the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   String attestorId = "attestorId2055733027";
-   *   Attestor attestor = Attestor.newBuilder().build();
-   *   Attestor response =
-   *       binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor);
-   * }
-   * }
- * - * @param parent Required. The parent of this - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] - * ID. - * @param attestor Required. The initial - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field - * with the resource name, in the format `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Attestor createAttestor(ProjectName parent, String attestorId, Attestor attestor) { - CreateAttestorRequest request = - CreateAttestorRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setAttestorId(attestorId) - .setAttestor(attestor) - .build(); - return createAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of - * the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   String attestorId = "attestorId2055733027";
-   *   Attestor attestor = Attestor.newBuilder().build();
-   *   Attestor response =
-   *       binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor);
-   * }
-   * }
- * - * @param parent Required. The parent of this - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] - * ID. - * @param attestor Required. The initial - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field - * with the resource name, in the format `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Attestor createAttestor(String parent, String attestorId, Attestor attestor) { - CreateAttestorRequest request = - CreateAttestorRequest.newBuilder() - .setParent(parent) - .setAttestorId(attestorId) - .setAttestor(attestor) - .build(); - return createAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of - * the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   CreateAttestorRequest request =
-   *       CreateAttestorRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setAttestorId("attestorId2055733027")
-   *           .setAttestor(Attestor.newBuilder().build())
-   *           .build();
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.createAttestor(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 Attestor createAttestor(CreateAttestorRequest request) { - return createAttestorCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of - * the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   CreateAttestorRequest request =
-   *       CreateAttestorRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setAttestorId("attestorId2055733027")
-   *           .setAttestor(Attestor.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.createAttestorCallable().futureCall(request);
-   *   // Do something.
-   *   Attestor response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createAttestorCallable() { - return stub.createAttestorCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
-   * }
-   * }
- * - * @param name Required. The name of the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Attestor getAttestor(AttestorName name) { - GetAttestorRequest request = - GetAttestorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
-   * }
-   * }
- * - * @param name Required. The name of the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Attestor getAttestor(String name) { - GetAttestorRequest request = GetAttestorRequest.newBuilder().setName(name).build(); - return getAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   GetAttestorRequest request =
-   *       GetAttestorRequest.newBuilder()
-   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
-   *           .build();
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(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 Attestor getAttestor(GetAttestorRequest request) { - return getAttestorCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   GetAttestorRequest request =
-   *       GetAttestorRequest.newBuilder()
-   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.getAttestorCallable().futureCall(request);
-   *   // Do something.
-   *   Attestor response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getAttestorCallable() { - return stub.getAttestorCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   Attestor attestor = Attestor.newBuilder().build();
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(attestor);
-   * }
-   * }
- * - * @param attestor Required. The updated - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field - * with the resource name in the request URL, in the format `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Attestor updateAttestor(Attestor attestor) { - UpdateAttestorRequest request = - UpdateAttestorRequest.newBuilder().setAttestor(attestor).build(); - return updateAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   UpdateAttestorRequest request =
-   *       UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
-   *   Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(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 Attestor updateAttestor(UpdateAttestorRequest request) { - return updateAttestorCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   UpdateAttestorRequest request =
-   *       UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.updateAttestorCallable().futureCall(request);
-   *   // Do something.
-   *   Attestor response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateAttestorCallable() { - return stub.updateAttestorCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT - * if the project does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   for (Attestor element :
-   *       binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format - * `projects/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListAttestorsPagedResponse listAttestors(ProjectName parent) { - ListAttestorsRequest request = - ListAttestorsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listAttestors(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT - * if the project does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   for (Attestor element :
-   *       binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format - * `projects/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListAttestorsPagedResponse listAttestors(String parent) { - ListAttestorsRequest request = ListAttestorsRequest.newBuilder().setParent(parent).build(); - return listAttestors(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT - * if the project does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   ListAttestorsRequest request =
-   *       ListAttestorsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Attestor element :
-   *       binauthzManagementServiceV1Beta1Client.listAttestors(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 ListAttestorsPagedResponse listAttestors(ListAttestorsRequest request) { - return listAttestorsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT - * if the project does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   ListAttestorsRequest request =
-   *       ListAttestorsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.listAttestorsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Attestor element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listAttestorsPagedCallable() { - return stub.listAttestorsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT - * if the project does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   ListAttestorsRequest request =
-   *       ListAttestorsRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListAttestorsResponse response =
-   *         binauthzManagementServiceV1Beta1Client.listAttestorsCallable().call(request);
-   *     for (Attestor element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listAttestorsCallable() { - return stub.listAttestorsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
-   *   binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
-   * }
-   * }
- * - * @param name Required. The name of the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteAttestor(AttestorName name) { - DeleteAttestorRequest request = - DeleteAttestorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
-   *   binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
-   * }
-   * }
- * - * @param name Required. The name of the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteAttestor(String name) { - DeleteAttestorRequest request = DeleteAttestorRequest.newBuilder().setName(name).build(); - deleteAttestor(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   DeleteAttestorRequest request =
-   *       DeleteAttestorRequest.newBuilder()
-   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
-   *           .build();
-   *   binauthzManagementServiceV1Beta1Client.deleteAttestor(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 deleteAttestor(DeleteAttestorRequest request) { - deleteAttestorCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if - * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - *

Sample code: - * - *

{@code
-   * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
-   *     BinauthzManagementServiceV1Beta1Client.create()) {
-   *   DeleteAttestorRequest request =
-   *       DeleteAttestorRequest.newBuilder()
-   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       binauthzManagementServiceV1Beta1Client.deleteAttestorCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteAttestorCallable() { - return stub.deleteAttestorCallable(); - } - - @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 ListAttestorsPagedResponse - extends AbstractPagedListResponse< - ListAttestorsRequest, - ListAttestorsResponse, - Attestor, - ListAttestorsPage, - ListAttestorsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListAttestorsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListAttestorsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListAttestorsPagedResponse(ListAttestorsPage page) { - super(page, ListAttestorsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListAttestorsPage - extends AbstractPage< - ListAttestorsRequest, ListAttestorsResponse, Attestor, ListAttestorsPage> { - - private ListAttestorsPage( - PageContext context, - ListAttestorsResponse response) { - super(context, response); - } - - private static ListAttestorsPage createEmptyPage() { - return new ListAttestorsPage(null, null); - } - - @Override - protected ListAttestorsPage createPage( - PageContext context, - ListAttestorsResponse response) { - return new ListAttestorsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListAttestorsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListAttestorsRequest, - ListAttestorsResponse, - Attestor, - ListAttestorsPage, - ListAttestorsFixedSizeCollection> { - - private ListAttestorsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListAttestorsFixedSizeCollection createEmptyCollection() { - return new ListAttestorsFixedSizeCollection(null, 0); - } - - @Override - protected ListAttestorsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListAttestorsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java deleted file mode 100644 index a088c822..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1; - -import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1StubSettings; -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 BinauthzManagementServiceV1Beta1Client}. - * - *

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

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

{@code
- * BinauthzManagementServiceV1Beta1Settings.Builder
- *     binauthzManagementServiceV1Beta1SettingsBuilder =
- *         BinauthzManagementServiceV1Beta1Settings.newBuilder();
- * binauthzManagementServiceV1Beta1SettingsBuilder
- *     .getPolicySettings()
- *     .setRetrySettings(
- *         binauthzManagementServiceV1Beta1SettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
- *     binauthzManagementServiceV1Beta1SettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class BinauthzManagementServiceV1Beta1Settings - extends ClientSettings { - - /** Returns the object with the settings used for calls to getPolicy. */ - public UnaryCallSettings getPolicySettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()).getPolicySettings(); - } - - /** Returns the object with the settings used for calls to updatePolicy. */ - public UnaryCallSettings updatePolicySettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()) - .updatePolicySettings(); - } - - /** Returns the object with the settings used for calls to createAttestor. */ - public UnaryCallSettings createAttestorSettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()) - .createAttestorSettings(); - } - - /** Returns the object with the settings used for calls to getAttestor. */ - public UnaryCallSettings getAttestorSettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()).getAttestorSettings(); - } - - /** Returns the object with the settings used for calls to updateAttestor. */ - public UnaryCallSettings updateAttestorSettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()) - .updateAttestorSettings(); - } - - /** Returns the object with the settings used for calls to listAttestors. */ - public PagedCallSettings - listAttestorsSettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()) - .listAttestorsSettings(); - } - - /** Returns the object with the settings used for calls to deleteAttestor. */ - public UnaryCallSettings deleteAttestorSettings() { - return ((BinauthzManagementServiceV1Beta1StubSettings) getStubSettings()) - .deleteAttestorSettings(); - } - - public static final BinauthzManagementServiceV1Beta1Settings create( - BinauthzManagementServiceV1Beta1StubSettings stub) throws IOException { - return new BinauthzManagementServiceV1Beta1Settings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return BinauthzManagementServiceV1Beta1StubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return BinauthzManagementServiceV1Beta1StubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return BinauthzManagementServiceV1Beta1StubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return BinauthzManagementServiceV1Beta1StubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return BinauthzManagementServiceV1Beta1StubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return BinauthzManagementServiceV1Beta1StubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return BinauthzManagementServiceV1Beta1StubSettings.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 BinauthzManagementServiceV1Beta1Settings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for BinauthzManagementServiceV1Beta1Settings. */ - public static class Builder - extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(BinauthzManagementServiceV1Beta1StubSettings.newBuilder(clientContext)); - } - - protected Builder(BinauthzManagementServiceV1Beta1Settings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(BinauthzManagementServiceV1Beta1StubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(BinauthzManagementServiceV1Beta1StubSettings.newBuilder()); - } - - public BinauthzManagementServiceV1Beta1StubSettings.Builder getStubSettingsBuilder() { - return ((BinauthzManagementServiceV1Beta1StubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to getPolicy. */ - public UnaryCallSettings.Builder getPolicySettings() { - return getStubSettingsBuilder().getPolicySettings(); - } - - /** Returns the builder for the settings used for calls to updatePolicy. */ - public UnaryCallSettings.Builder updatePolicySettings() { - return getStubSettingsBuilder().updatePolicySettings(); - } - - /** Returns the builder for the settings used for calls to createAttestor. */ - public UnaryCallSettings.Builder createAttestorSettings() { - return getStubSettingsBuilder().createAttestorSettings(); - } - - /** Returns the builder for the settings used for calls to getAttestor. */ - public UnaryCallSettings.Builder getAttestorSettings() { - return getStubSettingsBuilder().getAttestorSettings(); - } - - /** Returns the builder for the settings used for calls to updateAttestor. */ - public UnaryCallSettings.Builder updateAttestorSettings() { - return getStubSettingsBuilder().updateAttestorSettings(); - } - - /** Returns the builder for the settings used for calls to listAttestors. */ - public PagedCallSettings.Builder< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse> - listAttestorsSettings() { - return getStubSettingsBuilder().listAttestorsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteAttestor. */ - public UnaryCallSettings.Builder deleteAttestorSettings() { - return getStubSettingsBuilder().deleteAttestorSettings(); - } - - @Override - public BinauthzManagementServiceV1Beta1Settings build() throws IOException { - return new BinauthzManagementServiceV1Beta1Settings(this); - } - } -} diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/gapic_metadata.json b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/gapic_metadata.json deleted file mode 100644 index 50e7b6d0..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.cloud.binaryauthorization.v1beta1", - "libraryPackage": "com.google.cloud.binaryauthorization.v1beta1", - "services": { - "BinauthzManagementServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "BinauthzManagementServiceV1Beta1Client", - "rpcs": { - "CreateAttestor": { - "methods": ["createAttestor", "createAttestor", "createAttestor", "createAttestorCallable"] - }, - "DeleteAttestor": { - "methods": ["deleteAttestor", "deleteAttestor", "deleteAttestor", "deleteAttestorCallable"] - }, - "GetAttestor": { - "methods": ["getAttestor", "getAttestor", "getAttestor", "getAttestorCallable"] - }, - "GetPolicy": { - "methods": ["getPolicy", "getPolicy", "getPolicy", "getPolicyCallable"] - }, - "ListAttestors": { - "methods": ["listAttestors", "listAttestors", "listAttestors", "listAttestorsPagedCallable", "listAttestorsCallable"] - }, - "UpdateAttestor": { - "methods": ["updateAttestor", "updateAttestor", "updateAttestorCallable"] - }, - "UpdatePolicy": { - "methods": ["updatePolicy", "updatePolicy", "updatePolicyCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/package-info.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/package-info.java deleted file mode 100644 index 44e936c3..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/package-info.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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. - */ - -/** - * The interfaces provided are listed below, along with usage samples. - * - *

======================= BinauthzManagementServiceV1Beta1Client ======================= - * - *

Service Description: Google Cloud Management Service for Binary Authorization admission - * policies and attestation authorities. - * - *

This API implements a REST model with the following objects: - * - *

    - *
  • [Policy][google.cloud.binaryauthorization.v1beta1.Policy] - *
  • [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor] - *
- * - *

Sample for BinauthzManagementServiceV1Beta1Client: - * - *

{@code
- * try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
- *     BinauthzManagementServiceV1Beta1Client.create()) {
- *   PolicyName name = PolicyName.of("[PROJECT]");
- *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.binaryauthorization.v1beta1; - -import javax.annotation.Generated; diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1Stub.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1Stub.java deleted file mode 100644 index f597a924..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1Stub.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1.stub; - -import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.binaryauthorization.v1beta1.Attestor; -import com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse; -import com.google.cloud.binaryauthorization.v1beta1.Policy; -import com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest; -import com.google.protobuf.Empty; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the BinauthzManagementServiceV1Beta1 service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class BinauthzManagementServiceV1Beta1Stub implements BackgroundResource { - - public UnaryCallable getPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getPolicyCallable()"); - } - - public UnaryCallable updatePolicyCallable() { - throw new UnsupportedOperationException("Not implemented: updatePolicyCallable()"); - } - - public UnaryCallable createAttestorCallable() { - throw new UnsupportedOperationException("Not implemented: createAttestorCallable()"); - } - - public UnaryCallable getAttestorCallable() { - throw new UnsupportedOperationException("Not implemented: getAttestorCallable()"); - } - - public UnaryCallable updateAttestorCallable() { - throw new UnsupportedOperationException("Not implemented: updateAttestorCallable()"); - } - - public UnaryCallable - listAttestorsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listAttestorsPagedCallable()"); - } - - public UnaryCallable listAttestorsCallable() { - throw new UnsupportedOperationException("Not implemented: listAttestorsCallable()"); - } - - public UnaryCallable deleteAttestorCallable() { - throw new UnsupportedOperationException("Not implemented: deleteAttestorCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java deleted file mode 100644 index 0a2c0f4c..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1.stub; - -import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.binaryauthorization.v1beta1.Attestor; -import com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse; -import com.google.cloud.binaryauthorization.v1beta1.Policy; -import com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link BinauthzManagementServiceV1Beta1Stub}. - * - *

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

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

{@code
- * BinauthzManagementServiceV1Beta1StubSettings.Builder
- *     binauthzManagementServiceV1Beta1SettingsBuilder =
- *         BinauthzManagementServiceV1Beta1StubSettings.newBuilder();
- * binauthzManagementServiceV1Beta1SettingsBuilder
- *     .getPolicySettings()
- *     .setRetrySettings(
- *         binauthzManagementServiceV1Beta1SettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * BinauthzManagementServiceV1Beta1StubSettings binauthzManagementServiceV1Beta1Settings =
- *     binauthzManagementServiceV1Beta1SettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class BinauthzManagementServiceV1Beta1StubSettings - 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 getPolicySettings; - private final UnaryCallSettings updatePolicySettings; - private final UnaryCallSettings createAttestorSettings; - private final UnaryCallSettings getAttestorSettings; - private final UnaryCallSettings updateAttestorSettings; - private final PagedCallSettings< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse> - listAttestorsSettings; - private final UnaryCallSettings deleteAttestorSettings; - - private static final PagedListDescriptor - LIST_ATTESTORS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListAttestorsRequest injectToken(ListAttestorsRequest payload, String token) { - return ListAttestorsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListAttestorsRequest injectPageSize(ListAttestorsRequest payload, int pageSize) { - return ListAttestorsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListAttestorsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListAttestorsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListAttestorsResponse payload) { - return payload.getAttestorsList() == null - ? ImmutableList.of() - : payload.getAttestorsList(); - } - }; - - private static final PagedListResponseFactory< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse> - LIST_ATTESTORS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListAttestorsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ATTESTORS_PAGE_STR_DESC, request, context); - return ListAttestorsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to getPolicy. */ - public UnaryCallSettings getPolicySettings() { - return getPolicySettings; - } - - /** Returns the object with the settings used for calls to updatePolicy. */ - public UnaryCallSettings updatePolicySettings() { - return updatePolicySettings; - } - - /** Returns the object with the settings used for calls to createAttestor. */ - public UnaryCallSettings createAttestorSettings() { - return createAttestorSettings; - } - - /** Returns the object with the settings used for calls to getAttestor. */ - public UnaryCallSettings getAttestorSettings() { - return getAttestorSettings; - } - - /** Returns the object with the settings used for calls to updateAttestor. */ - public UnaryCallSettings updateAttestorSettings() { - return updateAttestorSettings; - } - - /** Returns the object with the settings used for calls to listAttestors. */ - public PagedCallSettings - listAttestorsSettings() { - return listAttestorsSettings; - } - - /** Returns the object with the settings used for calls to deleteAttestor. */ - public UnaryCallSettings deleteAttestorSettings() { - return deleteAttestorSettings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public BinauthzManagementServiceV1Beta1Stub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcBinauthzManagementServiceV1Beta1Stub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", 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 "binaryauthorization.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "binaryauthorization.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** 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(BinauthzManagementServiceV1Beta1StubSettings.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 BinauthzManagementServiceV1Beta1StubSettings(Builder settingsBuilder) - throws IOException { - super(settingsBuilder); - - getPolicySettings = settingsBuilder.getPolicySettings().build(); - updatePolicySettings = settingsBuilder.updatePolicySettings().build(); - createAttestorSettings = settingsBuilder.createAttestorSettings().build(); - getAttestorSettings = settingsBuilder.getAttestorSettings().build(); - updateAttestorSettings = settingsBuilder.updateAttestorSettings().build(); - listAttestorsSettings = settingsBuilder.listAttestorsSettings().build(); - deleteAttestorSettings = settingsBuilder.deleteAttestorSettings().build(); - } - - /** Builder for BinauthzManagementServiceV1Beta1StubSettings. */ - public static class Builder - extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder getPolicySettings; - private final UnaryCallSettings.Builder updatePolicySettings; - private final UnaryCallSettings.Builder createAttestorSettings; - private final UnaryCallSettings.Builder getAttestorSettings; - private final UnaryCallSettings.Builder updateAttestorSettings; - private final PagedCallSettings.Builder< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse> - listAttestorsSettings; - private final UnaryCallSettings.Builder deleteAttestorSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - 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(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(600000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(600000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(600000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(600000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - getPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updatePolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createAttestorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getAttestorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateAttestorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listAttestorsSettings = PagedCallSettings.newBuilder(LIST_ATTESTORS_PAGE_STR_FACT); - deleteAttestorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - getPolicySettings, - updatePolicySettings, - createAttestorSettings, - getAttestorSettings, - updateAttestorSettings, - listAttestorsSettings, - deleteAttestorSettings); - initDefaults(this); - } - - protected Builder(BinauthzManagementServiceV1Beta1StubSettings settings) { - super(settings); - - getPolicySettings = settings.getPolicySettings.toBuilder(); - updatePolicySettings = settings.updatePolicySettings.toBuilder(); - createAttestorSettings = settings.createAttestorSettings.toBuilder(); - getAttestorSettings = settings.getAttestorSettings.toBuilder(); - updateAttestorSettings = settings.updateAttestorSettings.toBuilder(); - listAttestorsSettings = settings.listAttestorsSettings.toBuilder(); - deleteAttestorSettings = settings.deleteAttestorSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - getPolicySettings, - updatePolicySettings, - createAttestorSettings, - getAttestorSettings, - updateAttestorSettings, - listAttestorsSettings, - deleteAttestorSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .getPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updatePolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .createAttestorSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - builder - .getAttestorSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updateAttestorSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .listAttestorsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .deleteAttestorSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to getPolicy. */ - public UnaryCallSettings.Builder getPolicySettings() { - return getPolicySettings; - } - - /** Returns the builder for the settings used for calls to updatePolicy. */ - public UnaryCallSettings.Builder updatePolicySettings() { - return updatePolicySettings; - } - - /** Returns the builder for the settings used for calls to createAttestor. */ - public UnaryCallSettings.Builder createAttestorSettings() { - return createAttestorSettings; - } - - /** Returns the builder for the settings used for calls to getAttestor. */ - public UnaryCallSettings.Builder getAttestorSettings() { - return getAttestorSettings; - } - - /** Returns the builder for the settings used for calls to updateAttestor. */ - public UnaryCallSettings.Builder updateAttestorSettings() { - return updateAttestorSettings; - } - - /** Returns the builder for the settings used for calls to listAttestors. */ - public PagedCallSettings.Builder< - ListAttestorsRequest, ListAttestorsResponse, ListAttestorsPagedResponse> - listAttestorsSettings() { - return listAttestorsSettings; - } - - /** Returns the builder for the settings used for calls to deleteAttestor. */ - public UnaryCallSettings.Builder deleteAttestorSettings() { - return deleteAttestorSettings; - } - - @Override - public BinauthzManagementServiceV1Beta1StubSettings build() throws IOException { - return new BinauthzManagementServiceV1Beta1StubSettings(this); - } - } -} diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1CallableFactory.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1CallableFactory.java deleted file mode 100644 index ae2d9046..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1CallableFactory.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the BinauthzManagementServiceV1Beta1 service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcBinauthzManagementServiceV1Beta1CallableFactory - 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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1Stub.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1Stub.java deleted file mode 100644 index 1a27b55a..00000000 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/GrpcBinauthzManagementServiceV1Beta1Stub.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1.stub; - -import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse; - -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.UnaryCallable; -import com.google.cloud.binaryauthorization.v1beta1.Attestor; -import com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest; -import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse; -import com.google.cloud.binaryauthorization.v1beta1.Policy; -import com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest; -import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest; -import com.google.common.collect.ImmutableMap; -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.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the BinauthzManagementServiceV1Beta1 service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcBinauthzManagementServiceV1Beta1Stub extends BinauthzManagementServiceV1Beta1Stub { - private static final MethodDescriptor getPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updatePolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy") - .setRequestMarshaller(ProtoUtils.marshaller(UpdatePolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createAttestorMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateAttestorRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Attestor.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getAttestorMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor") - .setRequestMarshaller(ProtoUtils.marshaller(GetAttestorRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Attestor.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateAttestorMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateAttestorRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Attestor.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listAttestorsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors") - .setRequestMarshaller( - ProtoUtils.marshaller(ListAttestorsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListAttestorsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteAttestorMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteAttestorRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private final UnaryCallable getPolicyCallable; - private final UnaryCallable updatePolicyCallable; - private final UnaryCallable createAttestorCallable; - private final UnaryCallable getAttestorCallable; - private final UnaryCallable updateAttestorCallable; - private final UnaryCallable listAttestorsCallable; - private final UnaryCallable - listAttestorsPagedCallable; - private final UnaryCallable deleteAttestorCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcBinauthzManagementServiceV1Beta1Stub create( - BinauthzManagementServiceV1Beta1StubSettings settings) throws IOException { - return new GrpcBinauthzManagementServiceV1Beta1Stub(settings, ClientContext.create(settings)); - } - - public static final GrpcBinauthzManagementServiceV1Beta1Stub create(ClientContext clientContext) - throws IOException { - return new GrpcBinauthzManagementServiceV1Beta1Stub( - BinauthzManagementServiceV1Beta1StubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcBinauthzManagementServiceV1Beta1Stub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcBinauthzManagementServiceV1Beta1Stub( - BinauthzManagementServiceV1Beta1StubSettings.newBuilder().build(), - clientContext, - callableFactory); - } - - /** - * Constructs an instance of GrpcBinauthzManagementServiceV1Beta1Stub, 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 GrpcBinauthzManagementServiceV1Beta1Stub( - BinauthzManagementServiceV1Beta1StubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcBinauthzManagementServiceV1Beta1CallableFactory()); - } - - /** - * Constructs an instance of GrpcBinauthzManagementServiceV1Beta1Stub, 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 GrpcBinauthzManagementServiceV1Beta1Stub( - BinauthzManagementServiceV1Beta1StubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings getPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updatePolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updatePolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("policy.name", String.valueOf(request.getPolicy().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings createAttestorTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createAttestorMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getAttestorTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getAttestorMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateAttestorTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateAttestorMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("attestor.name", String.valueOf(request.getAttestor().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listAttestorsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listAttestorsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteAttestorTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteAttestorMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.getPolicyCallable = - callableFactory.createUnaryCallable( - getPolicyTransportSettings, settings.getPolicySettings(), clientContext); - this.updatePolicyCallable = - callableFactory.createUnaryCallable( - updatePolicyTransportSettings, settings.updatePolicySettings(), clientContext); - this.createAttestorCallable = - callableFactory.createUnaryCallable( - createAttestorTransportSettings, settings.createAttestorSettings(), clientContext); - this.getAttestorCallable = - callableFactory.createUnaryCallable( - getAttestorTransportSettings, settings.getAttestorSettings(), clientContext); - this.updateAttestorCallable = - callableFactory.createUnaryCallable( - updateAttestorTransportSettings, settings.updateAttestorSettings(), clientContext); - this.listAttestorsCallable = - callableFactory.createUnaryCallable( - listAttestorsTransportSettings, settings.listAttestorsSettings(), clientContext); - this.listAttestorsPagedCallable = - callableFactory.createPagedCallable( - listAttestorsTransportSettings, settings.listAttestorsSettings(), clientContext); - this.deleteAttestorCallable = - callableFactory.createUnaryCallable( - deleteAttestorTransportSettings, settings.deleteAttestorSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable getPolicyCallable() { - return getPolicyCallable; - } - - @Override - public UnaryCallable updatePolicyCallable() { - return updatePolicyCallable; - } - - @Override - public UnaryCallable createAttestorCallable() { - return createAttestorCallable; - } - - @Override - public UnaryCallable getAttestorCallable() { - return getAttestorCallable; - } - - @Override - public UnaryCallable updateAttestorCallable() { - return updateAttestorCallable; - } - - @Override - public UnaryCallable listAttestorsCallable() { - return listAttestorsCallable; - } - - @Override - public UnaryCallable - listAttestorsPagedCallable() { - return listAttestorsPagedCallable; - } - - @Override - public UnaryCallable deleteAttestorCallable() { - return deleteAttestorCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1ClientTest.java b/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1ClientTest.java deleted file mode 100644 index 6f97d6db..00000000 --- a/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1ClientTest.java +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1; - -import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.protobuf.Timestamp; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class BinauthzManagementServiceV1Beta1ClientTest { - private static MockBinauthzManagementServiceV1Beta1 mockBinauthzManagementServiceV1Beta1; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private BinauthzManagementServiceV1Beta1Client client; - - @BeforeClass - public static void startStaticServer() { - mockBinauthzManagementServiceV1Beta1 = new MockBinauthzManagementServiceV1Beta1(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList(mockBinauthzManagementServiceV1Beta1)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - BinauthzManagementServiceV1Beta1Settings settings = - BinauthzManagementServiceV1Beta1Settings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = BinauthzManagementServiceV1Beta1Client.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void getPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setName(PolicyName.of("[PROJECT]").toString()) - .setDescription("description-1724546052") - .addAllAdmissionWhitelistPatterns(new ArrayList()) - .putAllClusterAdmissionRules(new HashMap()) - .setDefaultAdmissionRule(AdmissionRule.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - PolicyName name = PolicyName.of("[PROJECT]"); - - Policy actualResponse = client.getPolicy(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPolicyRequest actualRequest = ((GetPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - PolicyName name = PolicyName.of("[PROJECT]"); - client.getPolicy(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setName(PolicyName.of("[PROJECT]").toString()) - .setDescription("description-1724546052") - .addAllAdmissionWhitelistPatterns(new ArrayList()) - .putAllClusterAdmissionRules(new HashMap()) - .setDefaultAdmissionRule(AdmissionRule.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - String name = "name3373707"; - - Policy actualResponse = client.getPolicy(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPolicyRequest actualRequest = ((GetPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPolicyExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - String name = "name3373707"; - client.getPolicy(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updatePolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setName(PolicyName.of("[PROJECT]").toString()) - .setDescription("description-1724546052") - .addAllAdmissionWhitelistPatterns(new ArrayList()) - .putAllClusterAdmissionRules(new HashMap()) - .setDefaultAdmissionRule(AdmissionRule.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - Policy policy = Policy.newBuilder().build(); - - Policy actualResponse = client.updatePolicy(policy); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdatePolicyRequest actualRequest = ((UpdatePolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(policy, actualRequest.getPolicy()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updatePolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - Policy policy = Policy.newBuilder().build(); - client.updatePolicy(policy); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createAttestorTest() throws Exception { - Attestor expectedResponse = - Attestor.newBuilder() - .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) - .setDescription("description-1724546052") - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - String attestorId = "attestorId2055733027"; - Attestor attestor = Attestor.newBuilder().build(); - - Attestor actualResponse = client.createAttestor(parent, attestorId, attestor); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateAttestorRequest actualRequest = ((CreateAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(attestorId, actualRequest.getAttestorId()); - Assert.assertEquals(attestor, actualRequest.getAttestor()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createAttestorExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - String attestorId = "attestorId2055733027"; - Attestor attestor = Attestor.newBuilder().build(); - client.createAttestor(parent, attestorId, attestor); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createAttestorTest2() throws Exception { - Attestor expectedResponse = - Attestor.newBuilder() - .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) - .setDescription("description-1724546052") - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - String parent = "parent-995424086"; - String attestorId = "attestorId2055733027"; - Attestor attestor = Attestor.newBuilder().build(); - - Attestor actualResponse = client.createAttestor(parent, attestorId, attestor); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateAttestorRequest actualRequest = ((CreateAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(attestorId, actualRequest.getAttestorId()); - Assert.assertEquals(attestor, actualRequest.getAttestor()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createAttestorExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - String parent = "parent-995424086"; - String attestorId = "attestorId2055733027"; - Attestor attestor = Attestor.newBuilder().build(); - client.createAttestor(parent, attestorId, attestor); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getAttestorTest() throws Exception { - Attestor expectedResponse = - Attestor.newBuilder() - .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) - .setDescription("description-1724546052") - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); - - Attestor actualResponse = client.getAttestor(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetAttestorRequest actualRequest = ((GetAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getAttestorExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); - client.getAttestor(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getAttestorTest2() throws Exception { - Attestor expectedResponse = - Attestor.newBuilder() - .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) - .setDescription("description-1724546052") - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - String name = "name3373707"; - - Attestor actualResponse = client.getAttestor(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetAttestorRequest actualRequest = ((GetAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getAttestorExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - String name = "name3373707"; - client.getAttestor(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateAttestorTest() throws Exception { - Attestor expectedResponse = - Attestor.newBuilder() - .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) - .setDescription("description-1724546052") - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - Attestor attestor = Attestor.newBuilder().build(); - - Attestor actualResponse = client.updateAttestor(attestor); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateAttestorRequest actualRequest = ((UpdateAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(attestor, actualRequest.getAttestor()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateAttestorExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - Attestor attestor = Attestor.newBuilder().build(); - client.updateAttestor(attestor); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listAttestorsTest() throws Exception { - Attestor responsesElement = Attestor.newBuilder().build(); - ListAttestorsResponse expectedResponse = - ListAttestorsResponse.newBuilder() - .setNextPageToken("") - .addAllAttestors(Arrays.asList(responsesElement)) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - - ListAttestorsPagedResponse pagedListResponse = client.listAttestors(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getAttestorsList().get(0), resources.get(0)); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListAttestorsRequest actualRequest = ((ListAttestorsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listAttestorsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - client.listAttestors(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listAttestorsTest2() throws Exception { - Attestor responsesElement = Attestor.newBuilder().build(); - ListAttestorsResponse expectedResponse = - ListAttestorsResponse.newBuilder() - .setNextPageToken("") - .addAllAttestors(Arrays.asList(responsesElement)) - .build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListAttestorsPagedResponse pagedListResponse = client.listAttestors(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getAttestorsList().get(0), resources.get(0)); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListAttestorsRequest actualRequest = ((ListAttestorsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listAttestorsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - String parent = "parent-995424086"; - client.listAttestors(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteAttestorTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); - - client.deleteAttestor(name); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteAttestorRequest actualRequest = ((DeleteAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteAttestorExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); - client.deleteAttestor(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteAttestorTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockBinauthzManagementServiceV1Beta1.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteAttestor(name); - - List actualRequests = mockBinauthzManagementServiceV1Beta1.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteAttestorRequest actualRequest = ((DeleteAttestorRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteAttestorExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockBinauthzManagementServiceV1Beta1.addException(exception); - - try { - String name = "name3373707"; - client.deleteAttestor(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1.java b/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1.java deleted file mode 100644 index 6eda6da5..00000000 --- a/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockBinauthzManagementServiceV1Beta1 implements MockGrpcService { - private final MockBinauthzManagementServiceV1Beta1Impl serviceImpl; - - public MockBinauthzManagementServiceV1Beta1() { - serviceImpl = new MockBinauthzManagementServiceV1Beta1Impl(); - } - - @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-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1Impl.java b/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1Impl.java deleted file mode 100644 index fae08155..00000000 --- a/google-cloud-binary-authorization/src/test/java/com/google/cloud/binaryauthorization/v1beta1/MockBinauthzManagementServiceV1Beta1Impl.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Grpc.BinauthzManagementServiceV1Beta1ImplBase; -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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockBinauthzManagementServiceV1Beta1Impl - extends BinauthzManagementServiceV1Beta1ImplBase { - private List requests; - private Queue responses; - - public MockBinauthzManagementServiceV1Beta1Impl() { - 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 getPolicy(GetPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updatePolicy(UpdatePolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdatePolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createAttestor( - CreateAttestorRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Attestor) { - requests.add(request); - responseObserver.onNext(((Attestor) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateAttestor, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Attestor.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getAttestor(GetAttestorRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Attestor) { - requests.add(request); - responseObserver.onNext(((Attestor) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetAttestor, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Attestor.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateAttestor( - UpdateAttestorRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Attestor) { - requests.add(request); - responseObserver.onNext(((Attestor) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateAttestor, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Attestor.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listAttestors( - ListAttestorsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListAttestorsResponse) { - requests.add(request); - responseObserver.onNext(((ListAttestorsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListAttestors, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListAttestorsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteAttestor( - DeleteAttestorRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteAttestor, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/grpc-google-cloud-binary-authorization-v1beta1/pom.xml b/grpc-google-cloud-binary-authorization-v1beta1/pom.xml deleted file mode 100644 index 2b39d0fb..00000000 --- a/grpc-google-cloud-binary-authorization-v1beta1/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - grpc-google-cloud-binary-authorization-v1beta1 - GRPC library for google-cloud-binary-authorization - - com.google.cloud - google-cloud-binary-authorization-parent - 0.3.3-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-binary-authorization-v1beta1 - - - com.google.guava - guava - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/grpc-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Grpc.java b/grpc-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Grpc.java deleted file mode 100644 index f190dd9e..00000000 --- a/grpc-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Grpc.java +++ /dev/null @@ -1,1250 +0,0 @@ -/* - * 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.binaryauthorization.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Google Cloud Management Service for Binary Authorization admission policies
- * and attestation authorities.
- * This API implements a REST model with the following objects:
- * * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
- * * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/binaryauthorization/v1beta1/service.proto") -public final class BinauthzManagementServiceV1Beta1Grpc { - - private BinauthzManagementServiceV1Beta1Grpc() {} - - public static final String SERVICE_NAME = - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getGetPolicyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicy", - requestType = com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.Policy.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getGetPolicyMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getGetPolicyMethod; - if ((getGetPolicyMethod = BinauthzManagementServiceV1Beta1Grpc.getGetPolicyMethod) == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getGetPolicyMethod = BinauthzManagementServiceV1Beta1Grpc.getGetPolicyMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getGetPolicyMethod = - getGetPolicyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.Policy - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier("GetPolicy")) - .build(); - } - } - } - return getGetPolicyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getUpdatePolicyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdatePolicy", - requestType = com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.Policy.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getUpdatePolicyMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy> - getUpdatePolicyMethod; - if ((getUpdatePolicyMethod = BinauthzManagementServiceV1Beta1Grpc.getUpdatePolicyMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getUpdatePolicyMethod = BinauthzManagementServiceV1Beta1Grpc.getUpdatePolicyMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getUpdatePolicyMethod = - getUpdatePolicyMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePolicy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.Policy - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "UpdatePolicy")) - .build(); - } - } - } - return getUpdatePolicyMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getCreateAttestorMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateAttestor", - requestType = com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.Attestor.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getCreateAttestorMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getCreateAttestorMethod; - if ((getCreateAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getCreateAttestorMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getCreateAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getCreateAttestorMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getCreateAttestorMethod = - getCreateAttestorMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAttestor")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.Attestor - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "CreateAttestor")) - .build(); - } - } - } - return getCreateAttestorMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getGetAttestorMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetAttestor", - requestType = com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.Attestor.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getGetAttestorMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getGetAttestorMethod; - if ((getGetAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getGetAttestorMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getGetAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getGetAttestorMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getGetAttestorMethod = - getGetAttestorMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAttestor")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.Attestor - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "GetAttestor")) - .build(); - } - } - } - return getGetAttestorMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getUpdateAttestorMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateAttestor", - requestType = com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.Attestor.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getUpdateAttestorMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getUpdateAttestorMethod; - if ((getUpdateAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getUpdateAttestorMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getUpdateAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getUpdateAttestorMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getUpdateAttestorMethod = - getUpdateAttestorMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateAttestor")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.Attestor - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "UpdateAttestor")) - .build(); - } - } - } - return getUpdateAttestorMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - getListAttestorsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListAttestors", - requestType = com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.class, - responseType = com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - getListAttestorsMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - getListAttestorsMethod; - if ((getListAttestorsMethod = BinauthzManagementServiceV1Beta1Grpc.getListAttestorsMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getListAttestorsMethod = BinauthzManagementServiceV1Beta1Grpc.getListAttestorsMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getListAttestorsMethod = - getListAttestorsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAttestors")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "ListAttestors")) - .build(); - } - } - } - return getListAttestorsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest, - com.google.protobuf.Empty> - getDeleteAttestorMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteAttestor", - requestType = com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest, - com.google.protobuf.Empty> - getDeleteAttestorMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest, - com.google.protobuf.Empty> - getDeleteAttestorMethod; - if ((getDeleteAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getDeleteAttestorMethod) - == null) { - synchronized (BinauthzManagementServiceV1Beta1Grpc.class) { - if ((getDeleteAttestorMethod = BinauthzManagementServiceV1Beta1Grpc.getDeleteAttestorMethod) - == null) { - BinauthzManagementServiceV1Beta1Grpc.getDeleteAttestorMethod = - getDeleteAttestorMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAttestor")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1MethodDescriptorSupplier( - "DeleteAttestor")) - .build(); - } - } - } - return getDeleteAttestorMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static BinauthzManagementServiceV1Beta1Stub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public BinauthzManagementServiceV1Beta1Stub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1Stub(channel, callOptions); - } - }; - return BinauthzManagementServiceV1Beta1Stub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static BinauthzManagementServiceV1Beta1BlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public BinauthzManagementServiceV1Beta1BlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1BlockingStub(channel, callOptions); - } - }; - return BinauthzManagementServiceV1Beta1BlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static BinauthzManagementServiceV1Beta1FutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public BinauthzManagementServiceV1Beta1FutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1FutureStub(channel, callOptions); - } - }; - return BinauthzManagementServiceV1Beta1FutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Google Cloud Management Service for Binary Authorization admission policies
-   * and attestation authorities.
-   * This API implements a REST model with the following objects:
-   * * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
-   * * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
-   * 
- */ - public abstract static class BinauthzManagementServiceV1Beta1ImplBase - implements io.grpc.BindableService { - - /** - * - * - *
-     * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must
-     * attest to a container image, before the project is allowed to deploy that
-     * image. There is at most one policy per project. All image admission
-     * requests are permitted if a project has no policy.
-     * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this
-     * project. Returns a default
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project
-     * does not have one.
-     * 
- */ - public void getPolicy( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates or updates a project's
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a
-     * copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy].
-     * A policy is always updated as a whole, to avoid race conditions with
-     * concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
-     * if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed.
-     * 
- */ - public void updatePolicy( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdatePolicyMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor],
-     * and returns a copy of the new
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns
-     * NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed, ALREADY_EXISTS if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already
-     * exists.
-     * 
- */ - public void createAttestor( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateAttestorMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void getAttestor( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetAttestorMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void updateAttestor( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateAttestorMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns INVALID_ARGUMENT if the project does not exist.
-     * 
- */ - public void listAttestors( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListAttestorsMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void deleteAttestor( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteAttestorMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy>( - this, METHODID_GET_POLICY))) - .addMethod( - getUpdatePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest, - com.google.cloud.binaryauthorization.v1beta1.Policy>( - this, METHODID_UPDATE_POLICY))) - .addMethod( - getCreateAttestorMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor>( - this, METHODID_CREATE_ATTESTOR))) - .addMethod( - getGetAttestorMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor>( - this, METHODID_GET_ATTESTOR))) - .addMethod( - getUpdateAttestorMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest, - com.google.cloud.binaryauthorization.v1beta1.Attestor>( - this, METHODID_UPDATE_ATTESTOR))) - .addMethod( - getListAttestorsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse>( - this, METHODID_LIST_ATTESTORS))) - .addMethod( - getDeleteAttestorMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_ATTESTOR))) - .build(); - } - } - - /** - * - * - *
-   * Google Cloud Management Service for Binary Authorization admission policies
-   * and attestation authorities.
-   * This API implements a REST model with the following objects:
-   * * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
-   * * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
-   * 
- */ - public static final class BinauthzManagementServiceV1Beta1Stub - extends io.grpc.stub.AbstractAsyncStub { - private BinauthzManagementServiceV1Beta1Stub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected BinauthzManagementServiceV1Beta1Stub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1Stub(channel, callOptions); - } - - /** - * - * - *
-     * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must
-     * attest to a container image, before the project is allowed to deploy that
-     * image. There is at most one policy per project. All image admission
-     * requests are permitted if a project has no policy.
-     * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this
-     * project. Returns a default
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project
-     * does not have one.
-     * 
- */ - public void getPolicy( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Creates or updates a project's
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a
-     * copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy].
-     * A policy is always updated as a whole, to avoid race conditions with
-     * concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
-     * if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed.
-     * 
- */ - public void updatePolicy( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor],
-     * and returns a copy of the new
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns
-     * NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed, ALREADY_EXISTS if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already
-     * exists.
-     * 
- */ - public void createAttestor( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateAttestorMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void getAttestor( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetAttestorMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void updateAttestor( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateAttestorMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns INVALID_ARGUMENT if the project does not exist.
-     * 
- */ - public void listAttestors( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListAttestorsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public void deleteAttestor( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteAttestorMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * - * - *
-   * Google Cloud Management Service for Binary Authorization admission policies
-   * and attestation authorities.
-   * This API implements a REST model with the following objects:
-   * * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
-   * * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
-   * 
- */ - public static final class BinauthzManagementServiceV1Beta1BlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private BinauthzManagementServiceV1Beta1BlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected BinauthzManagementServiceV1Beta1BlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1BlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must
-     * attest to a container image, before the project is allowed to deploy that
-     * image. There is at most one policy per project. All image admission
-     * requests are permitted if a project has no policy.
-     * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this
-     * project. Returns a default
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project
-     * does not have one.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.Policy getPolicy( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates or updates a project's
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a
-     * copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy].
-     * A policy is always updated as a whole, to avoid race conditions with
-     * concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
-     * if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.Policy updatePolicy( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor],
-     * and returns a copy of the new
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns
-     * NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed, ALREADY_EXISTS if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already
-     * exists.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor createAttestor( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateAttestorMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetAttestorMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor updateAttestor( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateAttestorMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns INVALID_ARGUMENT if the project does not exist.
-     * 
- */ - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse listAttestors( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListAttestorsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.protobuf.Empty deleteAttestor( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteAttestorMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Google Cloud Management Service for Binary Authorization admission policies
-   * and attestation authorities.
-   * This API implements a REST model with the following objects:
-   * * [Policy][google.cloud.binaryauthorization.v1beta1.Policy]
-   * * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor]
-   * 
- */ - public static final class BinauthzManagementServiceV1Beta1FutureStub - extends io.grpc.stub.AbstractFutureStub { - private BinauthzManagementServiceV1Beta1FutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected BinauthzManagementServiceV1Beta1FutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new BinauthzManagementServiceV1Beta1FutureStub(channel, callOptions); - } - - /** - * - * - *
-     * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must
-     * attest to a container image, before the project is allowed to deploy that
-     * image. There is at most one policy per project. All image admission
-     * requests are permitted if a project has no policy.
-     * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this
-     * project. Returns a default
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project
-     * does not have one.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.Policy> - getPolicy(com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates or updates a project's
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a
-     * copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy].
-     * A policy is always updated as a whole, to avoid race conditions with
-     * concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
-     * if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.Policy> - updatePolicy(com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor],
-     * and returns a copy of the new
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns
-     * NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
-     * malformed, ALREADY_EXISTS if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already
-     * exists.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.Attestor> - createAttestor(com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateAttestorMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.Attestor> - getAttestor(com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetAttestorMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.Attestor> - updateAttestor(com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateAttestorMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns INVALID_ARGUMENT if the project does not exist.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse> - listAttestors(com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListAttestorsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * Returns NOT_FOUND if the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not
-     * exist.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteAttestor(com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteAttestorMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_GET_POLICY = 0; - private static final int METHODID_UPDATE_POLICY = 1; - private static final int METHODID_CREATE_ATTESTOR = 2; - private static final int METHODID_GET_ATTESTOR = 3; - private static final int METHODID_UPDATE_ATTESTOR = 4; - private static final int METHODID_LIST_ATTESTORS = 5; - private static final int METHODID_DELETE_ATTESTOR = 6; - - 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 BinauthzManagementServiceV1Beta1ImplBase serviceImpl; - private final int methodId; - - MethodHandlers(BinauthzManagementServiceV1Beta1ImplBase 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_GET_POLICY: - serviceImpl.getPolicy( - (com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_UPDATE_POLICY: - serviceImpl.updatePolicy( - (com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_CREATE_ATTESTOR: - serviceImpl.createAttestor( - (com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_GET_ATTESTOR: - serviceImpl.getAttestor( - (com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_UPDATE_ATTESTOR: - serviceImpl.updateAttestor( - (com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LIST_ATTESTORS: - serviceImpl.listAttestors( - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse>) - responseObserver); - break; - case METHODID_DELETE_ATTESTOR: - serviceImpl.deleteAttestor( - (com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private abstract static class BinauthzManagementServiceV1Beta1BaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - BinauthzManagementServiceV1Beta1BaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("BinauthzManagementServiceV1Beta1"); - } - } - - private static final class BinauthzManagementServiceV1Beta1FileDescriptorSupplier - extends BinauthzManagementServiceV1Beta1BaseDescriptorSupplier { - BinauthzManagementServiceV1Beta1FileDescriptorSupplier() {} - } - - private static final class BinauthzManagementServiceV1Beta1MethodDescriptorSupplier - extends BinauthzManagementServiceV1Beta1BaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - BinauthzManagementServiceV1Beta1MethodDescriptorSupplier(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 (BinauthzManagementServiceV1Beta1Grpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor( - new BinauthzManagementServiceV1Beta1FileDescriptorSupplier()) - .addMethod(getGetPolicyMethod()) - .addMethod(getUpdatePolicyMethod()) - .addMethod(getCreateAttestorMethod()) - .addMethod(getGetAttestorMethod()) - .addMethod(getUpdateAttestorMethod()) - .addMethod(getListAttestorsMethod()) - .addMethod(getDeleteAttestorMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java.header b/java.header deleted file mode 100644 index d0970ba7..00000000 --- a/java.header +++ /dev/null @@ -1,15 +0,0 @@ -^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|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\.$ -^ \*/$ diff --git a/license-checks.xml b/license-checks.xml deleted file mode 100644 index 6597fced..00000000 --- a/license-checks.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/owlbot.py b/owlbot.py deleted file mode 100644 index 77243461..00000000 --- a/owlbot.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# 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. - -import synthtool as s -from synthtool.languages import java - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.move(library) - -s.remove_staging_dirs() -java.common_templates() \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 9cbcf990..00000000 --- a/pom.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-binary-authorization-parent - pom - 0.3.3-SNAPSHOT - Google Binary Authorization Parent - https://github.com/googleapis/java-binary-authorization - - Java idiomatic client for Google Cloud Platform services. - - - - com.google.cloud - google-cloud-shared-config - 1.0.3 - - - - - chingor - Jeff Ching - chingor@google.com - Google - - Developer - - - - - Google LLC - - - scm:git:git@github.com:googleapis/java-binary-authorization.git - scm:git:git@github.com:googleapis/java-binary-authorization.git - https://github.com/googleapis/java-binary-authorization - HEAD - - - https://github.com/googleapis/java-binary-authorization/issues - GitHub Issues - - - - Apache-2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - UTF-8 - UTF-8 - github - google-cloud-binary-authorization-parent - - - - - - com.google.cloud - google-cloud-binary-authorization - 0.3.3-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - - - - com.google.cloud - google-cloud-shared-dependencies - 2.3.0 - pom - import - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - org.objenesis:objenesis - javax.annotation:javax.annotation-api - - - - - - - - - google-cloud-binary-authorization - grpc-google-cloud-binary-authorization-v1beta1 - proto-google-cloud-binary-authorization-v1beta1 - google-cloud-binary-authorization-bom - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.1.2 - - - - 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.3.1 - - - html - - aggregate - javadoc - - - - - none - protected - true - ${project.build.directory}/javadoc - - - Test helpers packages - com.google.cloud.testing - - - SPI packages - com.google.cloud.spi* - - - - - https://grpc.io/grpc-java/javadoc/ - https://developers.google.com/protocol-buffers/docs/reference/java/ - https://googleapis.dev/java/google-auth-library/latest/ - https://googleapis.dev/java/gax/latest/ - https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ - - - - - - diff --git a/proto-google-cloud-binary-authorization-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-binary-authorization-v1beta1/clirr-ignored-differences.xml deleted file mode 100644 index 7563ed7e..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/clirr-ignored-differences.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 7012 - com/google/cloud/binaryauthorization/v1beta1/*OrBuilder - * get*(*) - - - 7012 - com/google/cloud/binaryauthorization/v1beta1/*OrBuilder - boolean contains*(*) - - - 7012 - com/google/cloud/binaryauthorization/v1beta1/*OrBuilder - boolean has*(*) - - diff --git a/proto-google-cloud-binary-authorization-v1beta1/pom.xml b/proto-google-cloud-binary-authorization-v1beta1/pom.xml deleted file mode 100644 index ebb64c35..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-binary-authorization-v1beta1 - 0.3.3-SNAPSHOT - proto-google-cloud-binary-authorization-v1beta1 - Proto library for google-cloud-binary-authorization - - com.google.cloud - google-cloud-binary-authorization-parent - 0.3.3-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 - - - - diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRule.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRule.java deleted file mode 100644 index efa1500c..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRule.java +++ /dev/null @@ -1,1544 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * An [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule]
- * specifies either that all container images used in a pod creation request
- * must be attested to by one or more
- * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod
- * creations will be allowed, or that all pod creations will be denied.
- * Images matching an [admission allowlist
- * pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
- * are exempted from admission rules and will never block a pod creation.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AdmissionRule} - */ -public final class AdmissionRule extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.AdmissionRule) - AdmissionRuleOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionRule.newBuilder() to construct. - private AdmissionRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionRule() { - evaluationMode_ = 0; - requireAttestationsBy_ = com.google.protobuf.LazyStringArrayList.EMPTY; - enforcementMode_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AdmissionRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionRule( - 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 8: - { - int rawValue = input.readEnum(); - - evaluationMode_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - requireAttestationsBy_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - requireAttestationsBy_.add(s); - break; - } - case 24: - { - int rawValue = input.readEnum(); - - enforcementMode_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - requireAttestationsBy_ = requireAttestationsBy_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.class, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder.class); - } - - /** Protobuf enum {@code google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode} */ - public enum EvaluationMode implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Do not use.
-     * 
- * - * EVALUATION_MODE_UNSPECIFIED = 0; - */ - EVALUATION_MODE_UNSPECIFIED(0), - /** - * - * - *
-     * This rule allows all all pod creations.
-     * 
- * - * ALWAYS_ALLOW = 1; - */ - ALWAYS_ALLOW(1), - /** - * - * - *
-     * This rule allows a pod creation if all the attestors listed in
-     * 'require_attestations_by' have valid attestations for all of the
-     * images in the pod spec.
-     * 
- * - * REQUIRE_ATTESTATION = 2; - */ - REQUIRE_ATTESTATION(2), - /** - * - * - *
-     * This rule denies all pod creations.
-     * 
- * - * ALWAYS_DENY = 3; - */ - ALWAYS_DENY(3), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Do not use.
-     * 
- * - * EVALUATION_MODE_UNSPECIFIED = 0; - */ - public static final int EVALUATION_MODE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * This rule allows all all pod creations.
-     * 
- * - * ALWAYS_ALLOW = 1; - */ - public static final int ALWAYS_ALLOW_VALUE = 1; - /** - * - * - *
-     * This rule allows a pod creation if all the attestors listed in
-     * 'require_attestations_by' have valid attestations for all of the
-     * images in the pod spec.
-     * 
- * - * REQUIRE_ATTESTATION = 2; - */ - public static final int REQUIRE_ATTESTATION_VALUE = 2; - /** - * - * - *
-     * This rule denies all pod creations.
-     * 
- * - * ALWAYS_DENY = 3; - */ - public static final int ALWAYS_DENY_VALUE = 3; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static EvaluationMode 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 EvaluationMode forNumber(int value) { - switch (value) { - case 0: - return EVALUATION_MODE_UNSPECIFIED; - case 1: - return ALWAYS_ALLOW; - case 2: - return REQUIRE_ATTESTATION; - case 3: - return ALWAYS_DENY; - 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 EvaluationMode findValueByNumber(int number) { - return EvaluationMode.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.binaryauthorization.v1beta1.AdmissionRule.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final EvaluationMode[] VALUES = values(); - - public static EvaluationMode 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 EvaluationMode(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode) - } - - /** - * - * - *
-   * Defines the possible actions when a pod creation is denied by an admission
-   * rule.
-   * 
- * - * Protobuf enum {@code google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode} - */ - public enum EnforcementMode implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Do not use.
-     * 
- * - * ENFORCEMENT_MODE_UNSPECIFIED = 0; - */ - ENFORCEMENT_MODE_UNSPECIFIED(0), - /** - * - * - *
-     * Enforce the admission rule by blocking the pod creation.
-     * 
- * - * ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - */ - ENFORCED_BLOCK_AND_AUDIT_LOG(1), - /** - * - * - *
-     * Dryrun mode: Audit logging only.  This will allow the pod creation as if
-     * the admission request had specified break-glass.
-     * 
- * - * DRYRUN_AUDIT_LOG_ONLY = 2; - */ - DRYRUN_AUDIT_LOG_ONLY(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Do not use.
-     * 
- * - * ENFORCEMENT_MODE_UNSPECIFIED = 0; - */ - public static final int ENFORCEMENT_MODE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Enforce the admission rule by blocking the pod creation.
-     * 
- * - * ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - */ - public static final int ENFORCED_BLOCK_AND_AUDIT_LOG_VALUE = 1; - /** - * - * - *
-     * Dryrun mode: Audit logging only.  This will allow the pod creation as if
-     * the admission request had specified break-glass.
-     * 
- * - * DRYRUN_AUDIT_LOG_ONLY = 2; - */ - public static final int DRYRUN_AUDIT_LOG_ONLY_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 EnforcementMode 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 EnforcementMode forNumber(int value) { - switch (value) { - case 0: - return ENFORCEMENT_MODE_UNSPECIFIED; - case 1: - return ENFORCED_BLOCK_AND_AUDIT_LOG; - case 2: - return DRYRUN_AUDIT_LOG_ONLY; - 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 EnforcementMode findValueByNumber(int number) { - return EnforcementMode.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.binaryauthorization.v1beta1.AdmissionRule.getDescriptor() - .getEnumTypes() - .get(1); - } - - private static final EnforcementMode[] VALUES = values(); - - public static EnforcementMode 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 EnforcementMode(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode) - } - - public static final int EVALUATION_MODE_FIELD_NUMBER = 1; - private int evaluationMode_; - /** - * - * - *
-   * Required. How this admission rule will be evaluated.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for evaluationMode. - */ - @java.lang.Override - public int getEvaluationModeValue() { - return evaluationMode_; - } - /** - * - * - *
-   * Required. How this admission rule will be evaluated.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The evaluationMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - getEvaluationMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode result = - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode.valueOf( - evaluationMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode.UNRECOGNIZED - : result; - } - - public static final int REQUIRE_ATTESTATIONS_BY_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList requireAttestationsBy_; - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return A list containing the requireAttestationsBy. - */ - public com.google.protobuf.ProtocolStringList getRequireAttestationsByList() { - return requireAttestationsBy_; - } - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The count of requireAttestationsBy. - */ - public int getRequireAttestationsByCount() { - return requireAttestationsBy_.size(); - } - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the element to return. - * @return The requireAttestationsBy at the given index. - */ - public java.lang.String getRequireAttestationsBy(int index) { - return requireAttestationsBy_.get(index); - } - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the value to return. - * @return The bytes of the requireAttestationsBy at the given index. - */ - public com.google.protobuf.ByteString getRequireAttestationsByBytes(int index) { - return requireAttestationsBy_.getByteString(index); - } - - public static final int ENFORCEMENT_MODE_FIELD_NUMBER = 3; - private int enforcementMode_; - /** - * - * - *
-   * Required. The action when a pod creation is denied by the admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for enforcementMode. - */ - @java.lang.Override - public int getEnforcementModeValue() { - return enforcementMode_; - } - /** - * - * - *
-   * Required. The action when a pod creation is denied by the admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enforcementMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - getEnforcementMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode result = - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode.valueOf( - enforcementMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode.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 (evaluationMode_ - != com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - .EVALUATION_MODE_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, evaluationMode_); - } - for (int i = 0; i < requireAttestationsBy_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 2, requireAttestationsBy_.getRaw(i)); - } - if (enforcementMode_ - != com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - .ENFORCEMENT_MODE_UNSPECIFIED - .getNumber()) { - output.writeEnum(3, enforcementMode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (evaluationMode_ - != com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - .EVALUATION_MODE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, evaluationMode_); - } - { - int dataSize = 0; - for (int i = 0; i < requireAttestationsBy_.size(); i++) { - dataSize += computeStringSizeNoTag(requireAttestationsBy_.getRaw(i)); - } - size += dataSize; - size += 1 * getRequireAttestationsByList().size(); - } - if (enforcementMode_ - != com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - .ENFORCEMENT_MODE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, enforcementMode_); - } - 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.binaryauthorization.v1beta1.AdmissionRule)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule other = - (com.google.cloud.binaryauthorization.v1beta1.AdmissionRule) obj; - - if (evaluationMode_ != other.evaluationMode_) return false; - if (!getRequireAttestationsByList().equals(other.getRequireAttestationsByList())) return false; - if (enforcementMode_ != other.enforcementMode_) 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) + EVALUATION_MODE_FIELD_NUMBER; - hash = (53 * hash) + evaluationMode_; - if (getRequireAttestationsByCount() > 0) { - hash = (37 * hash) + REQUIRE_ATTESTATIONS_BY_FIELD_NUMBER; - hash = (53 * hash) + getRequireAttestationsByList().hashCode(); - } - hash = (37 * hash) + ENFORCEMENT_MODE_FIELD_NUMBER; - hash = (53 * hash) + enforcementMode_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule 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.binaryauthorization.v1beta1.AdmissionRule parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule 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.binaryauthorization.v1beta1.AdmissionRule parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule 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.binaryauthorization.v1beta1.AdmissionRule parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule 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.binaryauthorization.v1beta1.AdmissionRule parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule 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.binaryauthorization.v1beta1.AdmissionRule 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 [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule]
-   * specifies either that all container images used in a pod creation request
-   * must be attested to by one or more
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod
-   * creations will be allowed, or that all pod creations will be denied.
-   * Images matching an [admission allowlist
-   * pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
-   * are exempted from admission rules and will never block a pod creation.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AdmissionRule} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.AdmissionRule) - com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.class, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.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(); - evaluationMode_ = 0; - - requireAttestationsBy_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - enforcementMode_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule build() { - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule result = - new com.google.cloud.binaryauthorization.v1beta1.AdmissionRule(this); - int from_bitField0_ = bitField0_; - result.evaluationMode_ = evaluationMode_; - if (((bitField0_ & 0x00000001) != 0)) { - requireAttestationsBy_ = requireAttestationsBy_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.requireAttestationsBy_ = requireAttestationsBy_; - result.enforcementMode_ = enforcementMode_; - 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.binaryauthorization.v1beta1.AdmissionRule) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.AdmissionRule) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.AdmissionRule other) { - if (other == com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.getDefaultInstance()) - return this; - if (other.evaluationMode_ != 0) { - setEvaluationModeValue(other.getEvaluationModeValue()); - } - if (!other.requireAttestationsBy_.isEmpty()) { - if (requireAttestationsBy_.isEmpty()) { - requireAttestationsBy_ = other.requireAttestationsBy_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRequireAttestationsByIsMutable(); - requireAttestationsBy_.addAll(other.requireAttestationsBy_); - } - onChanged(); - } - if (other.enforcementMode_ != 0) { - setEnforcementModeValue(other.getEnforcementModeValue()); - } - 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.binaryauthorization.v1beta1.AdmissionRule parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.AdmissionRule) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int evaluationMode_ = 0; - /** - * - * - *
-     * Required. How this admission rule will be evaluated.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for evaluationMode. - */ - @java.lang.Override - public int getEvaluationModeValue() { - return evaluationMode_; - } - /** - * - * - *
-     * Required. How this admission rule will be evaluated.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The enum numeric value on the wire for evaluationMode to set. - * @return This builder for chaining. - */ - public Builder setEvaluationModeValue(int value) { - - evaluationMode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. How this admission rule will be evaluated.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The evaluationMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - getEvaluationMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode result = - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode.valueOf( - evaluationMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Required. How this admission rule will be evaluated.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The evaluationMode to set. - * @return This builder for chaining. - */ - public Builder setEvaluationMode( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode value) { - if (value == null) { - throw new NullPointerException(); - } - - evaluationMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. How this admission rule will be evaluated.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return This builder for chaining. - */ - public Builder clearEvaluationMode() { - - evaluationMode_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList requireAttestationsBy_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureRequireAttestationsByIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - requireAttestationsBy_ = - new com.google.protobuf.LazyStringArrayList(requireAttestationsBy_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return A list containing the requireAttestationsBy. - */ - public com.google.protobuf.ProtocolStringList getRequireAttestationsByList() { - return requireAttestationsBy_.getUnmodifiableView(); - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The count of requireAttestationsBy. - */ - public int getRequireAttestationsByCount() { - return requireAttestationsBy_.size(); - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the element to return. - * @return The requireAttestationsBy at the given index. - */ - public java.lang.String getRequireAttestationsBy(int index) { - return requireAttestationsBy_.get(index); - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the value to return. - * @return The bytes of the requireAttestationsBy at the given index. - */ - public com.google.protobuf.ByteString getRequireAttestationsByBytes(int index) { - return requireAttestationsBy_.getByteString(index); - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index to set the value at. - * @param value The requireAttestationsBy to set. - * @return This builder for chaining. - */ - public Builder setRequireAttestationsBy(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequireAttestationsByIsMutable(); - requireAttestationsBy_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param value The requireAttestationsBy to add. - * @return This builder for chaining. - */ - public Builder addRequireAttestationsBy(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequireAttestationsByIsMutable(); - requireAttestationsBy_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param values The requireAttestationsBy to add. - * @return This builder for chaining. - */ - public Builder addAllRequireAttestationsBy(java.lang.Iterable values) { - ensureRequireAttestationsByIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requireAttestationsBy_); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return This builder for chaining. - */ - public Builder clearRequireAttestationsBy() { - requireAttestationsBy_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The resource names of the attestors that must attest to
-     * a container image, in the format `projects/*/attestors/*`. Each
-     * attestor must exist before a policy can reference it.  To add an attestor
-     * to a policy the principal issuing the policy change request must be able
-     * to read the attestor resource.
-     * Note: this field must be non-empty when the evaluation_mode field specifies
-     * REQUIRE_ATTESTATION, otherwise it must be empty.
-     * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param value The bytes of the requireAttestationsBy to add. - * @return This builder for chaining. - */ - public Builder addRequireAttestationsByBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureRequireAttestationsByIsMutable(); - requireAttestationsBy_.add(value); - onChanged(); - return this; - } - - private int enforcementMode_ = 0; - /** - * - * - *
-     * Required. The action when a pod creation is denied by the admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for enforcementMode. - */ - @java.lang.Override - public int getEnforcementModeValue() { - return enforcementMode_; - } - /** - * - * - *
-     * Required. The action when a pod creation is denied by the admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The enum numeric value on the wire for enforcementMode to set. - * @return This builder for chaining. - */ - public Builder setEnforcementModeValue(int value) { - - enforcementMode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The action when a pod creation is denied by the admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enforcementMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - getEnforcementMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode result = - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode.valueOf( - enforcementMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Required. The action when a pod creation is denied by the admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The enforcementMode to set. - * @return This builder for chaining. - */ - public Builder setEnforcementMode( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode value) { - if (value == null) { - throw new NullPointerException(); - } - - enforcementMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The action when a pod creation is denied by the admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return This builder for chaining. - */ - public Builder clearEnforcementMode() { - - enforcementMode_ = 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.binaryauthorization.v1beta1.AdmissionRule) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.AdmissionRule) - private static final com.google.cloud.binaryauthorization.v1beta1.AdmissionRule DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.AdmissionRule(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AdmissionRule parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionRule(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.binaryauthorization.v1beta1.AdmissionRule getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRuleOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRuleOrBuilder.java deleted file mode 100644 index 287060ca..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionRuleOrBuilder.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface AdmissionRuleOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.AdmissionRule) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. How this admission rule will be evaluated.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for evaluationMode. - */ - int getEvaluationModeValue(); - /** - * - * - *
-   * Required. How this admission rule will be evaluated.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The evaluationMode. - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode getEvaluationMode(); - - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return A list containing the requireAttestationsBy. - */ - java.util.List getRequireAttestationsByList(); - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The count of requireAttestationsBy. - */ - int getRequireAttestationsByCount(); - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the element to return. - * @return The requireAttestationsBy at the given index. - */ - java.lang.String getRequireAttestationsBy(int index); - /** - * - * - *
-   * Optional. The resource names of the attestors that must attest to
-   * a container image, in the format `projects/*/attestors/*`. Each
-   * attestor must exist before a policy can reference it.  To add an attestor
-   * to a policy the principal issuing the policy change request must be able
-   * to read the attestor resource.
-   * Note: this field must be non-empty when the evaluation_mode field specifies
-   * REQUIRE_ATTESTATION, otherwise it must be empty.
-   * 
- * - * repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param index The index of the value to return. - * @return The bytes of the requireAttestationsBy at the given index. - */ - com.google.protobuf.ByteString getRequireAttestationsByBytes(int index); - - /** - * - * - *
-   * Required. The action when a pod creation is denied by the admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for enforcementMode. - */ - int getEnforcementModeValue(); - /** - * - * - *
-   * Required. The action when a pod creation is denied by the admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enforcementMode. - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode getEnforcementMode(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPattern.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPattern.java deleted file mode 100644 index da06701e..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPattern.java +++ /dev/null @@ -1,669 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * An [admission allowlist
- * pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
- * exempts images from checks by [admission
- * rules][google.cloud.binaryauthorization.v1beta1.AdmissionRule].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern} - */ -public final class AdmissionWhitelistPattern extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - AdmissionWhitelistPatternOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionWhitelistPattern.newBuilder() to construct. - private AdmissionWhitelistPattern(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionWhitelistPattern() { - namePattern_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AdmissionWhitelistPattern(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionWhitelistPattern( - 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(); - - namePattern_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.class, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder.class); - } - - public static final int NAME_PATTERN_FIELD_NUMBER = 1; - private volatile java.lang.Object namePattern_; - /** - * - * - *
-   * An image name pattern to allow, in the form `registry/path/to/image`.
-   * This supports a trailing `*` as a wildcard, but this is allowed only in
-   * text after the `registry/` part.
-   * 
- * - * string name_pattern = 1; - * - * @return The namePattern. - */ - @java.lang.Override - public java.lang.String getNamePattern() { - java.lang.Object ref = namePattern_; - 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(); - namePattern_ = s; - return s; - } - } - /** - * - * - *
-   * An image name pattern to allow, in the form `registry/path/to/image`.
-   * This supports a trailing `*` as a wildcard, but this is allowed only in
-   * text after the `registry/` part.
-   * 
- * - * string name_pattern = 1; - * - * @return The bytes for namePattern. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNamePatternBytes() { - java.lang.Object ref = namePattern_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namePattern_ = 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 (!getNamePatternBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namePattern_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNamePatternBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namePattern_); - } - 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern other = - (com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) obj; - - if (!getNamePattern().equals(other.getNamePattern())) 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_PATTERN_FIELD_NUMBER; - hash = (53 * hash) + getNamePattern().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern 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 [admission allowlist
-   * pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
-   * exempts images from checks by [admission
-   * rules][google.cloud.binaryauthorization.v1beta1.AdmissionRule].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.class, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.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(); - namePattern_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern build() { - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern result = - new com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern(this); - result.namePattern_ = namePattern_; - 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - .getDefaultInstance()) return this; - if (!other.getNamePattern().isEmpty()) { - namePattern_ = other.namePattern_; - 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object namePattern_ = ""; - /** - * - * - *
-     * An image name pattern to allow, in the form `registry/path/to/image`.
-     * This supports a trailing `*` as a wildcard, but this is allowed only in
-     * text after the `registry/` part.
-     * 
- * - * string name_pattern = 1; - * - * @return The namePattern. - */ - public java.lang.String getNamePattern() { - java.lang.Object ref = namePattern_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - namePattern_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * An image name pattern to allow, in the form `registry/path/to/image`.
-     * This supports a trailing `*` as a wildcard, but this is allowed only in
-     * text after the `registry/` part.
-     * 
- * - * string name_pattern = 1; - * - * @return The bytes for namePattern. - */ - public com.google.protobuf.ByteString getNamePatternBytes() { - java.lang.Object ref = namePattern_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namePattern_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * An image name pattern to allow, in the form `registry/path/to/image`.
-     * This supports a trailing `*` as a wildcard, but this is allowed only in
-     * text after the `registry/` part.
-     * 
- * - * string name_pattern = 1; - * - * @param value The namePattern to set. - * @return This builder for chaining. - */ - public Builder setNamePattern(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - namePattern_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * An image name pattern to allow, in the form `registry/path/to/image`.
-     * This supports a trailing `*` as a wildcard, but this is allowed only in
-     * text after the `registry/` part.
-     * 
- * - * string name_pattern = 1; - * - * @return This builder for chaining. - */ - public Builder clearNamePattern() { - - namePattern_ = getDefaultInstance().getNamePattern(); - onChanged(); - return this; - } - /** - * - * - *
-     * An image name pattern to allow, in the form `registry/path/to/image`.
-     * This supports a trailing `*` as a wildcard, but this is allowed only in
-     * text after the `registry/` part.
-     * 
- * - * string name_pattern = 1; - * - * @param value The bytes for namePattern to set. - * @return This builder for chaining. - */ - public Builder setNamePatternBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - namePattern_ = 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.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - private static final com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AdmissionWhitelistPattern parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionWhitelistPattern(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.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPatternOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPatternOrBuilder.java deleted file mode 100644 index b45118d1..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AdmissionWhitelistPatternOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface AdmissionWhitelistPatternOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * An image name pattern to allow, in the form `registry/path/to/image`.
-   * This supports a trailing `*` as a wildcard, but this is allowed only in
-   * text after the `registry/` part.
-   * 
- * - * string name_pattern = 1; - * - * @return The namePattern. - */ - java.lang.String getNamePattern(); - /** - * - * - *
-   * An image name pattern to allow, in the form `registry/path/to/image`.
-   * This supports a trailing `*` as a wildcard, but this is allowed only in
-   * text after the `registry/` part.
-   * 
- * - * string name_pattern = 1; - * - * @return The bytes for namePattern. - */ - com.google.protobuf.ByteString getNamePatternBytes(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Attestor.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Attestor.java deleted file mode 100644 index 4b84e894..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Attestor.java +++ /dev/null @@ -1,1553 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * An [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests
- * to container image artifacts. An existing attestor cannot be modified except
- * where indicated.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.Attestor} - */ -public final class Attestor extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.Attestor) - AttestorOrBuilder { - private static final long serialVersionUID = 0L; - // Use Attestor.newBuilder() to construct. - private Attestor(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Attestor() { - name_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Attestor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Attestor( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: - { - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder subBuilder = - null; - if (attestorTypeCase_ == 3) { - subBuilder = - ((com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - attestorType_) - .toBuilder(); - } - attestorType_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - attestorType_); - attestorType_ = subBuilder.buildPartial(); - } - attestorTypeCase_ = 3; - break; - } - case 34: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.Attestor.class, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder.class); - } - - private int attestorTypeCase_ = 0; - private java.lang.Object attestorType_; - - public enum AttestorTypeCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - USER_OWNED_DRYDOCK_NOTE(3), - ATTESTORTYPE_NOT_SET(0); - private final int value; - - private AttestorTypeCase(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 AttestorTypeCase valueOf(int value) { - return forNumber(value); - } - - public static AttestorTypeCase forNumber(int value) { - switch (value) { - case 3: - return USER_OWNED_DRYDOCK_NOTE; - case 0: - return ATTESTORTYPE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public AttestorTypeCase getAttestorTypeCase() { - return AttestorTypeCase.forNumber(attestorTypeCase_); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The resource name, in the format:
-   * `projects/*/attestors/*`. This field may not be updated.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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, in the format:
-   * `projects/*/attestors/*`. This field may not be updated.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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 DESCRIPTION_FIELD_NUMBER = 6; - private volatile java.lang.Object description_; - /** - * - * - *
-   * Optional. A descriptive comment.  This field may be updated.
-   * The field may be displayed in chooser dialogs.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. A descriptive comment.  This field may be updated.
-   * The field may be displayed in chooser dialogs.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USER_OWNED_DRYDOCK_NOTE_FIELD_NUMBER = 3; - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return Whether the userOwnedDrydockNote field is set. - */ - @java.lang.Override - public boolean hasUserOwnedDrydockNote() { - return attestorTypeCase_ == 3; - } - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return The userOwnedDrydockNote. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - getUserOwnedDrydockNote() { - if (attestorTypeCase_ == 3) { - return (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_; - } - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.getDefaultInstance(); - } - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder - getUserOwnedDrydockNoteOrBuilder() { - if (attestorTypeCase_ == 3) { - return (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_; - } - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.getDefaultInstance(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - 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 (attestorTypeCase_ == 3) { - output.writeMessage( - 3, (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_); - } - if (updateTime_ != null) { - output.writeMessage(4, getUpdateTime()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); - } - 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 (attestorTypeCase_ == 3) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); - } - 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.binaryauthorization.v1beta1.Attestor)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.Attestor other = - (com.google.cloud.binaryauthorization.v1beta1.Attestor) obj; - - if (!getName().equals(other.getName())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (!getAttestorTypeCase().equals(other.getAttestorTypeCase())) return false; - switch (attestorTypeCase_) { - case 3: - if (!getUserOwnedDrydockNote().equals(other.getUserOwnedDrydockNote())) 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) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - switch (attestorTypeCase_) { - case 3: - hash = (37 * hash) + USER_OWNED_DRYDOCK_NOTE_FIELD_NUMBER; - hash = (53 * hash) + getUserOwnedDrydockNote().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor 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.binaryauthorization.v1beta1.Attestor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor 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.binaryauthorization.v1beta1.Attestor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor 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.binaryauthorization.v1beta1.Attestor parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor 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.binaryauthorization.v1beta1.Attestor parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor 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.binaryauthorization.v1beta1.Attestor 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 [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests
-   * to container image artifacts. An existing attestor cannot be modified except
-   * where indicated.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.Attestor} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.Attestor) - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.Attestor.class, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.Attestor.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_ = ""; - - description_ = ""; - - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - attestorTypeCase_ = 0; - attestorType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor build() { - com.google.cloud.binaryauthorization.v1beta1.Attestor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.Attestor result = - new com.google.cloud.binaryauthorization.v1beta1.Attestor(this); - result.name_ = name_; - result.description_ = description_; - if (attestorTypeCase_ == 3) { - if (userOwnedDrydockNoteBuilder_ == null) { - result.attestorType_ = attestorType_; - } else { - result.attestorType_ = userOwnedDrydockNoteBuilder_.build(); - } - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - result.attestorTypeCase_ = attestorTypeCase_; - 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.binaryauthorization.v1beta1.Attestor) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.Attestor) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.Attestor other) { - if (other == com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - switch (other.getAttestorTypeCase()) { - case USER_OWNED_DRYDOCK_NOTE: - { - mergeUserOwnedDrydockNote(other.getUserOwnedDrydockNote()); - break; - } - case ATTESTORTYPE_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.binaryauthorization.v1beta1.Attestor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.Attestor) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int attestorTypeCase_ = 0; - private java.lang.Object attestorType_; - - public AttestorTypeCase getAttestorTypeCase() { - return AttestorTypeCase.forNumber(attestorTypeCase_); - } - - public Builder clearAttestorType() { - attestorTypeCase_ = 0; - attestorType_ = null; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The resource name, in the format:
-     * `projects/*/attestors/*`. This field may not be updated.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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, in the format:
-     * `projects/*/attestors/*`. This field may not be updated.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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, in the format:
-     * `projects/*/attestors/*`. This field may not be updated.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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, in the format:
-     * `projects/*/attestors/*`. This field may not be updated.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The resource name, in the format:
-     * `projects/*/attestors/*`. This field may not be updated.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @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 description_ = ""; - /** - * - * - *
-     * Optional. A descriptive comment.  This field may be updated.
-     * The field may be displayed in chooser dialogs.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment.  This field may be updated.
-     * The field may be displayed in chooser dialogs.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment.  This field may be updated.
-     * The field may be displayed in chooser dialogs.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment.  This field may be updated.
-     * The field may be displayed in chooser dialogs.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment.  This field may be updated.
-     * The field may be displayed in chooser dialogs.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder> - userOwnedDrydockNoteBuilder_; - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return Whether the userOwnedDrydockNote field is set. - */ - @java.lang.Override - public boolean hasUserOwnedDrydockNote() { - return attestorTypeCase_ == 3; - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return The userOwnedDrydockNote. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - getUserOwnedDrydockNote() { - if (userOwnedDrydockNoteBuilder_ == null) { - if (attestorTypeCase_ == 3) { - return (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_; - } - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - .getDefaultInstance(); - } else { - if (attestorTypeCase_ == 3) { - return userOwnedDrydockNoteBuilder_.getMessage(); - } - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - .getDefaultInstance(); - } - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - public Builder setUserOwnedDrydockNote( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote value) { - if (userOwnedDrydockNoteBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - attestorType_ = value; - onChanged(); - } else { - userOwnedDrydockNoteBuilder_.setMessage(value); - } - attestorTypeCase_ = 3; - return this; - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - public Builder setUserOwnedDrydockNote( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder builderForValue) { - if (userOwnedDrydockNoteBuilder_ == null) { - attestorType_ = builderForValue.build(); - onChanged(); - } else { - userOwnedDrydockNoteBuilder_.setMessage(builderForValue.build()); - } - attestorTypeCase_ = 3; - return this; - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - public Builder mergeUserOwnedDrydockNote( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote value) { - if (userOwnedDrydockNoteBuilder_ == null) { - if (attestorTypeCase_ == 3 - && attestorType_ - != com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - .getDefaultInstance()) { - attestorType_ = - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.newBuilder( - (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - attestorType_) - .mergeFrom(value) - .buildPartial(); - } else { - attestorType_ = value; - } - onChanged(); - } else { - if (attestorTypeCase_ == 3) { - userOwnedDrydockNoteBuilder_.mergeFrom(value); - } - userOwnedDrydockNoteBuilder_.setMessage(value); - } - attestorTypeCase_ = 3; - return this; - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - public Builder clearUserOwnedDrydockNote() { - if (userOwnedDrydockNoteBuilder_ == null) { - if (attestorTypeCase_ == 3) { - attestorTypeCase_ = 0; - attestorType_ = null; - onChanged(); - } - } else { - if (attestorTypeCase_ == 3) { - attestorTypeCase_ = 0; - attestorType_ = null; - } - userOwnedDrydockNoteBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder - getUserOwnedDrydockNoteBuilder() { - return getUserOwnedDrydockNoteFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder - getUserOwnedDrydockNoteOrBuilder() { - if ((attestorTypeCase_ == 3) && (userOwnedDrydockNoteBuilder_ != null)) { - return userOwnedDrydockNoteBuilder_.getMessageOrBuilder(); - } else { - if (attestorTypeCase_ == 3) { - return (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_; - } - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - .getDefaultInstance(); - } - } - /** - * - * - *
-     * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder> - getUserOwnedDrydockNoteFieldBuilder() { - if (userOwnedDrydockNoteBuilder_ == null) { - if (!(attestorTypeCase_ == 3)) { - attestorType_ = - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - .getDefaultInstance(); - } - userOwnedDrydockNoteBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder>( - (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) attestorType_, - getParentForChildren(), - isClean()); - attestorType_ = null; - } - attestorTypeCase_ = 3; - onChanged(); - ; - return userOwnedDrydockNoteBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * Output only. Time when the attestor was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.binaryauthorization.v1beta1.Attestor) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.Attestor) - private static final com.google.cloud.binaryauthorization.v1beta1.Attestor DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.Attestor(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Attestor getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Attestor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Attestor(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.binaryauthorization.v1beta1.Attestor getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorName.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorName.java deleted file mode 100644 index 450da7b8..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class AttestorName implements ResourceName { - private static final PathTemplate PROJECT_ATTESTOR = - PathTemplate.createWithoutUrlEncoding("projects/{project}/attestors/{attestor}"); - private volatile Map fieldValuesMap; - private final String project; - private final String attestor; - - @Deprecated - protected AttestorName() { - project = null; - attestor = null; - } - - private AttestorName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - attestor = Preconditions.checkNotNull(builder.getAttestor()); - } - - public String getProject() { - return project; - } - - public String getAttestor() { - return attestor; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static AttestorName of(String project, String attestor) { - return newBuilder().setProject(project).setAttestor(attestor).build(); - } - - public static String format(String project, String attestor) { - return newBuilder().setProject(project).setAttestor(attestor).build().toString(); - } - - public static AttestorName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_ATTESTOR.validatedMatch( - formattedString, "AttestorName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("attestor")); - } - - 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 (AttestorName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_ATTESTOR.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (attestor != null) { - fieldMapBuilder.put("attestor", attestor); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_ATTESTOR.instantiate("project", project, "attestor", attestor); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - AttestorName that = ((AttestorName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.attestor, that.attestor); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(attestor); - return h; - } - - /** Builder for projects/{project}/attestors/{attestor}. */ - public static class Builder { - private String project; - private String attestor; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getAttestor() { - return attestor; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setAttestor(String attestor) { - this.attestor = attestor; - return this; - } - - private Builder(AttestorName attestorName) { - this.project = attestorName.project; - this.attestor = attestorName.attestor; - } - - public AttestorName build() { - return new AttestorName(this); - } - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorOrBuilder.java deleted file mode 100644 index 0144162e..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorOrBuilder.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface AttestorOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.Attestor) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The resource name, in the format:
-   * `projects/*/attestors/*`. This field may not be updated.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The resource name, in the format:
-   * `projects/*/attestors/*`. This field may not be updated.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Optional. A descriptive comment.  This field may be updated.
-   * The field may be displayed in chooser dialogs.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-   * Optional. A descriptive comment.  This field may be updated.
-   * The field may be displayed in chooser dialogs.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return Whether the userOwnedDrydockNote field is set. - */ - boolean hasUserOwnedDrydockNote(); - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - * - * @return The userOwnedDrydockNote. - */ - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote getUserOwnedDrydockNote(); - /** - * - * - *
-   * A Drydock ATTESTATION_AUTHORITY Note, created by the user.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * - */ - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder - getUserOwnedDrydockNoteOrBuilder(); - - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * Output only. Time when the attestor was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - public com.google.cloud.binaryauthorization.v1beta1.Attestor.AttestorTypeCase - getAttestorTypeCase(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKey.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKey.java deleted file mode 100644 index ef225b30..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKey.java +++ /dev/null @@ -1,1609 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * An [attestor public
- * key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be
- * used to verify attestations signed by this attestor.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AttestorPublicKey} - */ -public final class AttestorPublicKey extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) - AttestorPublicKeyOrBuilder { - private static final long serialVersionUID = 0L; - // Use AttestorPublicKey.newBuilder() to construct. - private AttestorPublicKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AttestorPublicKey() { - comment_ = ""; - id_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AttestorPublicKey(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AttestorPublicKey( - 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(); - - comment_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - publicKeyCase_ = 3; - publicKey_ = s; - break; - } - case 42: - { - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder subBuilder = null; - if (publicKeyCase_ == 5) { - subBuilder = - ((com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_) - .toBuilder(); - } - publicKey_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_); - publicKey_ = subBuilder.buildPartial(); - } - publicKeyCase_ = 5; - 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.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.class, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder.class); - } - - private int publicKeyCase_ = 0; - private java.lang.Object publicKey_; - - public enum PublicKeyCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - ASCII_ARMORED_PGP_PUBLIC_KEY(3), - PKIX_PUBLIC_KEY(5), - PUBLICKEY_NOT_SET(0); - private final int value; - - private PublicKeyCase(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 PublicKeyCase valueOf(int value) { - return forNumber(value); - } - - public static PublicKeyCase forNumber(int value) { - switch (value) { - case 3: - return ASCII_ARMORED_PGP_PUBLIC_KEY; - case 5: - return PKIX_PUBLIC_KEY; - case 0: - return PUBLICKEY_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public PublicKeyCase getPublicKeyCase() { - return PublicKeyCase.forNumber(publicKeyCase_); - } - - public static final int COMMENT_FIELD_NUMBER = 1; - private volatile java.lang.Object comment_; - /** - * - * - *
-   * Optional. A descriptive comment. This field may be updated.
-   * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The comment. - */ - @java.lang.Override - public java.lang.String getComment() { - java.lang.Object ref = comment_; - 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(); - comment_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. A descriptive comment. This field may be updated.
-   * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for comment. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCommentBytes() { - java.lang.Object ref = comment_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - comment_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ID_FIELD_NUMBER = 2; - private volatile java.lang.Object id_; - /** - * - * - *
-   * The ID of this public key.
-   * Signatures verified by BinAuthz must include the ID of the public key that
-   * can be used to verify them, and that ID must match the contents of this
-   * field exactly.
-   * Additional restrictions on this field can be imposed based on which public
-   * key type is encapsulated. See the documentation on `public_key` cases below
-   * for details.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - 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(); - id_ = s; - return s; - } - } - /** - * - * - *
-   * The ID of this public key.
-   * Signatures verified by BinAuthz must include the ID of the public key that
-   * can be used to verify them, and that ID must match the contents of this
-   * field exactly.
-   * Additional restrictions on this field can be imposed based on which public
-   * key type is encapsulated. See the documentation on `public_key` cases below
-   * for details.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ASCII_ARMORED_PGP_PUBLIC_KEY_FIELD_NUMBER = 3; - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return Whether the asciiArmoredPgpPublicKey field is set. - */ - public boolean hasAsciiArmoredPgpPublicKey() { - return publicKeyCase_ == 3; - } - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The asciiArmoredPgpPublicKey. - */ - public java.lang.String getAsciiArmoredPgpPublicKey() { - java.lang.Object ref = ""; - if (publicKeyCase_ == 3) { - ref = publicKey_; - } - 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(); - if (publicKeyCase_ == 3) { - publicKey_ = s; - } - return s; - } - } - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The bytes for asciiArmoredPgpPublicKey. - */ - public com.google.protobuf.ByteString getAsciiArmoredPgpPublicKeyBytes() { - java.lang.Object ref = ""; - if (publicKeyCase_ == 3) { - ref = publicKey_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (publicKeyCase_ == 3) { - publicKey_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PKIX_PUBLIC_KEY_FIELD_NUMBER = 5; - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return Whether the pkixPublicKey field is set. - */ - @java.lang.Override - public boolean hasPkixPublicKey() { - return publicKeyCase_ == 5; - } - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return The pkixPublicKey. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getPkixPublicKey() { - if (publicKeyCase_ == 5) { - return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_; - } - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder - getPkixPublicKeyOrBuilder() { - if (publicKeyCase_ == 5) { - return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_; - } - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - - 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 (!getCommentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, comment_); - } - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); - } - if (publicKeyCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, publicKey_); - } - if (publicKeyCase_ == 5) { - output.writeMessage( - 5, (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCommentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, comment_); - } - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); - } - if (publicKeyCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, publicKey_); - } - if (publicKeyCase_ == 5) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 5, (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_); - } - 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.binaryauthorization.v1beta1.AttestorPublicKey)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey other = - (com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) obj; - - if (!getComment().equals(other.getComment())) return false; - if (!getId().equals(other.getId())) return false; - if (!getPublicKeyCase().equals(other.getPublicKeyCase())) return false; - switch (publicKeyCase_) { - case 3: - if (!getAsciiArmoredPgpPublicKey().equals(other.getAsciiArmoredPgpPublicKey())) - return false; - break; - case 5: - if (!getPkixPublicKey().equals(other.getPkixPublicKey())) 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) + COMMENT_FIELD_NUMBER; - hash = (53 * hash) + getComment().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - switch (publicKeyCase_) { - case 3: - hash = (37 * hash) + ASCII_ARMORED_PGP_PUBLIC_KEY_FIELD_NUMBER; - hash = (53 * hash) + getAsciiArmoredPgpPublicKey().hashCode(); - break; - case 5: - hash = (37 * hash) + PKIX_PUBLIC_KEY_FIELD_NUMBER; - hash = (53 * hash) + getPkixPublicKey().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey 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.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey 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.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey 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.binaryauthorization.v1beta1.AttestorPublicKey parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey 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.binaryauthorization.v1beta1.AttestorPublicKey parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey 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.binaryauthorization.v1beta1.AttestorPublicKey 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 [attestor public
-   * key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be
-   * used to verify attestations signed by this attestor.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.AttestorPublicKey} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.class, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.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(); - comment_ = ""; - - id_ = ""; - - publicKeyCase_ = 0; - publicKey_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey build() { - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey result = - new com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey(this); - result.comment_ = comment_; - result.id_ = id_; - if (publicKeyCase_ == 3) { - result.publicKey_ = publicKey_; - } - if (publicKeyCase_ == 5) { - if (pkixPublicKeyBuilder_ == null) { - result.publicKey_ = publicKey_; - } else { - result.publicKey_ = pkixPublicKeyBuilder_.build(); - } - } - result.publicKeyCase_ = publicKeyCase_; - 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.binaryauthorization.v1beta1.AttestorPublicKey) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance()) - return this; - if (!other.getComment().isEmpty()) { - comment_ = other.comment_; - onChanged(); - } - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - switch (other.getPublicKeyCase()) { - case ASCII_ARMORED_PGP_PUBLIC_KEY: - { - publicKeyCase_ = 3; - publicKey_ = other.publicKey_; - onChanged(); - break; - } - case PKIX_PUBLIC_KEY: - { - mergePkixPublicKey(other.getPkixPublicKey()); - break; - } - case PUBLICKEY_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.binaryauthorization.v1beta1.AttestorPublicKey parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int publicKeyCase_ = 0; - private java.lang.Object publicKey_; - - public PublicKeyCase getPublicKeyCase() { - return PublicKeyCase.forNumber(publicKeyCase_); - } - - public Builder clearPublicKey() { - publicKeyCase_ = 0; - publicKey_ = null; - onChanged(); - return this; - } - - private java.lang.Object comment_ = ""; - /** - * - * - *
-     * Optional. A descriptive comment. This field may be updated.
-     * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The comment. - */ - public java.lang.String getComment() { - java.lang.Object ref = comment_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - comment_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment. This field may be updated.
-     * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for comment. - */ - public com.google.protobuf.ByteString getCommentBytes() { - java.lang.Object ref = comment_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - comment_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment. This field may be updated.
-     * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The comment to set. - * @return This builder for chaining. - */ - public Builder setComment(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - comment_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment. This field may be updated.
-     * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearComment() { - - comment_ = getDefaultInstance().getComment(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment. This field may be updated.
-     * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for comment to set. - * @return This builder for chaining. - */ - public Builder setCommentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - comment_ = value; - onChanged(); - return this; - } - - private java.lang.Object id_ = ""; - /** - * - * - *
-     * The ID of this public key.
-     * Signatures verified by BinAuthz must include the ID of the public key that
-     * can be used to verify them, and that ID must match the contents of this
-     * field exactly.
-     * Additional restrictions on this field can be imposed based on which public
-     * key type is encapsulated. See the documentation on `public_key` cases below
-     * for details.
-     * 
- * - * string id = 2; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The ID of this public key.
-     * Signatures verified by BinAuthz must include the ID of the public key that
-     * can be used to verify them, and that ID must match the contents of this
-     * field exactly.
-     * Additional restrictions on this field can be imposed based on which public
-     * key type is encapsulated. See the documentation on `public_key` cases below
-     * for details.
-     * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The ID of this public key.
-     * Signatures verified by BinAuthz must include the ID of the public key that
-     * can be used to verify them, and that ID must match the contents of this
-     * field exactly.
-     * Additional restrictions on this field can be imposed based on which public
-     * key type is encapsulated. See the documentation on `public_key` cases below
-     * for details.
-     * 
- * - * string id = 2; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of this public key.
-     * Signatures verified by BinAuthz must include the ID of the public key that
-     * can be used to verify them, and that ID must match the contents of this
-     * field exactly.
-     * Additional restrictions on this field can be imposed based on which public
-     * key type is encapsulated. See the documentation on `public_key` cases below
-     * for details.
-     * 
- * - * string id = 2; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * - * - *
-     * The ID of this public key.
-     * Signatures verified by BinAuthz must include the ID of the public key that
-     * can be used to verify them, and that ID must match the contents of this
-     * field exactly.
-     * Additional restrictions on this field can be imposed based on which public
-     * key type is encapsulated. See the documentation on `public_key` cases below
-     * for details.
-     * 
- * - * string id = 2; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return Whether the asciiArmoredPgpPublicKey field is set. - */ - @java.lang.Override - public boolean hasAsciiArmoredPgpPublicKey() { - return publicKeyCase_ == 3; - } - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The asciiArmoredPgpPublicKey. - */ - @java.lang.Override - public java.lang.String getAsciiArmoredPgpPublicKey() { - java.lang.Object ref = ""; - if (publicKeyCase_ == 3) { - ref = publicKey_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (publicKeyCase_ == 3) { - publicKey_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The bytes for asciiArmoredPgpPublicKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAsciiArmoredPgpPublicKeyBytes() { - java.lang.Object ref = ""; - if (publicKeyCase_ == 3) { - ref = publicKey_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (publicKeyCase_ == 3) { - publicKey_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @param value The asciiArmoredPgpPublicKey to set. - * @return This builder for chaining. - */ - public Builder setAsciiArmoredPgpPublicKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - publicKeyCase_ = 3; - publicKey_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return This builder for chaining. - */ - public Builder clearAsciiArmoredPgpPublicKey() { - if (publicKeyCase_ == 3) { - publicKeyCase_ = 0; - publicKey_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * ASCII-armored representation of a PGP public key, as the entire output by
-     * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-     * line endings).
-     * When using this field, `id` should be left blank.  The BinAuthz API
-     * handlers will calculate the ID and fill it in automatically.  BinAuthz
-     * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-     * upper-case hex.  If `id` is provided by the caller, it will be
-     * overwritten by the API-calculated ID.
-     * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @param value The bytes for asciiArmoredPgpPublicKey to set. - * @return This builder for chaining. - */ - public Builder setAsciiArmoredPgpPublicKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - publicKeyCase_ = 3; - publicKey_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder> - pkixPublicKeyBuilder_; - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return Whether the pkixPublicKey field is set. - */ - @java.lang.Override - public boolean hasPkixPublicKey() { - return publicKeyCase_ == 5; - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return The pkixPublicKey. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getPkixPublicKey() { - if (pkixPublicKeyBuilder_ == null) { - if (publicKeyCase_ == 5) { - return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_; - } - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } else { - if (publicKeyCase_ == 5) { - return pkixPublicKeyBuilder_.getMessage(); - } - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - public Builder setPkixPublicKey( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value) { - if (pkixPublicKeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - publicKey_ = value; - onChanged(); - } else { - pkixPublicKeyBuilder_.setMessage(value); - } - publicKeyCase_ = 5; - return this; - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - public Builder setPkixPublicKey( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder builderForValue) { - if (pkixPublicKeyBuilder_ == null) { - publicKey_ = builderForValue.build(); - onChanged(); - } else { - pkixPublicKeyBuilder_.setMessage(builderForValue.build()); - } - publicKeyCase_ = 5; - return this; - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - public Builder mergePkixPublicKey( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey value) { - if (pkixPublicKeyBuilder_ == null) { - if (publicKeyCase_ == 5 - && publicKey_ - != com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey - .getDefaultInstance()) { - publicKey_ = - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.newBuilder( - (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_) - .mergeFrom(value) - .buildPartial(); - } else { - publicKey_ = value; - } - onChanged(); - } else { - if (publicKeyCase_ == 5) { - pkixPublicKeyBuilder_.mergeFrom(value); - } - pkixPublicKeyBuilder_.setMessage(value); - } - publicKeyCase_ = 5; - return this; - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - public Builder clearPkixPublicKey() { - if (pkixPublicKeyBuilder_ == null) { - if (publicKeyCase_ == 5) { - publicKeyCase_ = 0; - publicKey_ = null; - onChanged(); - } - } else { - if (publicKeyCase_ == 5) { - publicKeyCase_ = 0; - publicKey_ = null; - } - pkixPublicKeyBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder - getPkixPublicKeyBuilder() { - return getPkixPublicKeyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder - getPkixPublicKeyOrBuilder() { - if ((publicKeyCase_ == 5) && (pkixPublicKeyBuilder_ != null)) { - return pkixPublicKeyBuilder_.getMessageOrBuilder(); - } else { - if (publicKeyCase_ == 5) { - return (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_; - } - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - } - /** - * - * - *
-     * A raw PKIX SubjectPublicKeyInfo format public key.
-     * NOTE: `id` may be explicitly provided by the caller when using this
-     * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-     * blank, a default one will be computed based on the digest of the DER
-     * encoding of the public key.
-     * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder> - getPkixPublicKeyFieldBuilder() { - if (pkixPublicKeyBuilder_ == null) { - if (!(publicKeyCase_ == 5)) { - publicKey_ = - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - pkixPublicKeyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder>( - (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) publicKey_, - getParentForChildren(), - isClean()); - publicKey_ = null; - } - publicKeyCase_ = 5; - onChanged(); - ; - return pkixPublicKeyBuilder_; - } - - @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.binaryauthorization.v1beta1.AttestorPublicKey) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) - private static final com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AttestorPublicKey parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttestorPublicKey(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.binaryauthorization.v1beta1.AttestorPublicKey - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKeyOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKeyOrBuilder.java deleted file mode 100644 index a4e16b4a..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/AttestorPublicKeyOrBuilder.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface AttestorPublicKeyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.AttestorPublicKey) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Optional. A descriptive comment. This field may be updated.
-   * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The comment. - */ - java.lang.String getComment(); - /** - * - * - *
-   * Optional. A descriptive comment. This field may be updated.
-   * 
- * - * string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for comment. - */ - com.google.protobuf.ByteString getCommentBytes(); - - /** - * - * - *
-   * The ID of this public key.
-   * Signatures verified by BinAuthz must include the ID of the public key that
-   * can be used to verify them, and that ID must match the contents of this
-   * field exactly.
-   * Additional restrictions on this field can be imposed based on which public
-   * key type is encapsulated. See the documentation on `public_key` cases below
-   * for details.
-   * 
- * - * string id = 2; - * - * @return The id. - */ - java.lang.String getId(); - /** - * - * - *
-   * The ID of this public key.
-   * Signatures verified by BinAuthz must include the ID of the public key that
-   * can be used to verify them, and that ID must match the contents of this
-   * field exactly.
-   * Additional restrictions on this field can be imposed based on which public
-   * key type is encapsulated. See the documentation on `public_key` cases below
-   * for details.
-   * 
- * - * string id = 2; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString getIdBytes(); - - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return Whether the asciiArmoredPgpPublicKey field is set. - */ - boolean hasAsciiArmoredPgpPublicKey(); - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The asciiArmoredPgpPublicKey. - */ - java.lang.String getAsciiArmoredPgpPublicKey(); - /** - * - * - *
-   * ASCII-armored representation of a PGP public key, as the entire output by
-   * the command `gpg --export --armor foo@example.com` (either LF or CRLF
-   * line endings).
-   * When using this field, `id` should be left blank.  The BinAuthz API
-   * handlers will calculate the ID and fill it in automatically.  BinAuthz
-   * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as
-   * upper-case hex.  If `id` is provided by the caller, it will be
-   * overwritten by the API-calculated ID.
-   * 
- * - * string ascii_armored_pgp_public_key = 3; - * - * @return The bytes for asciiArmoredPgpPublicKey. - */ - com.google.protobuf.ByteString getAsciiArmoredPgpPublicKeyBytes(); - - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return Whether the pkixPublicKey field is set. - */ - boolean hasPkixPublicKey(); - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * - * @return The pkixPublicKey. - */ - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getPkixPublicKey(); - /** - * - * - *
-   * A raw PKIX SubjectPublicKeyInfo format public key.
-   * NOTE: `id` may be explicitly provided by the caller when using this
-   * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left
-   * blank, a default one will be computed based on the digest of the DER
-   * encoding of the public key.
-   * 
- * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - */ - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder getPkixPublicKeyOrBuilder(); - - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.PublicKeyCase - getPublicKeyCase(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationResourcesProto.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationResourcesProto.java deleted file mode 100644 index bcf0febe..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationResourcesProto.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public final class BinaryAuthorizationResourcesProto { - private BinaryAuthorizationResourcesProto() {} - - 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_binaryauthorization_v1beta1_Policy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n8google/cloud/binaryauthorization/v1bet" - + "a1/resources.proto\022(google.cloud.binarya" - + "uthorization.v1beta1\032\034google/api/annotat" - + "ions.proto\032\037google/api/field_behavior.pr" - + "oto\032\031google/api/resource.proto\032\037google/p" - + "rotobuf/timestamp.proto\"\315\006\n\006Policy\022\021\n\004na" - + "me\030\001 \001(\tB\003\340A\003\022\030\n\013description\030\006 \001(\tB\003\340A\001\022" - + "w\n\035global_policy_evaluation_mode\030\007 \001(\0162K" - + ".google.cloud.binaryauthorization.v1beta" - + "1.Policy.GlobalPolicyEvaluationModeB\003\340A\001" - + "\022n\n\034admission_whitelist_patterns\030\002 \003(\0132C" - + ".google.cloud.binaryauthorization.v1beta" - + "1.AdmissionWhitelistPatternB\003\340A\001\022q\n\027clus" - + "ter_admission_rules\030\003 \003(\0132K.google.cloud" - + ".binaryauthorization.v1beta1.Policy.Clus" - + "terAdmissionRulesEntryB\003\340A\001\022\\\n\026default_a" - + "dmission_rule\030\004 \001(\01327.google.cloud.binar" - + "yauthorization.v1beta1.AdmissionRuleB\003\340A" - + "\002\0224\n\013update_time\030\005 \001(\0132\032.google.protobuf" - + ".TimestampB\003\340A\003\032u\n\032ClusterAdmissionRules" - + "Entry\022\013\n\003key\030\001 \001(\t\022F\n\005value\030\002 \001(\01327.goog" - + "le.cloud.binaryauthorization.v1beta1.Adm" - + "issionRule:\0028\001\"d\n\032GlobalPolicyEvaluation" - + "Mode\022-\n)GLOBAL_POLICY_EVALUATION_MODE_UN" - + "SPECIFIED\020\000\022\n\n\006ENABLE\020\001\022\013\n\007DISABLE\020\002:I\352A" - + "F\n)binaryauthorization.googleapis.com/Po" - + "licy\022\031projects/{project}/policy\"1\n\031Admis" - + "sionWhitelistPattern\022\024\n\014name_pattern\030\001 \001" - + "(\t\"\344\003\n\rAdmissionRule\022d\n\017evaluation_mode\030" - + "\001 \001(\0162F.google.cloud.binaryauthorization" - + ".v1beta1.AdmissionRule.EvaluationModeB\003\340" - + "A\002\022$\n\027require_attestations_by\030\002 \003(\tB\003\340A\001" - + "\022f\n\020enforcement_mode\030\003 \001(\0162G.google.clou" - + "d.binaryauthorization.v1beta1.AdmissionR" - + "ule.EnforcementModeB\003\340A\002\"m\n\016EvaluationMo" - + "de\022\037\n\033EVALUATION_MODE_UNSPECIFIED\020\000\022\020\n\014A" - + "LWAYS_ALLOW\020\001\022\027\n\023REQUIRE_ATTESTATION\020\002\022\017" - + "\n\013ALWAYS_DENY\020\003\"p\n\017EnforcementMode\022 \n\034EN" - + "FORCEMENT_MODE_UNSPECIFIED\020\000\022 \n\034ENFORCED" - + "_BLOCK_AND_AUDIT_LOG\020\001\022\031\n\025DRYRUN_AUDIT_L" - + "OG_ONLY\020\002\"\274\002\n\010Attestor\022\021\n\004name\030\001 \001(\tB\003\340A" - + "\002\022\030\n\013description\030\006 \001(\tB\003\340A\001\022a\n\027user_owne" - + "d_drydock_note\030\003 \001(\0132>.google.cloud.bina" - + "ryauthorization.v1beta1.UserOwnedDrydock" - + "NoteH\000\0224\n\013update_time\030\004 \001(\0132\032.google.pro" - + "tobuf.TimestampB\003\340A\003:Y\352AV\n+binaryauthori" - + "zation.googleapis.com/Attestor\022\'projects" - + "/{project}/attestors/{attestor}B\017\n\rattes" - + "tor_type\"\271\001\n\024UserOwnedDrydockNote\022\033\n\016not" - + "e_reference\030\001 \001(\tB\003\340A\002\022U\n\013public_keys\030\002 " - + "\003(\0132;.google.cloud.binaryauthorization.v" - + "1beta1.AttestorPublicKeyB\003\340A\001\022-\n delegat" - + "ion_service_account_email\030\003 \001(\tB\003\340A\003\"\365\003\n" - + "\rPkixPublicKey\022\026\n\016public_key_pem\030\001 \001(\t\022g" - + "\n\023signature_algorithm\030\002 \001(\0162J.google.clo" - + "ud.binaryauthorization.v1beta1.PkixPubli" - + "cKey.SignatureAlgorithm\"\342\002\n\022SignatureAlg" - + "orithm\022#\n\037SIGNATURE_ALGORITHM_UNSPECIFIE" - + "D\020\000\022\027\n\023RSA_PSS_2048_SHA256\020\001\022\027\n\023RSA_PSS_" - + "3072_SHA256\020\002\022\027\n\023RSA_PSS_4096_SHA256\020\003\022\027" - + "\n\023RSA_PSS_4096_SHA512\020\004\022\036\n\032RSA_SIGN_PKCS" - + "1_2048_SHA256\020\005\022\036\n\032RSA_SIGN_PKCS1_3072_S" - + "HA256\020\006\022\036\n\032RSA_SIGN_PKCS1_4096_SHA256\020\007\022" - + "\036\n\032RSA_SIGN_PKCS1_4096_SHA512\020\010\022\025\n\021ECDSA" - + "_P256_SHA256\020\t\022\025\n\021ECDSA_P384_SHA384\020\n\022\025\n" - + "\021ECDSA_P521_SHA512\020\013\"\277\001\n\021AttestorPublicK" - + "ey\022\024\n\007comment\030\001 \001(\tB\003\340A\001\022\n\n\002id\030\002 \001(\t\022&\n\034" - + "ascii_armored_pgp_public_key\030\003 \001(\tH\000\022R\n\017" - + "pkix_public_key\030\005 \001(\01327.google.cloud.bin" - + "aryauthorization.v1beta1.PkixPublicKeyH\000" - + "B\014\n\npublic_keyB\267\002\n,com.google.cloud.bina" - + "ryauthorization.v1beta1B!BinaryAuthoriza" - + "tionResourcesProtoP\001Z[google.golang.org/" - + "genproto/googleapis/cloud/binaryauthoriz" - + "ation/v1beta1;binaryauthorization\370\001\001\252\002(G" - + "oogle.Cloud.BinaryAuthorization.V1Beta1\312" - + "\002(Google\\Cloud\\BinaryAuthorization\\V1bet" - + "a1\352\002+Google::Cloud::BinaryAuthorization:" - + ":V1beta1b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }); - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor, - new java.lang.String[] { - "Name", - "Description", - "GlobalPolicyEvaluationMode", - "AdmissionWhitelistPatterns", - "ClusterAdmissionRules", - "DefaultAdmissionRule", - "UpdateTime", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_descriptor = - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionWhitelistPattern_descriptor, - new java.lang.String[] { - "NamePattern", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_AdmissionRule_descriptor, - new java.lang.String[] { - "EvaluationMode", "RequireAttestationsBy", "EnforcementMode", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_Attestor_descriptor, - new java.lang.String[] { - "Name", "Description", "UserOwnedDrydockNote", "UpdateTime", "AttestorType", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor, - new java.lang.String[] { - "NoteReference", "PublicKeys", "DelegationServiceAccountEmail", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor, - new java.lang.String[] { - "PublicKeyPem", "SignatureAlgorithm", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_AttestorPublicKey_descriptor, - new java.lang.String[] { - "Comment", "Id", "AsciiArmoredPgpPublicKey", "PkixPublicKey", "PublicKey", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.ResourceProto.resource); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationServiceProto.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationServiceProto.java deleted file mode 100644 index bfb872a3..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinaryAuthorizationServiceProto.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public final class BinaryAuthorizationServiceProto { - private BinaryAuthorizationServiceProto() {} - - 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_binaryauthorization_v1beta1_GetPolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n6google/cloud/binaryauthorization/v1bet" - + "a1/service.proto\022(google.cloud.binaryaut" - + "horization.v1beta1\032\034google/api/annotatio" - + "ns.proto\032\027google/api/client.proto\032\037googl" - + "e/api/field_behavior.proto\032\031google/api/r" - + "esource.proto\0328google/cloud/binaryauthor" - + "ization/v1beta1/resources.proto\032\033google/" - + "protobuf/empty.proto\"S\n\020GetPolicyRequest" - + "\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)binaryauthorizat" - + "ion.googleapis.com/Policy\"\\\n\023UpdatePolic" - + "yRequest\022E\n\006policy\030\001 \001(\01320.google.cloud." - + "binaryauthorization.v1beta1.PolicyB\003\340A\002\"" - + "\301\001\n\025CreateAttestorRequest\022C\n\006parent\030\001 \001(" - + "\tB3\340A\002\372A-\n+cloudresourcemanager.googleap" - + "is.com/Project\022\030\n\013attestor_id\030\002 \001(\tB\003\340A\002" - + "\022I\n\010attestor\030\003 \001(\01322.google.cloud.binary" - + "authorization.v1beta1.AttestorB\003\340A\002\"W\n\022G" - + "etAttestorRequest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n" - + "+binaryauthorization.googleapis.com/Atte" - + "stor\"b\n\025UpdateAttestorRequest\022I\n\010attesto" - + "r\030\001 \001(\01322.google.cloud.binaryauthorizati" - + "on.v1beta1.AttestorB\003\340A\002\"\202\001\n\024ListAttesto" - + "rsRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloud" - + "resourcemanager.googleapis.com/Project\022\021" - + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"w\n" - + "\025ListAttestorsResponse\022E\n\tattestors\030\001 \003(" - + "\01322.google.cloud.binaryauthorization.v1b" - + "eta1.Attestor\022\027\n\017next_page_token\030\002 \001(\t\"Z" - + "\n\025DeleteAttestorRequest\022A\n\004name\030\001 \001(\tB3\340" - + "A\002\372A-\n+binaryauthorization.googleapis.co" - + "m/Attestor2\313\013\n BinauthzManagementService" - + "V1Beta1\022\253\001\n\tGetPolicy\022:.google.cloud.bin" - + "aryauthorization.v1beta1.GetPolicyReques" - + "t\0320.google.cloud.binaryauthorization.v1b" - + "eta1.Policy\"0\202\323\344\223\002#\022!/v1beta1/{name=proj" - + "ects/*/policy}\332A\004name\022\302\001\n\014UpdatePolicy\022=" - + ".google.cloud.binaryauthorization.v1beta" - + "1.UpdatePolicyRequest\0320.google.cloud.bin" - + "aryauthorization.v1beta1.Policy\"A\202\323\344\223\0022\032" - + "(/v1beta1/{policy.name=projects/*/policy" - + "}:\006policy\332A\006policy\022\335\001\n\016CreateAttestor\022?." - + "google.cloud.binaryauthorization.v1beta1" - + ".CreateAttestorRequest\0322.google.cloud.bi" - + "naryauthorization.v1beta1.Attestor\"V\202\323\344\223" - + "\0022\"&/v1beta1/{parent=projects/*}/attesto" - + "rs:\010attestor\332A\033parent,attestor_id,attest" - + "or\022\266\001\n\013GetAttestor\022<.google.cloud.binary" - + "authorization.v1beta1.GetAttestorRequest" - + "\0322.google.cloud.binaryauthorization.v1be" - + "ta1.Attestor\"5\202\323\344\223\002(\022&/v1beta1/{name=pro" - + "jects/*/attestors/*}\332A\004name\022\323\001\n\016UpdateAt" - + "testor\022?.google.cloud.binaryauthorizatio" - + "n.v1beta1.UpdateAttestorRequest\0322.google" - + ".cloud.binaryauthorization.v1beta1.Attes" - + "tor\"L\202\323\344\223\002;\032//v1beta1/{attestor.name=pro" - + "jects/*/attestors/*}:\010attestor\332A\010attesto" - + "r\022\311\001\n\rListAttestors\022>.google.cloud.binar" - + "yauthorization.v1beta1.ListAttestorsRequ" - + "est\032?.google.cloud.binaryauthorization.v" - + "1beta1.ListAttestorsResponse\"7\202\323\344\223\002(\022&/v" - + "1beta1/{parent=projects/*}/attestors\332A\006p" - + "arent\022\240\001\n\016DeleteAttestor\022?.google.cloud." - + "binaryauthorization.v1beta1.DeleteAttest" - + "orRequest\032\026.google.protobuf.Empty\"5\202\323\344\223\002" - + "(*&/v1beta1/{name=projects/*/attestors/*" - + "}\332A\004name\032V\312A\"binaryauthorization.googlea" - + "pis.com\322A.https://www.googleapis.com/aut" - + "h/cloud-platformB\265\002\n,com.google.cloud.bi" - + "naryauthorization.v1beta1B\037BinaryAuthori" - + "zationServiceProtoP\001Z[google.golang.org/" - + "genproto/googleapis/cloud/binaryauthoriz" - + "ation/v1beta1;binaryauthorization\370\001\001\252\002(G" - + "oogle.Cloud.BinaryAuthorization.V1Beta1\312" - + "\002(Google\\Cloud\\BinaryAuthorization\\V1bet" - + "a1\352\002+Google::Cloud::BinaryAuthorization:" - + ":V1beta1b\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.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - }); - internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor, - new java.lang.String[] { - "Policy", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor, - new java.lang.String[] { - "Parent", "AttestorId", "Attestor", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor, - new java.lang.String[] { - "Attestor", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor, - new java.lang.String[] { - "Parent", "PageSize", "PageToken", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor, - new java.lang.String[] { - "Attestors", "NextPageToken", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor, - new java.lang.String[] { - "Name", - }); - 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.resourceReference); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java deleted file mode 100644 index ffa30923..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java +++ /dev/null @@ -1,5759 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/continuous_validation_logging.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Represents an auditing event from Continuous Validation.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent} - */ -public final class ContinuousValidationEvent extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) - ContinuousValidationEventOrBuilder { - private static final long serialVersionUID = 0L; - // Use ContinuousValidationEvent.newBuilder() to construct. - private ContinuousValidationEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ContinuousValidationEvent() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ContinuousValidationEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ContinuousValidationEvent( - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder - subBuilder = null; - if (eventTypeCase_ == 1) { - subBuilder = - ((com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_) - .toBuilder(); - } - eventType_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_); - eventType_ = subBuilder.buildPartial(); - } - eventTypeCase_ = 1; - break; - } - case 18: - { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder - subBuilder = null; - if (eventTypeCase_ == 2) { - subBuilder = - ((com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_) - .toBuilder(); - } - eventType_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_); - eventType_ = subBuilder.buildPartial(); - } - eventTypeCase_ = 2; - 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.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.Builder.class); - } - - public interface ContinuousValidationPodEventOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The name of the Pod.
-     * 
- * - * string pod = 1; - * - * @return The pod. - */ - java.lang.String getPod(); - /** - * - * - *
-     * The name of the Pod.
-     * 
- * - * string pod = 1; - * - * @return The bytes for pod. - */ - com.google.protobuf.ByteString getPodBytes(); - - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return Whether the deployTime field is set. - */ - boolean hasDeployTime(); - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return The deployTime. - */ - com.google.protobuf.Timestamp getDeployTime(); - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder(); - - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return The endTime. - */ - com.google.protobuf.Timestamp getEndTime(); - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); - - /** - * - * - *
-     * Auditing verdict for this Pod.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The enum numeric value on the wire for verdict. - */ - int getVerdictValue(); - /** - * - * - *
-     * Auditing verdict for this Pod.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The verdict. - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - getVerdict(); - - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - getImagesList(); - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getImages(int index); - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - int getImagesCount(); - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - java.util.List< - ? extends - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder> - getImagesOrBuilderList(); - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder - getImagesOrBuilder(int index); - } - /** - * - * - *
-   * An auditing event for one Pod.
-   * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent} - */ - public static final class ContinuousValidationPodEvent - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) - ContinuousValidationPodEventOrBuilder { - private static final long serialVersionUID = 0L; - // Use ContinuousValidationPodEvent.newBuilder() to construct. - private ContinuousValidationPodEvent( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ContinuousValidationPodEvent() { - pod_ = ""; - verdict_ = 0; - images_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ContinuousValidationPodEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ContinuousValidationPodEvent( - 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(); - - pod_ = s; - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (deployTime_ != null) { - subBuilder = deployTime_.toBuilder(); - } - deployTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deployTime_); - deployTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 32: - { - int rawValue = input.readEnum(); - - verdict_ = rawValue; - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - images_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails>(); - mutable_bitField0_ |= 0x00000001; - } - images_.add( - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.parser(), - extensionRegistry)); - 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)) { - images_ = java.util.Collections.unmodifiableList(images_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder.class); - } - - /** - * - * - *
-     * Audit time policy conformance verdict.
-     * 
- * - * Protobuf enum {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict} - */ - public enum PolicyConformanceVerdict implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * We should always have a verdict. This is an error.
-       * 
- * - * POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - */ - POLICY_CONFORMANCE_VERDICT_UNSPECIFIED(0), - /** - * - * - *
-       * The pod violates the policy.
-       * 
- * - * VIOLATES_POLICY = 1; - */ - VIOLATES_POLICY(1), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * We should always have a verdict. This is an error.
-       * 
- * - * POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - */ - public static final int POLICY_CONFORMANCE_VERDICT_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * The pod violates the policy.
-       * 
- * - * VIOLATES_POLICY = 1; - */ - public static final int VIOLATES_POLICY_VALUE = 1; - - 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 PolicyConformanceVerdict 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 PolicyConformanceVerdict forNumber(int value) { - switch (value) { - case 0: - return POLICY_CONFORMANCE_VERDICT_UNSPECIFIED; - case 1: - return VIOLATES_POLICY; - 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 PolicyConformanceVerdict findValueByNumber(int number) { - return PolicyConformanceVerdict.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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final PolicyConformanceVerdict[] VALUES = values(); - - public static PolicyConformanceVerdict 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 PolicyConformanceVerdict(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict) - } - - public interface ImageDetailsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * The name of the image.
-       * 
- * - * string image = 1; - * - * @return The image. - */ - java.lang.String getImage(); - /** - * - * - *
-       * The name of the image.
-       * 
- * - * string image = 1; - * - * @return The bytes for image. - */ - com.google.protobuf.ByteString getImageBytes(); - - /** - * - * - *
-       * The result of the audit for this image.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The enum numeric value on the wire for result. - */ - int getResultValue(); - /** - * - * - *
-       * The result of the audit for this image.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The result. - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - getResult(); - - /** - * - * - *
-       * Description of the above result.
-       * 
- * - * string description = 3; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-       * Description of the above result.
-       * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - } - /** - * - * - *
-     * Container image with auditing details.
-     * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails} - */ - public static final class ImageDetails extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails) - ImageDetailsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ImageDetails.newBuilder() to construct. - private ImageDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ImageDetails() { - image_ = ""; - result_ = 0; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ImageDetails(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ImageDetails( - 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(); - - image_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - result_ = rawValue; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = 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.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder.class); - } - - /** - * - * - *
-       * Result of the audit.
-       * 
- * - * Protobuf enum {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult} - */ - public enum AuditResult implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-         * Unspecified result. This is an error.
-         * 
- * - * AUDIT_RESULT_UNSPECIFIED = 0; - */ - AUDIT_RESULT_UNSPECIFIED(0), - /** - * - * - *
-         * Image is allowed.
-         * 
- * - * ALLOW = 1; - */ - ALLOW(1), - /** - * - * - *
-         * Image is denied.
-         * 
- * - * DENY = 2; - */ - DENY(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-         * Unspecified result. This is an error.
-         * 
- * - * AUDIT_RESULT_UNSPECIFIED = 0; - */ - public static final int AUDIT_RESULT_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-         * Image is allowed.
-         * 
- * - * ALLOW = 1; - */ - public static final int ALLOW_VALUE = 1; - /** - * - * - *
-         * Image is denied.
-         * 
- * - * DENY = 2; - */ - public static final int DENY_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 AuditResult 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 AuditResult forNumber(int value) { - switch (value) { - case 0: - return AUDIT_RESULT_UNSPECIFIED; - case 1: - return ALLOW; - case 2: - return DENY; - 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 AuditResult findValueByNumber(int number) { - return AuditResult.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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final AuditResult[] VALUES = values(); - - public static AuditResult 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 AuditResult(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult) - } - - public static final int IMAGE_FIELD_NUMBER = 1; - private volatile java.lang.Object image_; - /** - * - * - *
-       * The name of the image.
-       * 
- * - * string image = 1; - * - * @return The image. - */ - @java.lang.Override - public java.lang.String getImage() { - java.lang.Object ref = image_; - 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(); - image_ = s; - return s; - } - } - /** - * - * - *
-       * The name of the image.
-       * 
- * - * string image = 1; - * - * @return The bytes for image. - */ - @java.lang.Override - public com.google.protobuf.ByteString getImageBytes() { - java.lang.Object ref = image_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - image_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESULT_FIELD_NUMBER = 2; - private int result_; - /** - * - * - *
-       * The result of the audit for this image.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return result_; - } - /** - * - * - *
-       * The result of the audit for this image.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The result. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - getResult() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - result = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.valueOf(result_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.UNRECOGNIZED - : result; - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - * - * - *
-       * Description of the above result.
-       * 
- * - * string description = 3; - * - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - * - * - *
-       * Description of the above result.
-       * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = 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 (!getImageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_); - } - if (result_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.AUDIT_RESULT_UNSPECIFIED - .getNumber()) { - output.writeEnum(2, result_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getImageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_); - } - if (result_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.AUDIT_RESULT_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, result_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - other = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails) - obj; - - if (!getImage().equals(other.getImage())) return false; - if (result_ != other.result_) return false; - if (!getDescription().equals(other.getDescription())) 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) + IMAGE_FIELD_NUMBER; - hash = (53 * hash) + getImage().hashCode(); - hash = (37 * hash) + RESULT_FIELD_NUMBER; - hash = (53 * hash) + result_; - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - 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; - } - /** - * - * - *
-       * Container image with auditing details.
-       * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails) - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.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(); - image_ = ""; - - result_ = 0; - - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - build() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - result = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails(this); - result.image_ = image_; - result.result_ = result_; - result.description_ = description_; - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.getDefaultInstance()) return this; - if (!other.getImage().isEmpty()) { - image_ = other.image_; - onChanged(); - } - if (other.result_ != 0) { - setResultValue(other.getResultValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object image_ = ""; - /** - * - * - *
-         * The name of the image.
-         * 
- * - * string image = 1; - * - * @return The image. - */ - public java.lang.String getImage() { - java.lang.Object ref = image_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - image_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * The name of the image.
-         * 
- * - * string image = 1; - * - * @return The bytes for image. - */ - public com.google.protobuf.ByteString getImageBytes() { - java.lang.Object ref = image_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - image_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * The name of the image.
-         * 
- * - * string image = 1; - * - * @param value The image to set. - * @return This builder for chaining. - */ - public Builder setImage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - image_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * The name of the image.
-         * 
- * - * string image = 1; - * - * @return This builder for chaining. - */ - public Builder clearImage() { - - image_ = getDefaultInstance().getImage(); - onChanged(); - return this; - } - /** - * - * - *
-         * The name of the image.
-         * 
- * - * string image = 1; - * - * @param value The bytes for image to set. - * @return This builder for chaining. - */ - public Builder setImageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - image_ = value; - onChanged(); - return this; - } - - private int result_ = 0; - /** - * - * - *
-         * The result of the audit for this image.
-         * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return result_; - } - /** - * - * - *
-         * The result of the audit for this image.
-         * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @param value The enum numeric value on the wire for result to set. - * @return This builder for chaining. - */ - public Builder setResultValue(int value) { - - result_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * The result of the audit for this image.
-         * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return The result. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - getResult() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - result = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.valueOf(result_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult.UNRECOGNIZED - : result; - } - /** - * - * - *
-         * The result of the audit for this image.
-         * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @param value The result to set. - * @return This builder for chaining. - */ - public Builder setResult( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.AuditResult - value) { - if (value == null) { - throw new NullPointerException(); - } - - result_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-         * The result of the audit for this image.
-         * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * - * - * @return This builder for chaining. - */ - public Builder clearResult() { - - result_ = 0; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - * - * - *
-         * Description of the above result.
-         * 
- * - * string description = 3; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * Description of the above result.
-         * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * Description of the above result.
-         * 
- * - * string description = 3; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Description of the above result.
-         * 
- * - * string description = 3; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * - * - *
-         * Description of the above result.
-         * 
- * - * string description = 3; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = 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.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails) - private static final com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ImageDetails parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ImageDetails(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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int POD_FIELD_NUMBER = 1; - private volatile java.lang.Object pod_; - /** - * - * - *
-     * The name of the Pod.
-     * 
- * - * string pod = 1; - * - * @return The pod. - */ - @java.lang.Override - public java.lang.String getPod() { - java.lang.Object ref = pod_; - 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(); - pod_ = s; - return s; - } - } - /** - * - * - *
-     * The name of the Pod.
-     * 
- * - * string pod = 1; - * - * @return The bytes for pod. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPodBytes() { - java.lang.Object ref = pod_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPLOY_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp deployTime_; - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return Whether the deployTime field is set. - */ - @java.lang.Override - public boolean hasDeployTime() { - return deployTime_ != null; - } - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return The deployTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getDeployTime() { - return deployTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deployTime_; - } - /** - * - * - *
-     * Deploy time of the Pod from k8s.
-     * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder() { - return getDeployTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp endTime_; - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getEndTime() { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - /** - * - * - *
-     * Termination time of the Pod from k8s, or nothing if still running.
-     * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - public static final int VERDICT_FIELD_NUMBER = 4; - private int verdict_; - /** - * - * - *
-     * Auditing verdict for this Pod.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The enum numeric value on the wire for verdict. - */ - @java.lang.Override - public int getVerdictValue() { - return verdict_; - } - /** - * - * - *
-     * Auditing verdict for this Pod.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The verdict. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - getVerdict() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - result = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict.valueOf(verdict_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict.UNRECOGNIZED - : result; - } - - public static final int IMAGES_FIELD_NUMBER = 5; - private java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - images_; - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - @java.lang.Override - public java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - getImagesList() { - return images_; - } - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - @java.lang.Override - public java.util.List< - ? extends - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder> - getImagesOrBuilderList() { - return images_; - } - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - @java.lang.Override - public int getImagesCount() { - return images_.size(); - } - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getImages(int index) { - return images_.get(index); - } - /** - * - * - *
-     * List of images with auditing details.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder - getImagesOrBuilder(int index) { - return images_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getPodBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pod_); - } - if (deployTime_ != null) { - output.writeMessage(2, getDeployTime()); - } - if (endTime_ != null) { - output.writeMessage(3, getEndTime()); - } - if (verdict_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - .POLICY_CONFORMANCE_VERDICT_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, verdict_); - } - for (int i = 0; i < images_.size(); i++) { - output.writeMessage(5, images_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPodBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pod_); - } - if (deployTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeployTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); - } - if (verdict_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - .POLICY_CONFORMANCE_VERDICT_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, verdict_); - } - for (int i = 0; i < images_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, images_.get(i)); - } - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - other = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - obj; - - if (!getPod().equals(other.getPod())) return false; - if (hasDeployTime() != other.hasDeployTime()) return false; - if (hasDeployTime()) { - if (!getDeployTime().equals(other.getDeployTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime().equals(other.getEndTime())) return false; - } - if (verdict_ != other.verdict_) return false; - if (!getImagesList().equals(other.getImagesList())) 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) + POD_FIELD_NUMBER; - hash = (53 * hash) + getPod().hashCode(); - if (hasDeployTime()) { - hash = (37 * hash) + DEPLOY_TIME_FIELD_NUMBER; - hash = (53 * hash) + getDeployTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (37 * hash) + VERDICT_FIELD_NUMBER; - hash = (53 * hash) + verdict_; - if (getImagesCount() > 0) { - hash = (37 * hash) + IMAGES_FIELD_NUMBER; - hash = (53 * hash) + getImagesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - 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 auditing event for one Pod.
-     * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getImagesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - pod_ = ""; - - if (deployTimeBuilder_ == null) { - deployTime_ = null; - } else { - deployTime_ = null; - deployTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - verdict_ = 0; - - if (imagesBuilder_ == null) { - images_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - imagesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - build() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - result = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent(this); - int from_bitField0_ = bitField0_; - result.pod_ = pod_; - if (deployTimeBuilder_ == null) { - result.deployTime_ = deployTime_; - } else { - result.deployTime_ = deployTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.verdict_ = verdict_; - if (imagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - images_ = java.util.Collections.unmodifiableList(images_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.images_ = images_; - } else { - result.images_ = imagesBuilder_.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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance()) return this; - if (!other.getPod().isEmpty()) { - pod_ = other.pod_; - onChanged(); - } - if (other.hasDeployTime()) { - mergeDeployTime(other.getDeployTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - if (other.verdict_ != 0) { - setVerdictValue(other.getVerdictValue()); - } - if (imagesBuilder_ == null) { - if (!other.images_.isEmpty()) { - if (images_.isEmpty()) { - images_ = other.images_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureImagesIsMutable(); - images_.addAll(other.images_); - } - onChanged(); - } - } else { - if (!other.images_.isEmpty()) { - if (imagesBuilder_.isEmpty()) { - imagesBuilder_.dispose(); - imagesBuilder_ = null; - images_ = other.images_; - bitField0_ = (bitField0_ & ~0x00000001); - imagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getImagesFieldBuilder() - : null; - } else { - imagesBuilder_.addAllMessages(other.images_); - } - } - } - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object pod_ = ""; - /** - * - * - *
-       * The name of the Pod.
-       * 
- * - * string pod = 1; - * - * @return The pod. - */ - public java.lang.String getPod() { - java.lang.Object ref = pod_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pod_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The name of the Pod.
-       * 
- * - * string pod = 1; - * - * @return The bytes for pod. - */ - public com.google.protobuf.ByteString getPodBytes() { - java.lang.Object ref = pod_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The name of the Pod.
-       * 
- * - * string pod = 1; - * - * @param value The pod to set. - * @return This builder for chaining. - */ - public Builder setPod(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pod_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the Pod.
-       * 
- * - * string pod = 1; - * - * @return This builder for chaining. - */ - public Builder clearPod() { - - pod_ = getDefaultInstance().getPod(); - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the Pod.
-       * 
- * - * string pod = 1; - * - * @param value The bytes for pod to set. - * @return This builder for chaining. - */ - public Builder setPodBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pod_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp deployTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - deployTimeBuilder_; - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return Whether the deployTime field is set. - */ - public boolean hasDeployTime() { - return deployTimeBuilder_ != null || deployTime_ != null; - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - * - * @return The deployTime. - */ - public com.google.protobuf.Timestamp getDeployTime() { - if (deployTimeBuilder_ == null) { - return deployTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : deployTime_; - } else { - return deployTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public Builder setDeployTime(com.google.protobuf.Timestamp value) { - if (deployTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deployTime_ = value; - onChanged(); - } else { - deployTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public Builder setDeployTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (deployTimeBuilder_ == null) { - deployTime_ = builderForValue.build(); - onChanged(); - } else { - deployTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public Builder mergeDeployTime(com.google.protobuf.Timestamp value) { - if (deployTimeBuilder_ == null) { - if (deployTime_ != null) { - deployTime_ = - com.google.protobuf.Timestamp.newBuilder(deployTime_) - .mergeFrom(value) - .buildPartial(); - } else { - deployTime_ = value; - } - onChanged(); - } else { - deployTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public Builder clearDeployTime() { - if (deployTimeBuilder_ == null) { - deployTime_ = null; - onChanged(); - } else { - deployTime_ = null; - deployTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getDeployTimeBuilder() { - - onChanged(); - return getDeployTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder() { - if (deployTimeBuilder_ != null) { - return deployTimeBuilder_.getMessageOrBuilder(); - } else { - return deployTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : deployTime_; - } - } - /** - * - * - *
-       * Deploy time of the Pod from k8s.
-       * 
- * - * .google.protobuf.Timestamp deploy_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getDeployTimeFieldBuilder() { - if (deployTimeBuilder_ == null) { - deployTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getDeployTime(), getParentForChildren(), isClean()); - deployTime_ = null; - } - return deployTimeBuilder_; - } - - private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - endTimeBuilder_; - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - * - * @return The endTime. - */ - public com.google.protobuf.Timestamp getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public Builder setEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public Builder mergeEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - } - /** - * - * - *
-       * Termination time of the Pod from k8s, or nothing if still running.
-       * 
- * - * .google.protobuf.Timestamp end_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getEndTime(), getParentForChildren(), isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - - private int verdict_ = 0; - /** - * - * - *
-       * Auditing verdict for this Pod.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The enum numeric value on the wire for verdict. - */ - @java.lang.Override - public int getVerdictValue() { - return verdict_; - } - /** - * - * - *
-       * Auditing verdict for this Pod.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @param value The enum numeric value on the wire for verdict to set. - * @return This builder for chaining. - */ - public Builder setVerdictValue(int value) { - - verdict_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Auditing verdict for this Pod.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return The verdict. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - getVerdict() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - result = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict.valueOf(verdict_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict.UNRECOGNIZED - : result; - } - /** - * - * - *
-       * Auditing verdict for this Pod.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @param value The verdict to set. - * @return This builder for chaining. - */ - public Builder setVerdict( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.PolicyConformanceVerdict - value) { - if (value == null) { - throw new NullPointerException(); - } - - verdict_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * Auditing verdict for this Pod.
-       * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * - * - * @return This builder for chaining. - */ - public Builder clearVerdict() { - - verdict_ = 0; - onChanged(); - return this; - } - - private java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - images_ = java.util.Collections.emptyList(); - - private void ensureImagesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - images_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails>(images_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder> - imagesBuilder_; - - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - getImagesList() { - if (imagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(images_); - } else { - return imagesBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public int getImagesCount() { - if (imagesBuilder_ == null) { - return images_.size(); - } else { - return imagesBuilder_.getCount(); - } - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - getImages(int index) { - if (imagesBuilder_ == null) { - return images_.get(index); - } else { - return imagesBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder setImages( - int index, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - value) { - if (imagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureImagesIsMutable(); - images_.set(index, value); - onChanged(); - } else { - imagesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder setImages( - int index, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.set(index, builderForValue.build()); - onChanged(); - } else { - imagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder addImages( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - value) { - if (imagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureImagesIsMutable(); - images_.add(value); - onChanged(); - } else { - imagesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder addImages( - int index, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails - value) { - if (imagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureImagesIsMutable(); - images_.add(index, value); - onChanged(); - } else { - imagesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder addImages( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.add(builderForValue.build()); - onChanged(); - } else { - imagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder addImages( - int index, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - builderForValue) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.add(index, builderForValue.build()); - onChanged(); - } else { - imagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder addAllImages( - java.lang.Iterable< - ? extends - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails> - values) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); - onChanged(); - } else { - imagesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder clearImages() { - if (imagesBuilder_ == null) { - images_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - imagesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public Builder removeImages(int index) { - if (imagesBuilder_ == null) { - ensureImagesIsMutable(); - images_.remove(index); - onChanged(); - } else { - imagesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - getImagesBuilder(int index) { - return getImagesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder - getImagesOrBuilder(int index) { - if (imagesBuilder_ == null) { - return images_.get(index); - } else { - return imagesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public java.util.List< - ? extends - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder> - getImagesOrBuilderList() { - if (imagesBuilder_ != null) { - return imagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(images_); - } - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - addImagesBuilder() { - return getImagesFieldBuilder() - .addBuilder( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.getDefaultInstance()); - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder - addImagesBuilder(int index) { - return getImagesFieldBuilder() - .addBuilder( - index, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.getDefaultInstance()); - } - /** - * - * - *
-       * List of images with auditing details.
-       * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * - */ - public java.util.List< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder> - getImagesBuilderList() { - return getImagesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder> - getImagesFieldBuilder() { - if (imagesBuilder_ == null) { - imagesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetails.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.ImageDetailsOrBuilder>( - images_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - images_ = null; - } - return imagesBuilder_; - } - - @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.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) - private static final com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ContinuousValidationPodEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ContinuousValidationPodEvent(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.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface UnsupportedPolicyEventOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * A description of the unsupported policy.
-     * 
- * - * string description = 1; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-     * A description of the unsupported policy.
-     * 
- * - * string description = 1; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - } - /** - * - * - *
-   * An event describing that the project policy is unsupported by CV.
-   * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent} - */ - public static final class UnsupportedPolicyEvent extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent) - UnsupportedPolicyEventOrBuilder { - private static final long serialVersionUID = 0L; - // Use UnsupportedPolicyEvent.newBuilder() to construct. - private UnsupportedPolicyEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UnsupportedPolicyEvent() { - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UnsupportedPolicyEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UnsupportedPolicyEvent( - 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(); - - description_ = 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.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder.class); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 1; - private volatile java.lang.Object description_; - /** - * - * - *
-     * A description of the unsupported policy.
-     * 
- * - * string description = 1; - * - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - * - * - *
-     * A description of the unsupported policy.
-     * 
- * - * string description = 1; - * - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = 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 (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); - } - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent - other = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - obj; - - if (!getDescription().equals(other.getDescription())) 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) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - 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 event describing that the project policy is unsupported by CV.
-     * 
- * - * Protobuf type {@code - * google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent) - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent.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(); - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - build() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - result = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent(this); - result.description_ = description_; - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance()) return this; - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - 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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object description_ = ""; - /** - * - * - *
-       * A description of the unsupported policy.
-       * 
- * - * string description = 1; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * A description of the unsupported policy.
-       * 
- * - * string description = 1; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * A description of the unsupported policy.
-       * 
- * - * string description = 1; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * A description of the unsupported policy.
-       * 
- * - * string description = 1; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * - * - *
-       * A description of the unsupported policy.
-       * 
- * - * string description = 1; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = 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.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent) - private static final com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UnsupportedPolicyEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UnsupportedPolicyEvent(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.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int eventTypeCase_ = 0; - private java.lang.Object eventType_; - - public enum EventTypeCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - POD_EVENT(1), - UNSUPPORTED_POLICY_EVENT(2), - EVENTTYPE_NOT_SET(0); - private final int value; - - private EventTypeCase(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 EventTypeCase valueOf(int value) { - return forNumber(value); - } - - public static EventTypeCase forNumber(int value) { - switch (value) { - case 1: - return POD_EVENT; - case 2: - return UNSUPPORTED_POLICY_EVENT; - case 0: - return EVENTTYPE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public EventTypeCase getEventTypeCase() { - return EventTypeCase.forNumber(eventTypeCase_); - } - - public static final int POD_EVENT_FIELD_NUMBER = 1; - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return Whether the podEvent field is set. - */ - @java.lang.Override - public boolean hasPodEvent() { - return eventTypeCase_ == 1; - } - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return The podEvent. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getPodEvent() { - if (eventTypeCase_ == 1) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder - getPodEventOrBuilder() { - if (eventTypeCase_ == 1) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - - public static final int UNSUPPORTED_POLICY_EVENT_FIELD_NUMBER = 2; - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return Whether the unsupportedPolicyEvent field is set. - */ - @java.lang.Override - public boolean hasUnsupportedPolicyEvent() { - return eventTypeCase_ == 2; - } - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return The unsupportedPolicyEvent. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - getUnsupportedPolicyEvent() { - if (eventTypeCase_ == 2) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder - getUnsupportedPolicyEventOrBuilder() { - if (eventTypeCase_ == 2) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - - 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 (eventTypeCase_ == 1) { - output.writeMessage( - 1, - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_); - } - if (eventTypeCase_ == 2) { - output.writeMessage( - 2, - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (eventTypeCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_); - } - if (eventTypeCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_); - } - 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.binaryauthorization.v1beta1.ContinuousValidationEvent)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent other = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) obj; - - if (!getEventTypeCase().equals(other.getEventTypeCase())) return false; - switch (eventTypeCase_) { - case 1: - if (!getPodEvent().equals(other.getPodEvent())) return false; - break; - case 2: - if (!getUnsupportedPolicyEvent().equals(other.getUnsupportedPolicyEvent())) 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(); - switch (eventTypeCase_) { - case 1: - hash = (37 * hash) + POD_EVENT_FIELD_NUMBER; - hash = (53 * hash) + getPodEvent().hashCode(); - break; - case 2: - hash = (37 * hash) + UNSUPPORTED_POLICY_EVENT_FIELD_NUMBER; - hash = (53 * hash) + getUnsupportedPolicyEvent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent 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.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent 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.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent 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.binaryauthorization.v1beta1.ContinuousValidationEvent - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - 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.binaryauthorization.v1beta1.ContinuousValidationEvent parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent 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.binaryauthorization.v1beta1.ContinuousValidationEvent prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Represents an auditing event from Continuous Validation.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.class, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.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(); - eventTypeCase_ = 0; - eventType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationLoggingProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent build() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent result = - new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent(this); - if (eventTypeCase_ == 1) { - if (podEventBuilder_ == null) { - result.eventType_ = eventType_; - } else { - result.eventType_ = podEventBuilder_.build(); - } - } - if (eventTypeCase_ == 2) { - if (unsupportedPolicyEventBuilder_ == null) { - result.eventType_ = eventType_; - } else { - result.eventType_ = unsupportedPolicyEventBuilder_.build(); - } - } - result.eventTypeCase_ = eventTypeCase_; - 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.binaryauthorization.v1beta1.ContinuousValidationEvent) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .getDefaultInstance()) return this; - switch (other.getEventTypeCase()) { - case POD_EVENT: - { - mergePodEvent(other.getPodEvent()); - break; - } - case UNSUPPORTED_POLICY_EVENT: - { - mergeUnsupportedPolicyEvent(other.getUnsupportedPolicyEvent()); - break; - } - case EVENTTYPE_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.binaryauthorization.v1beta1.ContinuousValidationEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int eventTypeCase_ = 0; - private java.lang.Object eventType_; - - public EventTypeCase getEventTypeCase() { - return EventTypeCase.forNumber(eventTypeCase_); - } - - public Builder clearEventType() { - eventTypeCase_ = 0; - eventType_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder> - podEventBuilder_; - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return Whether the podEvent field is set. - */ - @java.lang.Override - public boolean hasPodEvent() { - return eventTypeCase_ == 1; - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return The podEvent. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getPodEvent() { - if (podEventBuilder_ == null) { - if (eventTypeCase_ == 1) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } else { - if (eventTypeCase_ == 1) { - return podEventBuilder_.getMessage(); - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - public Builder setPodEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - value) { - if (podEventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - eventType_ = value; - onChanged(); - } else { - podEventBuilder_.setMessage(value); - } - eventTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - public Builder setPodEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder - builderForValue) { - if (podEventBuilder_ == null) { - eventType_ = builderForValue.build(); - onChanged(); - } else { - podEventBuilder_.setMessage(builderForValue.build()); - } - eventTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - public Builder mergePodEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - value) { - if (podEventBuilder_ == null) { - if (eventTypeCase_ == 1 - && eventType_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance()) { - eventType_ = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.newBuilder( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_) - .mergeFrom(value) - .buildPartial(); - } else { - eventType_ = value; - } - onChanged(); - } else { - if (eventTypeCase_ == 1) { - podEventBuilder_.mergeFrom(value); - } - podEventBuilder_.setMessage(value); - } - eventTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - public Builder clearPodEvent() { - if (podEventBuilder_ == null) { - if (eventTypeCase_ == 1) { - eventTypeCase_ = 0; - eventType_ = null; - onChanged(); - } - } else { - if (eventTypeCase_ == 1) { - eventTypeCase_ = 0; - eventType_ = null; - } - podEventBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder - getPodEventBuilder() { - return getPodEventFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder - getPodEventOrBuilder() { - if ((eventTypeCase_ == 1) && (podEventBuilder_ != null)) { - return podEventBuilder_.getMessageOrBuilder(); - } else { - if (eventTypeCase_ == 1) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - } - /** - * - * - *
-     * Pod event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder> - getPodEventFieldBuilder() { - if (podEventBuilder_ == null) { - if (!(eventTypeCase_ == 1)) { - eventType_ = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.getDefaultInstance(); - } - podEventBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder>( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent) - eventType_, - getParentForChildren(), - isClean()); - eventType_ = null; - } - eventTypeCase_ = 1; - onChanged(); - ; - return podEventBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder> - unsupportedPolicyEventBuilder_; - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return Whether the unsupportedPolicyEvent field is set. - */ - @java.lang.Override - public boolean hasUnsupportedPolicyEvent() { - return eventTypeCase_ == 2; - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return The unsupportedPolicyEvent. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - getUnsupportedPolicyEvent() { - if (unsupportedPolicyEventBuilder_ == null) { - if (eventTypeCase_ == 2) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } else { - if (eventTypeCase_ == 2) { - return unsupportedPolicyEventBuilder_.getMessage(); - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - public Builder setUnsupportedPolicyEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - value) { - if (unsupportedPolicyEventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - eventType_ = value; - onChanged(); - } else { - unsupportedPolicyEventBuilder_.setMessage(value); - } - eventTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - public Builder setUnsupportedPolicyEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder - builderForValue) { - if (unsupportedPolicyEventBuilder_ == null) { - eventType_ = builderForValue.build(); - onChanged(); - } else { - unsupportedPolicyEventBuilder_.setMessage(builderForValue.build()); - } - eventTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - public Builder mergeUnsupportedPolicyEvent( - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent - value) { - if (unsupportedPolicyEventBuilder_ == null) { - if (eventTypeCase_ == 2 - && eventType_ - != com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance()) { - eventType_ = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.newBuilder( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_) - .mergeFrom(value) - .buildPartial(); - } else { - eventType_ = value; - } - onChanged(); - } else { - if (eventTypeCase_ == 2) { - unsupportedPolicyEventBuilder_.mergeFrom(value); - } - unsupportedPolicyEventBuilder_.setMessage(value); - } - eventTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - public Builder clearUnsupportedPolicyEvent() { - if (unsupportedPolicyEventBuilder_ == null) { - if (eventTypeCase_ == 2) { - eventTypeCase_ = 0; - eventType_ = null; - onChanged(); - } - } else { - if (eventTypeCase_ == 2) { - eventTypeCase_ = 0; - eventType_ = null; - } - unsupportedPolicyEventBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder - getUnsupportedPolicyEventBuilder() { - return getUnsupportedPolicyEventFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder - getUnsupportedPolicyEventOrBuilder() { - if ((eventTypeCase_ == 2) && (unsupportedPolicyEventBuilder_ != null)) { - return unsupportedPolicyEventBuilder_.getMessageOrBuilder(); - } else { - if (eventTypeCase_ == 2) { - return (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_; - } - return com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - } - /** - * - * - *
-     * Unsupported policy event.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder> - getUnsupportedPolicyEventFieldBuilder() { - if (unsupportedPolicyEventBuilder_ == null) { - if (!(eventTypeCase_ == 2)) { - eventType_ = - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.getDefaultInstance(); - } - unsupportedPolicyEventBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent.Builder, - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder>( - (com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEvent) - eventType_, - getParentForChildren(), - isClean()); - eventType_ = null; - } - eventTypeCase_ = 2; - onChanged(); - ; - return unsupportedPolicyEventBuilder_; - } - - @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.binaryauthorization.v1beta1.ContinuousValidationEvent) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) - private static final com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ContinuousValidationEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ContinuousValidationEvent(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.binaryauthorization.v1beta1.ContinuousValidationEvent - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEventOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEventOrBuilder.java deleted file mode 100644 index 815dcdd8..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEventOrBuilder.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/continuous_validation_logging.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface ContinuousValidationEventOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return Whether the podEvent field is set. - */ - boolean hasPodEvent(); - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - * - * @return The podEvent. - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEvent - getPodEvent(); - /** - * - * - *
-   * Pod event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .ContinuousValidationPodEventOrBuilder - getPodEventOrBuilder(); - - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return Whether the unsupportedPolicyEvent field is set. - */ - boolean hasUnsupportedPolicyEvent(); - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - * - * @return The unsupportedPolicyEvent. - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent - getUnsupportedPolicyEvent(); - /** - * - * - *
-   * Unsupported policy event.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent unsupported_policy_event = 2; - * - */ - com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - .UnsupportedPolicyEventOrBuilder - getUnsupportedPolicyEventOrBuilder(); - - public com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.EventTypeCase - getEventTypeCase(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java deleted file mode 100644 index 7d29c3d0..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/continuous_validation_logging.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public final class ContinuousValidationLoggingProto { - private ContinuousValidationLoggingProto() {} - - 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_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\nLgoogle/cloud/binaryauthorization/v1bet" - + "a1/continuous_validation_logging.proto\022(" - + "google.cloud.binaryauthorization.v1beta1" - + "\032\037google/protobuf/timestamp.proto\"\310\010\n\031Co" - + "ntinuousValidationEvent\022u\n\tpod_event\030\001 \001" - + "(\0132`.google.cloud.binaryauthorization.v1" - + "beta1.ContinuousValidationEvent.Continuo" - + "usValidationPodEventH\000\022~\n\030unsupported_po" - + "licy_event\030\002 \001(\0132Z.google.cloud.binaryau" - + "thorization.v1beta1.ContinuousValidation" - + "Event.UnsupportedPolicyEventH\000\032\366\005\n\034Conti" - + "nuousValidationPodEvent\022\013\n\003pod\030\001 \001(\t\022/\n\013" - + "deploy_time\030\002 \001(\0132\032.google.protobuf.Time" - + "stamp\022,\n\010end_time\030\003 \001(\0132\032.google.protobu" - + "f.Timestamp\022\212\001\n\007verdict\030\004 \001(\0162y.google.c" - + "loud.binaryauthorization.v1beta1.Continu" - + "ousValidationEvent.ContinuousValidationP" - + "odEvent.PolicyConformanceVerdict\022}\n\006imag" - + "es\030\005 \003(\0132m.google.cloud.binaryauthorizat" - + "ion.v1beta1.ContinuousValidationEvent.Co" - + "ntinuousValidationPodEvent.ImageDetails\032" - + "\200\002\n\014ImageDetails\022\r\n\005image\030\001 \001(\t\022\211\001\n\006resu" - + "lt\030\002 \001(\0162y.google.cloud.binaryauthorizat" - + "ion.v1beta1.ContinuousValidationEvent.Co" - + "ntinuousValidationPodEvent.ImageDetails." - + "AuditResult\022\023\n\013description\030\003 \001(\t\"@\n\013Audi" - + "tResult\022\034\n\030AUDIT_RESULT_UNSPECIFIED\020\000\022\t\n" - + "\005ALLOW\020\001\022\010\n\004DENY\020\002\"[\n\030PolicyConformanceV" - + "erdict\022*\n&POLICY_CONFORMANCE_VERDICT_UNS" - + "PECIFIED\020\000\022\023\n\017VIOLATES_POLICY\020\001\032-\n\026Unsup" - + "portedPolicyEvent\022\023\n\013description\030\001 \001(\tB\014" - + "\n\nevent_typeB\266\002\n,com.google.cloud.binary" - + "authorization.v1beta1B ContinuousValidat" - + "ionLoggingProtoP\001Z[google.golang.org/gen" - + "proto/googleapis/cloud/binaryauthorizati" - + "on/v1beta1;binaryauthorization\370\001\001\252\002(Goog" - + "le.Cloud.BinaryAuthorization.V1Beta1\312\002(G" - + "oogle\\Cloud\\BinaryAuthorization\\V1beta1\352" - + "\002+Google::Cloud::BinaryAuthorization::V1" - + "beta1b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.TimestampProto.getDescriptor(), - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor, - new java.lang.String[] { - "PodEvent", "UnsupportedPolicyEvent", "EventType", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor = - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor, - new java.lang.String[] { - "Pod", "DeployTime", "EndTime", "Verdict", "Images", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor = - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor, - new java.lang.String[] { - "Image", "Result", "Description", - }); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor = - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_descriptor - .getNestedTypes() - .get(1); - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_UnsupportedPolicyEvent_descriptor, - new java.lang.String[] { - "Description", - }); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequest.java deleted file mode 100644 index d749d7d4..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequest.java +++ /dev/null @@ -1,1206 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.CreateAttestor][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest} - */ -public final class CreateAttestorRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) - CreateAttestorRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateAttestorRequest.newBuilder() to construct. - private CreateAttestorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateAttestorRequest() { - parent_ = ""; - attestorId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateAttestorRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateAttestorRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - attestorId_ = s; - break; - } - case 26: - { - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder subBuilder = null; - if (attestor_ != null) { - subBuilder = attestor_.toBuilder(); - } - attestor_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.Attestor.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(attestor_); - attestor_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. The parent of this
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * - * 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 parent of this
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * - * 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 ATTESTOR_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object attestorId_; - /** - * - * - *
-   * Required. The
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-   * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attestorId. - */ - @java.lang.Override - public java.lang.String getAttestorId() { - java.lang.Object ref = attestorId_; - 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(); - attestorId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-   * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attestorId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAttestorIdBytes() { - java.lang.Object ref = attestorId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - attestorId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTESTOR_FIELD_NUMBER = 3; - private com.google.cloud.binaryauthorization.v1beta1.Attestor attestor_; - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - @java.lang.Override - public boolean hasAttestor() { - return attestor_ != null; - } - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor() { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder() { - return getAttestor(); - } - - 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 (!getAttestorIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attestorId_); - } - if (attestor_ != null) { - output.writeMessage(3, getAttestor()); - } - 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 (!getAttestorIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attestorId_); - } - if (attestor_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAttestor()); - } - 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.binaryauthorization.v1beta1.CreateAttestorRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest other = - (com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (!getAttestorId().equals(other.getAttestorId())) return false; - if (hasAttestor() != other.hasAttestor()) return false; - if (hasAttestor()) { - if (!getAttestor().equals(other.getAttestor())) 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) + ATTESTOR_ID_FIELD_NUMBER; - hash = (53 * hash) + getAttestorId().hashCode(); - if (hasAttestor()) { - hash = (37 * hash) + ATTESTOR_FIELD_NUMBER; - hash = (53 * hash) + getAttestor().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest 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.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest 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.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest 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.binaryauthorization.v1beta1.CreateAttestorRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - 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.binaryauthorization.v1beta1.CreateAttestorRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest 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.binaryauthorization.v1beta1.CreateAttestorRequest 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 message for [BinauthzManagementService.CreateAttestor][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest.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_ = ""; - - attestorId_ = ""; - - if (attestorBuilder_ == null) { - attestor_ = null; - } else { - attestor_ = null; - attestorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_CreateAttestorRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest build() { - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest result = - new com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest(this); - result.parent_ = parent_; - result.attestorId_ = attestorId_; - if (attestorBuilder_ == null) { - result.attestor_ = attestor_; - } else { - result.attestor_ = attestorBuilder_.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.binaryauthorization.v1beta1.CreateAttestorRequest) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - .getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getAttestorId().isEmpty()) { - attestorId_ = other.attestorId_; - onChanged(); - } - if (other.hasAttestor()) { - mergeAttestor(other.getAttestor()); - } - 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.binaryauthorization.v1beta1.CreateAttestorRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The parent of this
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The parent of this
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The parent of this
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent of this
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent of this
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object attestorId_ = ""; - /** - * - * - *
-     * Required. The
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-     * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attestorId. - */ - public java.lang.String getAttestorId() { - java.lang.Object ref = attestorId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - attestorId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-     * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attestorId. - */ - public com.google.protobuf.ByteString getAttestorIdBytes() { - java.lang.Object ref = attestorId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - attestorId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-     * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The attestorId to set. - * @return This builder for chaining. - */ - public Builder setAttestorId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - attestorId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-     * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAttestorId() { - - attestorId_ = getDefaultInstance().getAttestorId(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-     * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for attestorId to set. - * @return This builder for chaining. - */ - public Builder setAttestorIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - attestorId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.binaryauthorization.v1beta1.Attestor attestor_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - attestorBuilder_; - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - public boolean hasAttestor() { - return attestorBuilder_ != null || attestor_ != null; - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor() { - if (attestorBuilder_ == null) { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } else { - return attestorBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAttestor(com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - attestor_ = value; - onChanged(); - } else { - attestorBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAttestor( - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder builderForValue) { - if (attestorBuilder_ == null) { - attestor_ = builderForValue.build(); - onChanged(); - } else { - attestorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAttestor(com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorBuilder_ == null) { - if (attestor_ != null) { - attestor_ = - com.google.cloud.binaryauthorization.v1beta1.Attestor.newBuilder(attestor_) - .mergeFrom(value) - .buildPartial(); - } else { - attestor_ = value; - } - onChanged(); - } else { - attestorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAttestor() { - if (attestorBuilder_ == null) { - attestor_ = null; - onChanged(); - } else { - attestor_ = null; - attestorBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder getAttestorBuilder() { - - onChanged(); - return getAttestorFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder() { - if (attestorBuilder_ != null) { - return attestorBuilder_.getMessageOrBuilder(); - } else { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } - } - /** - * - * - *
-     * Required. The initial
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name, in the format `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - getAttestorFieldBuilder() { - if (attestorBuilder_ == null) { - attestorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder>( - getAttestor(), getParentForChildren(), isClean()); - attestor_ = null; - } - return attestorBuilder_; - } - - @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.binaryauthorization.v1beta1.CreateAttestorRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateAttestorRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateAttestorRequest(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.binaryauthorization.v1beta1.CreateAttestorRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequestOrBuilder.java deleted file mode 100644 index c960539c..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/CreateAttestorRequestOrBuilder.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface CreateAttestorRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The parent of this
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The parent of this
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Required. The
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-   * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attestorId. - */ - java.lang.String getAttestorId(); - /** - * - * - *
-   * Required. The
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID.
-   * 
- * - * string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attestorId. - */ - com.google.protobuf.ByteString getAttestorIdBytes(); - - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - boolean hasAttestor(); - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor(); - /** - * - * - *
-   * Required. The initial
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name, in the format `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequest.java deleted file mode 100644 index d61f0bae..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequest.java +++ /dev/null @@ -1,676 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.DeleteAttestor][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest} - */ -public final class DeleteAttestorRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) - DeleteAttestorRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteAttestorRequest.newBuilder() to construct. - private DeleteAttestorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteAttestorRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteAttestorRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteAttestorRequest( - 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The name of the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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 of the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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.binaryauthorization.v1beta1.DeleteAttestorRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest other = - (com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) 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.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest 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.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest 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.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest 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.binaryauthorization.v1beta1.DeleteAttestorRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - 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.binaryauthorization.v1beta1.DeleteAttestorRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest 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.binaryauthorization.v1beta1.DeleteAttestorRequest 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 message for [BinauthzManagementService.DeleteAttestor][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest.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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_DeleteAttestorRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest build() { - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest result = - new com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest(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.binaryauthorization.v1beta1.DeleteAttestorRequest) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - .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.binaryauthorization.v1beta1.DeleteAttestorRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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.binaryauthorization.v1beta1.DeleteAttestorRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteAttestorRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteAttestorRequest(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.binaryauthorization.v1beta1.DeleteAttestorRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequestOrBuilder.java deleted file mode 100644 index 0b498fed..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/DeleteAttestorRequestOrBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface DeleteAttestorRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The name of the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequest.java deleted file mode 100644 index b6ae0207..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequest.java +++ /dev/null @@ -1,672 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.GetAttestor][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.GetAttestorRequest} - */ -public final class GetAttestorRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) - GetAttestorRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetAttestorRequest.newBuilder() to construct. - private GetAttestorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetAttestorRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetAttestorRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetAttestorRequest( - 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The name of the
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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 of the
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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.binaryauthorization.v1beta1.GetAttestorRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest other = - (com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) 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.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest 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.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest 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.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest 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.binaryauthorization.v1beta1.GetAttestorRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest 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.binaryauthorization.v1beta1.GetAttestorRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest 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.binaryauthorization.v1beta1.GetAttestorRequest 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 message for [BinauthzManagementService.GetAttestor][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.GetAttestorRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetAttestorRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest build() { - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest result = - new com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest(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.binaryauthorization.v1beta1.GetAttestorRequest) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest.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.binaryauthorization.v1beta1.GetAttestorRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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 of the
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-     * in the format `projects/*/attestors/*`.
-     * 
- * - * - * 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.binaryauthorization.v1beta1.GetAttestorRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetAttestorRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetAttestorRequest(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.binaryauthorization.v1beta1.GetAttestorRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequestOrBuilder.java deleted file mode 100644 index 30444044..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetAttestorRequestOrBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface GetAttestorRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.GetAttestorRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The name of the
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve,
-   * in the format `projects/*/attestors/*`.
-   * 
- * - * - * 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-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequest.java deleted file mode 100644 index 1fea3b86..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequest.java +++ /dev/null @@ -1,669 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.GetPolicy][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.GetPolicyRequest} - */ -public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) - GetPolicyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetPolicyRequest.newBuilder() to construct. - private GetPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetPolicyRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetPolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetPolicyRequest( - 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.class, - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Required. The resource name of the
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-   * the format `projects/*/policy`.
-   * 
- * - * - * 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
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-   * the format `projects/*/policy`.
-   * 
- * - * - * 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.binaryauthorization.v1beta1.GetPolicyRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest other = - (com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) 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.binaryauthorization.v1beta1.GetPolicyRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest 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.binaryauthorization.v1beta1.GetPolicyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest 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.binaryauthorization.v1beta1.GetPolicyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest 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.binaryauthorization.v1beta1.GetPolicyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest 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.binaryauthorization.v1beta1.GetPolicyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest 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.binaryauthorization.v1beta1.GetPolicyRequest 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 message for [BinauthzManagementService.GetPolicy][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.GetPolicyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.class, - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_GetPolicyRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest build() { - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest result = - new com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest(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.binaryauthorization.v1beta1.GetPolicyRequest) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest.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.binaryauthorization.v1beta1.GetPolicyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The resource name of the
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-     * the format `projects/*/policy`.
-     * 
- * - * - * 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
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-     * the format `projects/*/policy`.
-     * 
- * - * - * 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
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-     * the format `projects/*/policy`.
-     * 
- * - * - * 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
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-     * the format `projects/*/policy`.
-     * 
- * - * - * 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
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-     * the format `projects/*/policy`.
-     * 
- * - * - * 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.binaryauthorization.v1beta1.GetPolicyRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetPolicyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPolicyRequest(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.binaryauthorization.v1beta1.GetPolicyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequestOrBuilder.java deleted file mode 100644 index 74f36848..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/GetPolicyRequestOrBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface GetPolicyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.GetPolicyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The resource name of the
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-   * the format `projects/*/policy`.
-   * 
- * - * - * 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
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in
-   * the format `projects/*/policy`.
-   * 
- * - * - * 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-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequest.java deleted file mode 100644 index 5b96626a..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequest.java +++ /dev/null @@ -1,968 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.ListAttestors][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest} - */ -public final class ListAttestorsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - ListAttestorsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListAttestorsRequest.newBuilder() to construct. - private ListAttestorsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListAttestorsRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListAttestorsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListAttestorsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.class, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-   * Required. The resource name of the project associated with the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-   * format `projects/*`.
-   * 
- * - * - * 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 project associated with the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-   * format `projects/*`.
-   * 
- * - * - * 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_; - /** - * - * - *
-   * Requested page size. The server may return fewer results than requested. If
-   * unspecified, the server will pick an appropriate default.
-   * 
- * - * 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_; - /** - * - * - *
-   * A token identifying a page of results the server should return. Typically,
-   * this is the value of
-   * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-   * returned from the previous call to the `ListAttestors` method.
-   * 
- * - * 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; - } - } - /** - * - * - *
-   * A token identifying a page of results the server should return. Typically,
-   * this is the value of
-   * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-   * returned from the previous call to the `ListAttestors` method.
-   * 
- * - * 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; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest other = - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest 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.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest 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.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest 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.binaryauthorization.v1beta1.ListAttestorsRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - 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.binaryauthorization.v1beta1.ListAttestorsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest 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.binaryauthorization.v1beta1.ListAttestorsRequest 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 message for [BinauthzManagementService.ListAttestors][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.class, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest build() { - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest result = - new com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.getDefaultInstance()) - return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The resource name of the project associated with the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-     * format `projects/*`.
-     * 
- * - * - * 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 project associated with the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-     * format `projects/*`.
-     * 
- * - * - * 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 project associated with the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-     * format `projects/*`.
-     * 
- * - * - * 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 project associated with the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-     * format `projects/*`.
-     * 
- * - * - * 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 project associated with the
-     * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-     * format `projects/*`.
-     * 
- * - * - * 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_; - /** - * - * - *
-     * Requested page size. The server may return fewer results than requested. If
-     * unspecified, the server will pick an appropriate default.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Requested page size. The server may return fewer results than requested. If
-     * unspecified, the server will pick an appropriate default.
-     * 
- * - * 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; - } - /** - * - * - *
-     * Requested page size. The server may return fewer results than requested. If
-     * unspecified, the server will pick an appropriate default.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * A token identifying a page of results the server should return. Typically,
-     * this is the value of
-     * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-     * returned from the previous call to the `ListAttestors` method.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token identifying a page of results the server should return. Typically,
-     * this is the value of
-     * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-     * returned from the previous call to the `ListAttestors` method.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token identifying a page of results the server should return. Typically,
-     * this is the value of
-     * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-     * returned from the previous call to the `ListAttestors` method.
-     * 
- * - * 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; - } - /** - * - * - *
-     * A token identifying a page of results the server should return. Typically,
-     * this is the value of
-     * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-     * returned from the previous call to the `ListAttestors` method.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A token identifying a page of results the server should return. Typically,
-     * this is the value of
-     * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-     * returned from the previous call to the `ListAttestors` method.
-     * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListAttestorsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListAttestorsRequest(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.binaryauthorization.v1beta1.ListAttestorsRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequestOrBuilder.java deleted file mode 100644 index bb2aeaa0..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsRequestOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface ListAttestorsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The resource name of the project associated with the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-   * format `projects/*`.
-   * 
- * - * - * 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 project associated with the
-   * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the
-   * format `projects/*`.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Requested page size. The server may return fewer results than requested. If
-   * unspecified, the server will pick an appropriate default.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * A token identifying a page of results the server should return. Typically,
-   * this is the value of
-   * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-   * returned from the previous call to the `ListAttestors` method.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * A token identifying a page of results the server should return. Typically,
-   * this is the value of
-   * [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token]
-   * returned from the previous call to the `ListAttestors` method.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponse.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponse.java deleted file mode 100644 index c9167ec2..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponse.java +++ /dev/null @@ -1,1176 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Response message for [BinauthzManagementService.ListAttestors][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse} - */ -public final class ListAttestorsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) - ListAttestorsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListAttestorsResponse.newBuilder() to construct. - private ListAttestorsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListAttestorsResponse() { - attestors_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListAttestorsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListAttestorsResponse( - 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)) { - attestors_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.Attestor>(); - mutable_bitField0_ |= 0x00000001; - } - attestors_.add( - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.Attestor.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)) { - attestors_ = java.util.Collections.unmodifiableList(attestors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.class, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.Builder.class); - } - - public static final int ATTESTORS_FIELD_NUMBER = 1; - private java.util.List attestors_; - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - @java.lang.Override - public java.util.List getAttestorsList() { - return attestors_; - } - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - @java.lang.Override - public java.util.List - getAttestorsOrBuilderList() { - return attestors_; - } - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - @java.lang.Override - public int getAttestorsCount() { - return attestors_.size(); - } - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestors(int index) { - return attestors_.get(index); - } - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorsOrBuilder( - int index) { - return attestors_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * A token to retrieve the next page of results. Pass this value in the
-   * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-   * field in the subsequent call to the `ListAttestors` method to retrieve the
-   * next page of results.
-   * 
- * - * 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; - } - } - /** - * - * - *
-   * A token to retrieve the next page of results. Pass this value in the
-   * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-   * field in the subsequent call to the `ListAttestors` method to retrieve the
-   * next page of results.
-   * 
- * - * 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 < attestors_.size(); i++) { - output.writeMessage(1, attestors_.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 < attestors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, attestors_.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.binaryauthorization.v1beta1.ListAttestorsResponse)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse other = - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) obj; - - if (!getAttestorsList().equals(other.getAttestorsList())) 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 (getAttestorsCount() > 0) { - hash = (37 * hash) + ATTESTORS_FIELD_NUMBER; - hash = (53 * hash) + getAttestorsList().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.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse 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.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse 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.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse 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.binaryauthorization.v1beta1.ListAttestorsResponse - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - 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.binaryauthorization.v1beta1.ListAttestorsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse 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.binaryauthorization.v1beta1.ListAttestorsResponse 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 message for [BinauthzManagementService.ListAttestors][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.class, - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAttestorsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (attestorsBuilder_ == null) { - attestors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - attestorsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_ListAttestorsResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse build() { - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse result = - new com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse(this); - int from_bitField0_ = bitField0_; - if (attestorsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - attestors_ = java.util.Collections.unmodifiableList(attestors_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.attestors_ = attestors_; - } else { - result.attestors_ = attestorsBuilder_.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.binaryauthorization.v1beta1.ListAttestorsResponse) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - .getDefaultInstance()) return this; - if (attestorsBuilder_ == null) { - if (!other.attestors_.isEmpty()) { - if (attestors_.isEmpty()) { - attestors_ = other.attestors_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAttestorsIsMutable(); - attestors_.addAll(other.attestors_); - } - onChanged(); - } - } else { - if (!other.attestors_.isEmpty()) { - if (attestorsBuilder_.isEmpty()) { - attestorsBuilder_.dispose(); - attestorsBuilder_ = null; - attestors_ = other.attestors_; - bitField0_ = (bitField0_ & ~0x00000001); - attestorsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAttestorsFieldBuilder() - : null; - } else { - attestorsBuilder_.addAllMessages(other.attestors_); - } - } - } - 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.binaryauthorization.v1beta1.ListAttestorsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List attestors_ = - java.util.Collections.emptyList(); - - private void ensureAttestorsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - attestors_ = - new java.util.ArrayList( - attestors_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - attestorsBuilder_; - - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public java.util.List - getAttestorsList() { - if (attestorsBuilder_ == null) { - return java.util.Collections.unmodifiableList(attestors_); - } else { - return attestorsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public int getAttestorsCount() { - if (attestorsBuilder_ == null) { - return attestors_.size(); - } else { - return attestorsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestors(int index) { - if (attestorsBuilder_ == null) { - return attestors_.get(index); - } else { - return attestorsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder setAttestors( - int index, com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttestorsIsMutable(); - attestors_.set(index, value); - onChanged(); - } else { - attestorsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder setAttestors( - int index, com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder builderForValue) { - if (attestorsBuilder_ == null) { - ensureAttestorsIsMutable(); - attestors_.set(index, builderForValue.build()); - onChanged(); - } else { - attestorsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder addAttestors(com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttestorsIsMutable(); - attestors_.add(value); - onChanged(); - } else { - attestorsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder addAttestors( - int index, com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttestorsIsMutable(); - attestors_.add(index, value); - onChanged(); - } else { - attestorsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder addAttestors( - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder builderForValue) { - if (attestorsBuilder_ == null) { - ensureAttestorsIsMutable(); - attestors_.add(builderForValue.build()); - onChanged(); - } else { - attestorsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder addAttestors( - int index, com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder builderForValue) { - if (attestorsBuilder_ == null) { - ensureAttestorsIsMutable(); - attestors_.add(index, builderForValue.build()); - onChanged(); - } else { - attestorsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder addAllAttestors( - java.lang.Iterable - values) { - if (attestorsBuilder_ == null) { - ensureAttestorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attestors_); - onChanged(); - } else { - attestorsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder clearAttestors() { - if (attestorsBuilder_ == null) { - attestors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - attestorsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public Builder removeAttestors(int index) { - if (attestorsBuilder_ == null) { - ensureAttestorsIsMutable(); - attestors_.remove(index); - onChanged(); - } else { - attestorsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder getAttestorsBuilder( - int index) { - return getAttestorsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorsOrBuilder( - int index) { - if (attestorsBuilder_ == null) { - return attestors_.get(index); - } else { - return attestorsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public java.util.List - getAttestorsOrBuilderList() { - if (attestorsBuilder_ != null) { - return attestorsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attestors_); - } - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder addAttestorsBuilder() { - return getAttestorsFieldBuilder() - .addBuilder(com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance()); - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder addAttestorsBuilder( - int index) { - return getAttestorsFieldBuilder() - .addBuilder( - index, com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance()); - } - /** - * - * - *
-     * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-     * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - public java.util.List - getAttestorsBuilderList() { - return getAttestorsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - getAttestorsFieldBuilder() { - if (attestorsBuilder_ == null) { - attestorsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder>( - attestors_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - attestors_ = null; - } - return attestorsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * A token to retrieve the next page of results. Pass this value in the
-     * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-     * field in the subsequent call to the `ListAttestors` method to retrieve the
-     * next page of results.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token to retrieve the next page of results. Pass this value in the
-     * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-     * field in the subsequent call to the `ListAttestors` method to retrieve the
-     * next page of results.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token to retrieve the next page of results. Pass this value in the
-     * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-     * field in the subsequent call to the `ListAttestors` method to retrieve the
-     * next page of results.
-     * 
- * - * 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; - } - /** - * - * - *
-     * A token to retrieve the next page of results. Pass this value in the
-     * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-     * field in the subsequent call to the `ListAttestors` method to retrieve the
-     * next page of results.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A token to retrieve the next page of results. Pass this value in the
-     * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-     * field in the subsequent call to the `ListAttestors` method to retrieve the
-     * next page of results.
-     * 
- * - * 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.binaryauthorization.v1beta1.ListAttestorsResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) - private static final com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListAttestorsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListAttestorsResponse(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.binaryauthorization.v1beta1.ListAttestorsResponse - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponseOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponseOrBuilder.java deleted file mode 100644 index 5c0b97d0..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ListAttestorsResponseOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface ListAttestorsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - java.util.List getAttestorsList(); - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestors(int index); - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - int getAttestorsCount(); - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - java.util.List - getAttestorsOrBuilderList(); - /** - * - * - *
-   * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
-   * 
- * - * repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorsOrBuilder(int index); - - /** - * - * - *
-   * A token to retrieve the next page of results. Pass this value in the
-   * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-   * field in the subsequent call to the `ListAttestors` method to retrieve the
-   * next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * A token to retrieve the next page of results. Pass this value in the
-   * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token]
-   * field in the subsequent call to the `ListAttestors` method to retrieve the
-   * next page of results.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKey.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKey.java deleted file mode 100644 index 9176f28f..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKey.java +++ /dev/null @@ -1,1223 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * A public key in the PkixPublicKey format (see
- * https://tools.ietf.org/html/rfc5280#section-4.1.2.7 for details).
- * Public keys of this type are typically textually encoded using the PEM
- * format.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.PkixPublicKey} - */ -public final class PkixPublicKey extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.PkixPublicKey) - PkixPublicKeyOrBuilder { - private static final long serialVersionUID = 0L; - // Use PkixPublicKey.newBuilder() to construct. - private PkixPublicKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PkixPublicKey() { - publicKeyPem_ = ""; - signatureAlgorithm_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PkixPublicKey(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PkixPublicKey( - 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(); - - publicKeyPem_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - signatureAlgorithm_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.class, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder.class); - } - - /** - * - * - *
-   * Represents a signature algorithm and other information necessary to verify
-   * signatures with a given public key.
-   * This is based primarily on the public key types supported by Tink's
-   * PemKeyType, which is in turn based on KMS's supported signing algorithms.
-   * See https://cloud.google.com/kms/docs/algorithms. In the future, BinAuthz
-   * might support additional public key types independently of Tink and/or KMS.
-   * 
- * - * Protobuf enum {@code google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm} - */ - public enum SignatureAlgorithm implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Not specified.
-     * 
- * - * SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - */ - SIGNATURE_ALGORITHM_UNSPECIFIED(0), - /** - * - * - *
-     * RSASSA-PSS 2048 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_2048_SHA256 = 1; - */ - RSA_PSS_2048_SHA256(1), - /** - * - * - *
-     * RSASSA-PSS 3072 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_3072_SHA256 = 2; - */ - RSA_PSS_3072_SHA256(2), - /** - * - * - *
-     * RSASSA-PSS 4096 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_4096_SHA256 = 3; - */ - RSA_PSS_4096_SHA256(3), - /** - * - * - *
-     * RSASSA-PSS 4096 bit key with a SHA512 digest.
-     * 
- * - * RSA_PSS_4096_SHA512 = 4; - */ - RSA_PSS_4096_SHA512(4), - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_2048_SHA256 = 5; - */ - RSA_SIGN_PKCS1_2048_SHA256(5), - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_3072_SHA256 = 6; - */ - RSA_SIGN_PKCS1_3072_SHA256(6), - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_4096_SHA256 = 7; - */ - RSA_SIGN_PKCS1_4096_SHA256(7), - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.
-     * 
- * - * RSA_SIGN_PKCS1_4096_SHA512 = 8; - */ - RSA_SIGN_PKCS1_4096_SHA512(8), - /** - * - * - *
-     * ECDSA on the NIST P-256 curve with a SHA256 digest.
-     * 
- * - * ECDSA_P256_SHA256 = 9; - */ - ECDSA_P256_SHA256(9), - /** - * - * - *
-     * ECDSA on the NIST P-384 curve with a SHA384 digest.
-     * 
- * - * ECDSA_P384_SHA384 = 10; - */ - ECDSA_P384_SHA384(10), - /** - * - * - *
-     * ECDSA on the NIST P-521 curve with a SHA512 digest.
-     * 
- * - * ECDSA_P521_SHA512 = 11; - */ - ECDSA_P521_SHA512(11), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Not specified.
-     * 
- * - * SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - */ - public static final int SIGNATURE_ALGORITHM_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * RSASSA-PSS 2048 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_2048_SHA256 = 1; - */ - public static final int RSA_PSS_2048_SHA256_VALUE = 1; - /** - * - * - *
-     * RSASSA-PSS 3072 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_3072_SHA256 = 2; - */ - public static final int RSA_PSS_3072_SHA256_VALUE = 2; - /** - * - * - *
-     * RSASSA-PSS 4096 bit key with a SHA256 digest.
-     * 
- * - * RSA_PSS_4096_SHA256 = 3; - */ - public static final int RSA_PSS_4096_SHA256_VALUE = 3; - /** - * - * - *
-     * RSASSA-PSS 4096 bit key with a SHA512 digest.
-     * 
- * - * RSA_PSS_4096_SHA512 = 4; - */ - public static final int RSA_PSS_4096_SHA512_VALUE = 4; - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_2048_SHA256 = 5; - */ - public static final int RSA_SIGN_PKCS1_2048_SHA256_VALUE = 5; - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_3072_SHA256 = 6; - */ - public static final int RSA_SIGN_PKCS1_3072_SHA256_VALUE = 6; - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
-     * 
- * - * RSA_SIGN_PKCS1_4096_SHA256 = 7; - */ - public static final int RSA_SIGN_PKCS1_4096_SHA256_VALUE = 7; - /** - * - * - *
-     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.
-     * 
- * - * RSA_SIGN_PKCS1_4096_SHA512 = 8; - */ - public static final int RSA_SIGN_PKCS1_4096_SHA512_VALUE = 8; - /** - * - * - *
-     * ECDSA on the NIST P-256 curve with a SHA256 digest.
-     * 
- * - * ECDSA_P256_SHA256 = 9; - */ - public static final int ECDSA_P256_SHA256_VALUE = 9; - /** - * - * - *
-     * ECDSA on the NIST P-384 curve with a SHA384 digest.
-     * 
- * - * ECDSA_P384_SHA384 = 10; - */ - public static final int ECDSA_P384_SHA384_VALUE = 10; - /** - * - * - *
-     * ECDSA on the NIST P-521 curve with a SHA512 digest.
-     * 
- * - * ECDSA_P521_SHA512 = 11; - */ - public static final int ECDSA_P521_SHA512_VALUE = 11; - - 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 SignatureAlgorithm 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 SignatureAlgorithm forNumber(int value) { - switch (value) { - case 0: - return SIGNATURE_ALGORITHM_UNSPECIFIED; - case 1: - return RSA_PSS_2048_SHA256; - case 2: - return RSA_PSS_3072_SHA256; - case 3: - return RSA_PSS_4096_SHA256; - case 4: - return RSA_PSS_4096_SHA512; - case 5: - return RSA_SIGN_PKCS1_2048_SHA256; - case 6: - return RSA_SIGN_PKCS1_3072_SHA256; - case 7: - return RSA_SIGN_PKCS1_4096_SHA256; - case 8: - return RSA_SIGN_PKCS1_4096_SHA512; - case 9: - return ECDSA_P256_SHA256; - case 10: - return ECDSA_P384_SHA384; - case 11: - return ECDSA_P521_SHA512; - 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 SignatureAlgorithm findValueByNumber(int number) { - return SignatureAlgorithm.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.binaryauthorization.v1beta1.PkixPublicKey.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final SignatureAlgorithm[] VALUES = values(); - - public static SignatureAlgorithm 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 SignatureAlgorithm(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm) - } - - public static final int PUBLIC_KEY_PEM_FIELD_NUMBER = 1; - private volatile java.lang.Object publicKeyPem_; - /** - * - * - *
-   * A PEM-encoded public key, as described in
-   * https://tools.ietf.org/html/rfc7468#section-13
-   * 
- * - * string public_key_pem = 1; - * - * @return The publicKeyPem. - */ - @java.lang.Override - public java.lang.String getPublicKeyPem() { - java.lang.Object ref = publicKeyPem_; - 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(); - publicKeyPem_ = s; - return s; - } - } - /** - * - * - *
-   * A PEM-encoded public key, as described in
-   * https://tools.ietf.org/html/rfc7468#section-13
-   * 
- * - * string public_key_pem = 1; - * - * @return The bytes for publicKeyPem. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPublicKeyPemBytes() { - java.lang.Object ref = publicKeyPem_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - publicKeyPem_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SIGNATURE_ALGORITHM_FIELD_NUMBER = 2; - private int signatureAlgorithm_; - /** - * - * - *
-   * The signature algorithm used to verify a message against a signature using
-   * this key.
-   * These signature algorithm must match the structure and any object
-   * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-   * that of the public key).
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The enum numeric value on the wire for signatureAlgorithm. - */ - @java.lang.Override - public int getSignatureAlgorithmValue() { - return signatureAlgorithm_; - } - /** - * - * - *
-   * The signature algorithm used to verify a message against a signature using
-   * this key.
-   * These signature algorithm must match the structure and any object
-   * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-   * that of the public key).
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The signatureAlgorithm. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - getSignatureAlgorithm() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm result = - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm.valueOf( - signatureAlgorithm_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm.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 (!getPublicKeyPemBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, publicKeyPem_); - } - if (signatureAlgorithm_ - != com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - .SIGNATURE_ALGORITHM_UNSPECIFIED - .getNumber()) { - output.writeEnum(2, signatureAlgorithm_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPublicKeyPemBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, publicKeyPem_); - } - if (signatureAlgorithm_ - != com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - .SIGNATURE_ALGORITHM_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, signatureAlgorithm_); - } - 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.binaryauthorization.v1beta1.PkixPublicKey)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey other = - (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) obj; - - if (!getPublicKeyPem().equals(other.getPublicKeyPem())) return false; - if (signatureAlgorithm_ != other.signatureAlgorithm_) 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) + PUBLIC_KEY_PEM_FIELD_NUMBER; - hash = (53 * hash) + getPublicKeyPem().hashCode(); - hash = (37 * hash) + SIGNATURE_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + signatureAlgorithm_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey 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.binaryauthorization.v1beta1.PkixPublicKey parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey 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.binaryauthorization.v1beta1.PkixPublicKey parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey 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.binaryauthorization.v1beta1.PkixPublicKey parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey 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.binaryauthorization.v1beta1.PkixPublicKey parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey 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.binaryauthorization.v1beta1.PkixPublicKey prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A public key in the PkixPublicKey format (see
-   * https://tools.ietf.org/html/rfc5280#section-4.1.2.7 for details).
-   * Public keys of this type are typically textually encoded using the PEM
-   * format.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.PkixPublicKey} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.PkixPublicKey) - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKeyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.class, - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.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(); - publicKeyPem_ = ""; - - signatureAlgorithm_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_PkixPublicKey_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey build() { - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey result = - new com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey(this); - result.publicKeyPem_ = publicKeyPem_; - result.signatureAlgorithm_ = signatureAlgorithm_; - 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.binaryauthorization.v1beta1.PkixPublicKey) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey other) { - if (other == com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.getDefaultInstance()) - return this; - if (!other.getPublicKeyPem().isEmpty()) { - publicKeyPem_ = other.publicKeyPem_; - onChanged(); - } - if (other.signatureAlgorithm_ != 0) { - setSignatureAlgorithmValue(other.getSignatureAlgorithmValue()); - } - 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.binaryauthorization.v1beta1.PkixPublicKey parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object publicKeyPem_ = ""; - /** - * - * - *
-     * A PEM-encoded public key, as described in
-     * https://tools.ietf.org/html/rfc7468#section-13
-     * 
- * - * string public_key_pem = 1; - * - * @return The publicKeyPem. - */ - public java.lang.String getPublicKeyPem() { - java.lang.Object ref = publicKeyPem_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - publicKeyPem_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A PEM-encoded public key, as described in
-     * https://tools.ietf.org/html/rfc7468#section-13
-     * 
- * - * string public_key_pem = 1; - * - * @return The bytes for publicKeyPem. - */ - public com.google.protobuf.ByteString getPublicKeyPemBytes() { - java.lang.Object ref = publicKeyPem_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - publicKeyPem_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A PEM-encoded public key, as described in
-     * https://tools.ietf.org/html/rfc7468#section-13
-     * 
- * - * string public_key_pem = 1; - * - * @param value The publicKeyPem to set. - * @return This builder for chaining. - */ - public Builder setPublicKeyPem(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - publicKeyPem_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A PEM-encoded public key, as described in
-     * https://tools.ietf.org/html/rfc7468#section-13
-     * 
- * - * string public_key_pem = 1; - * - * @return This builder for chaining. - */ - public Builder clearPublicKeyPem() { - - publicKeyPem_ = getDefaultInstance().getPublicKeyPem(); - onChanged(); - return this; - } - /** - * - * - *
-     * A PEM-encoded public key, as described in
-     * https://tools.ietf.org/html/rfc7468#section-13
-     * 
- * - * string public_key_pem = 1; - * - * @param value The bytes for publicKeyPem to set. - * @return This builder for chaining. - */ - public Builder setPublicKeyPemBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - publicKeyPem_ = value; - onChanged(); - return this; - } - - private int signatureAlgorithm_ = 0; - /** - * - * - *
-     * The signature algorithm used to verify a message against a signature using
-     * this key.
-     * These signature algorithm must match the structure and any object
-     * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-     * that of the public key).
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The enum numeric value on the wire for signatureAlgorithm. - */ - @java.lang.Override - public int getSignatureAlgorithmValue() { - return signatureAlgorithm_; - } - /** - * - * - *
-     * The signature algorithm used to verify a message against a signature using
-     * this key.
-     * These signature algorithm must match the structure and any object
-     * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-     * that of the public key).
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @param value The enum numeric value on the wire for signatureAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSignatureAlgorithmValue(int value) { - - signatureAlgorithm_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The signature algorithm used to verify a message against a signature using
-     * this key.
-     * These signature algorithm must match the structure and any object
-     * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-     * that of the public key).
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The signatureAlgorithm. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - getSignatureAlgorithm() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm result = - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm.valueOf( - signatureAlgorithm_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - .UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The signature algorithm used to verify a message against a signature using
-     * this key.
-     * These signature algorithm must match the structure and any object
-     * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-     * that of the public key).
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @param value The signatureAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSignatureAlgorithm( - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm value) { - if (value == null) { - throw new NullPointerException(); - } - - signatureAlgorithm_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The signature algorithm used to verify a message against a signature using
-     * this key.
-     * These signature algorithm must match the structure and any object
-     * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-     * that of the public key).
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return This builder for chaining. - */ - public Builder clearSignatureAlgorithm() { - - signatureAlgorithm_ = 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.binaryauthorization.v1beta1.PkixPublicKey) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.PkixPublicKey) - private static final com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PkixPublicKey parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PkixPublicKey(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.binaryauthorization.v1beta1.PkixPublicKey getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKeyOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKeyOrBuilder.java deleted file mode 100644 index 6e0faf64..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PkixPublicKeyOrBuilder.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface PkixPublicKeyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.PkixPublicKey) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A PEM-encoded public key, as described in
-   * https://tools.ietf.org/html/rfc7468#section-13
-   * 
- * - * string public_key_pem = 1; - * - * @return The publicKeyPem. - */ - java.lang.String getPublicKeyPem(); - /** - * - * - *
-   * A PEM-encoded public key, as described in
-   * https://tools.ietf.org/html/rfc7468#section-13
-   * 
- * - * string public_key_pem = 1; - * - * @return The bytes for publicKeyPem. - */ - com.google.protobuf.ByteString getPublicKeyPemBytes(); - - /** - * - * - *
-   * The signature algorithm used to verify a message against a signature using
-   * this key.
-   * These signature algorithm must match the structure and any object
-   * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-   * that of the public key).
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The enum numeric value on the wire for signatureAlgorithm. - */ - int getSignatureAlgorithmValue(); - /** - * - * - *
-   * The signature algorithm used to verify a message against a signature using
-   * this key.
-   * These signature algorithm must match the structure and any object
-   * identifiers encoded in `public_key_pem` (i.e. this algorithm must match
-   * that of the public key).
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * - * - * @return The signatureAlgorithm. - */ - com.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - getSignatureAlgorithm(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Policy.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Policy.java deleted file mode 100644 index c8e61918..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/Policy.java +++ /dev/null @@ -1,2889 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] for container
- * image binary authorization.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.Policy} - */ -public final class Policy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.Policy) - PolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use Policy.newBuilder() to construct. - private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Policy() { - name_ = ""; - description_ = ""; - globalPolicyEvaluationMode_ = 0; - admissionWhitelistPatterns_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Policy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Policy( - 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: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - admissionWhitelistPatterns_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern>(); - mutable_bitField0_ |= 0x00000001; - } - admissionWhitelistPatterns_.add( - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - .parser(), - extensionRegistry)); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - clusterAdmissionRules_ = - com.google.protobuf.MapField.newMapField( - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - clusterAdmissionRules__ = - input.readMessage( - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - clusterAdmissionRules_ - .getMutableMap() - .put(clusterAdmissionRules__.getKey(), clusterAdmissionRules__.getValue()); - break; - } - case 34: - { - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder subBuilder = null; - if (defaultAdmissionRule_ != null) { - subBuilder = defaultAdmissionRule_.toBuilder(); - } - defaultAdmissionRule_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultAdmissionRule_); - defaultAdmissionRule_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 56: - { - int rawValue = input.readEnum(); - - globalPolicyEvaluationMode_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - admissionWhitelistPatterns_ = - java.util.Collections.unmodifiableList(admissionWhitelistPatterns_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 3: - return internalGetClusterAdmissionRules(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.Policy.class, - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder.class); - } - - /** - * Protobuf enum {@code - * google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode} - */ - public enum GlobalPolicyEvaluationMode implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Not specified: DISABLE is assumed.
-     * 
- * - * GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - */ - GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED(0), - /** - * - * - *
-     * Enables system policy evaluation.
-     * 
- * - * ENABLE = 1; - */ - ENABLE(1), - /** - * - * - *
-     * Disables system policy evaluation.
-     * 
- * - * DISABLE = 2; - */ - DISABLE(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Not specified: DISABLE is assumed.
-     * 
- * - * GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - */ - public static final int GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Enables system policy evaluation.
-     * 
- * - * ENABLE = 1; - */ - public static final int ENABLE_VALUE = 1; - /** - * - * - *
-     * Disables system policy evaluation.
-     * 
- * - * DISABLE = 2; - */ - public static final int DISABLE_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 GlobalPolicyEvaluationMode 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 GlobalPolicyEvaluationMode forNumber(int value) { - switch (value) { - case 0: - return GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED; - case 1: - return ENABLE; - case 2: - return DISABLE; - 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 GlobalPolicyEvaluationMode findValueByNumber(int number) { - return GlobalPolicyEvaluationMode.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.binaryauthorization.v1beta1.Policy.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final GlobalPolicyEvaluationMode[] VALUES = values(); - - public static GlobalPolicyEvaluationMode 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 GlobalPolicyEvaluationMode(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode) - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * Output only. The resource name, in the format `projects/*/policy`. There is
-   * at most one policy per project.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @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; - } - } - /** - * - * - *
-   * Output only. The resource name, in the format `projects/*/policy`. There is
-   * at most one policy per project.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @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 DESCRIPTION_FIELD_NUMBER = 6; - private volatile java.lang.Object description_; - /** - * - * - *
-   * Optional. A descriptive comment.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. A descriptive comment.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GLOBAL_POLICY_EVALUATION_MODE_FIELD_NUMBER = 7; - private int globalPolicyEvaluationMode_; - /** - * - * - *
-   * Optional. Controls the evaluation of a Google-maintained global admission
-   * policy for common system-level images. Images not covered by the global
-   * policy will be subject to the project admission policy. This setting
-   * has no effect when specified inside a global admission policy.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The enum numeric value on the wire for globalPolicyEvaluationMode. - */ - @java.lang.Override - public int getGlobalPolicyEvaluationModeValue() { - return globalPolicyEvaluationMode_; - } - /** - * - * - *
-   * Optional. Controls the evaluation of a Google-maintained global admission
-   * policy for common system-level images. Images not covered by the global
-   * policy will be subject to the project admission policy. This setting
-   * has no effect when specified inside a global admission policy.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The globalPolicyEvaluationMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - getGlobalPolicyEvaluationMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode result = - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode.valueOf( - globalPolicyEvaluationMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - .UNRECOGNIZED - : result; - } - - public static final int ADMISSION_WHITELIST_PATTERNS_FIELD_NUMBER = 2; - private java.util.List - admissionWhitelistPatterns_; - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.List - getAdmissionWhitelistPatternsList() { - return admissionWhitelistPatterns_; - } - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder> - getAdmissionWhitelistPatternsOrBuilderList() { - return admissionWhitelistPatterns_; - } - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public int getAdmissionWhitelistPatternsCount() { - return admissionWhitelistPatterns_.size(); - } - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getAdmissionWhitelistPatterns(int index) { - return admissionWhitelistPatterns_.get(index); - } - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder - getAdmissionWhitelistPatternsOrBuilder(int index) { - return admissionWhitelistPatterns_.get(index); - } - - public static final int CLUSTER_ADMISSION_RULES_FIELD_NUMBER = 3; - - private static final class ClusterAdmissionRulesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - defaultEntry = - com.google.protobuf.MapEntry - . - newDefaultInstance( - com.google.cloud.binaryauthorization.v1beta1 - .BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_ClusterAdmissionRulesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule - .getDefaultInstance()); - } - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - clusterAdmissionRules_; - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - internalGetClusterAdmissionRules() { - if (clusterAdmissionRules_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry); - } - return clusterAdmissionRules_; - } - - public int getClusterAdmissionRulesCount() { - return internalGetClusterAdmissionRules().getMap().size(); - } - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public boolean containsClusterAdmissionRules(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetClusterAdmissionRules().getMap().containsKey(key); - } - /** Use {@link #getClusterAdmissionRulesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getClusterAdmissionRules() { - return getClusterAdmissionRulesMap(); - } - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.Map - getClusterAdmissionRulesMap() { - return internalGetClusterAdmissionRules().getMap(); - } - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule - getClusterAdmissionRulesOrDefault( - java.lang.String key, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map - map = internalGetClusterAdmissionRules().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getClusterAdmissionRulesOrThrow( - java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map - map = internalGetClusterAdmissionRules().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int DEFAULT_ADMISSION_RULE_FIELD_NUMBER = 4; - private com.google.cloud.binaryauthorization.v1beta1.AdmissionRule defaultAdmissionRule_; - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the defaultAdmissionRule field is set. - */ - @java.lang.Override - public boolean hasDefaultAdmissionRule() { - return defaultAdmissionRule_ != null; - } - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The defaultAdmissionRule. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getDefaultAdmissionRule() { - return defaultAdmissionRule_ == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.getDefaultInstance() - : defaultAdmissionRule_; - } - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder - getDefaultAdmissionRuleOrBuilder() { - return getDefaultAdmissionRule(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - 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_); - } - for (int i = 0; i < admissionWhitelistPatterns_.size(); i++) { - output.writeMessage(2, admissionWhitelistPatterns_.get(i)); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, - internalGetClusterAdmissionRules(), - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry, - 3); - if (defaultAdmissionRule_ != null) { - output.writeMessage(4, getDefaultAdmissionRule()); - } - if (updateTime_ != null) { - output.writeMessage(5, getUpdateTime()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); - } - if (globalPolicyEvaluationMode_ - != com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - .GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED - .getNumber()) { - output.writeEnum(7, globalPolicyEvaluationMode_); - } - 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_); - } - for (int i = 0; i < admissionWhitelistPatterns_.size(); i++) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, admissionWhitelistPatterns_.get(i)); - } - for (java.util.Map.Entry< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - entry : internalGetClusterAdmissionRules().getMap().entrySet()) { - com.google.protobuf.MapEntry< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - clusterAdmissionRules__ = - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, clusterAdmissionRules__); - } - if (defaultAdmissionRule_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDefaultAdmissionRule()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); - } - if (globalPolicyEvaluationMode_ - != com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - .GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, globalPolicyEvaluationMode_); - } - 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.binaryauthorization.v1beta1.Policy)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.Policy other = - (com.google.cloud.binaryauthorization.v1beta1.Policy) obj; - - if (!getName().equals(other.getName())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (globalPolicyEvaluationMode_ != other.globalPolicyEvaluationMode_) return false; - if (!getAdmissionWhitelistPatternsList().equals(other.getAdmissionWhitelistPatternsList())) - return false; - if (!internalGetClusterAdmissionRules().equals(other.internalGetClusterAdmissionRules())) - return false; - if (hasDefaultAdmissionRule() != other.hasDefaultAdmissionRule()) return false; - if (hasDefaultAdmissionRule()) { - if (!getDefaultAdmissionRule().equals(other.getDefaultAdmissionRule())) return false; - } - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + GLOBAL_POLICY_EVALUATION_MODE_FIELD_NUMBER; - hash = (53 * hash) + globalPolicyEvaluationMode_; - if (getAdmissionWhitelistPatternsCount() > 0) { - hash = (37 * hash) + ADMISSION_WHITELIST_PATTERNS_FIELD_NUMBER; - hash = (53 * hash) + getAdmissionWhitelistPatternsList().hashCode(); - } - if (!internalGetClusterAdmissionRules().getMap().isEmpty()) { - hash = (37 * hash) + CLUSTER_ADMISSION_RULES_FIELD_NUMBER; - hash = (53 * hash) + internalGetClusterAdmissionRules().hashCode(); - } - if (hasDefaultAdmissionRule()) { - hash = (37 * hash) + DEFAULT_ADMISSION_RULE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultAdmissionRule().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy 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.binaryauthorization.v1beta1.Policy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy 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.binaryauthorization.v1beta1.Policy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy 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.binaryauthorization.v1beta1.Policy parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy 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.binaryauthorization.v1beta1.Policy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy 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.binaryauthorization.v1beta1.Policy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] for container
-   * image binary authorization.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.Policy} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.Policy) - com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 3: - return internalGetClusterAdmissionRules(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 3: - return internalGetMutableClusterAdmissionRules(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.Policy.class, - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.Policy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAdmissionWhitelistPatternsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - globalPolicyEvaluationMode_ = 0; - - if (admissionWhitelistPatternsBuilder_ == null) { - admissionWhitelistPatterns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - admissionWhitelistPatternsBuilder_.clear(); - } - internalGetMutableClusterAdmissionRules().clear(); - if (defaultAdmissionRuleBuilder_ == null) { - defaultAdmissionRule_ = null; - } else { - defaultAdmissionRule_ = null; - defaultAdmissionRuleBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_Policy_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.Policy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy build() { - com.google.cloud.binaryauthorization.v1beta1.Policy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.Policy result = - new com.google.cloud.binaryauthorization.v1beta1.Policy(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.description_ = description_; - result.globalPolicyEvaluationMode_ = globalPolicyEvaluationMode_; - if (admissionWhitelistPatternsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - admissionWhitelistPatterns_ = - java.util.Collections.unmodifiableList(admissionWhitelistPatterns_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.admissionWhitelistPatterns_ = admissionWhitelistPatterns_; - } else { - result.admissionWhitelistPatterns_ = admissionWhitelistPatternsBuilder_.build(); - } - result.clusterAdmissionRules_ = internalGetClusterAdmissionRules(); - result.clusterAdmissionRules_.makeImmutable(); - if (defaultAdmissionRuleBuilder_ == null) { - result.defaultAdmissionRule_ = defaultAdmissionRule_; - } else { - result.defaultAdmissionRule_ = defaultAdmissionRuleBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.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.binaryauthorization.v1beta1.Policy) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.Policy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.binaryauthorization.v1beta1.Policy other) { - if (other == com.google.cloud.binaryauthorization.v1beta1.Policy.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.globalPolicyEvaluationMode_ != 0) { - setGlobalPolicyEvaluationModeValue(other.getGlobalPolicyEvaluationModeValue()); - } - if (admissionWhitelistPatternsBuilder_ == null) { - if (!other.admissionWhitelistPatterns_.isEmpty()) { - if (admissionWhitelistPatterns_.isEmpty()) { - admissionWhitelistPatterns_ = other.admissionWhitelistPatterns_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.addAll(other.admissionWhitelistPatterns_); - } - onChanged(); - } - } else { - if (!other.admissionWhitelistPatterns_.isEmpty()) { - if (admissionWhitelistPatternsBuilder_.isEmpty()) { - admissionWhitelistPatternsBuilder_.dispose(); - admissionWhitelistPatternsBuilder_ = null; - admissionWhitelistPatterns_ = other.admissionWhitelistPatterns_; - bitField0_ = (bitField0_ & ~0x00000001); - admissionWhitelistPatternsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAdmissionWhitelistPatternsFieldBuilder() - : null; - } else { - admissionWhitelistPatternsBuilder_.addAllMessages(other.admissionWhitelistPatterns_); - } - } - } - internalGetMutableClusterAdmissionRules().mergeFrom(other.internalGetClusterAdmissionRules()); - if (other.hasDefaultAdmissionRule()) { - mergeDefaultAdmissionRule(other.getDefaultAdmissionRule()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - 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.binaryauthorization.v1beta1.Policy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.Policy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Output only. The resource name, in the format `projects/*/policy`. There is
-     * at most one policy per project.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. The resource name, in the format `projects/*/policy`. There is
-     * at most one policy per project.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. The resource name, in the format `projects/*/policy`. There is
-     * at most one policy per project.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The resource name, in the format `projects/*/policy`. There is
-     * at most one policy per project.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The resource name, in the format `projects/*/policy`. There is
-     * at most one policy per project.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - * - * - *
-     * Optional. A descriptive comment.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. A descriptive comment.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A descriptive comment.
-     * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private int globalPolicyEvaluationMode_ = 0; - /** - * - * - *
-     * Optional. Controls the evaluation of a Google-maintained global admission
-     * policy for common system-level images. Images not covered by the global
-     * policy will be subject to the project admission policy. This setting
-     * has no effect when specified inside a global admission policy.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The enum numeric value on the wire for globalPolicyEvaluationMode. - */ - @java.lang.Override - public int getGlobalPolicyEvaluationModeValue() { - return globalPolicyEvaluationMode_; - } - /** - * - * - *
-     * Optional. Controls the evaluation of a Google-maintained global admission
-     * policy for common system-level images. Images not covered by the global
-     * policy will be subject to the project admission policy. This setting
-     * has no effect when specified inside a global admission policy.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param value The enum numeric value on the wire for globalPolicyEvaluationMode to set. - * @return This builder for chaining. - */ - public Builder setGlobalPolicyEvaluationModeValue(int value) { - - globalPolicyEvaluationMode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. Controls the evaluation of a Google-maintained global admission
-     * policy for common system-level images. Images not covered by the global
-     * policy will be subject to the project admission policy. This setting
-     * has no effect when specified inside a global admission policy.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The globalPolicyEvaluationMode. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - getGlobalPolicyEvaluationMode() { - @SuppressWarnings("deprecation") - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode result = - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode.valueOf( - globalPolicyEvaluationMode_); - return result == null - ? com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - .UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Optional. Controls the evaluation of a Google-maintained global admission
-     * policy for common system-level images. Images not covered by the global
-     * policy will be subject to the project admission policy. This setting
-     * has no effect when specified inside a global admission policy.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @param value The globalPolicyEvaluationMode to set. - * @return This builder for chaining. - */ - public Builder setGlobalPolicyEvaluationMode( - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode value) { - if (value == null) { - throw new NullPointerException(); - } - - globalPolicyEvaluationMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. Controls the evaluation of a Google-maintained global admission
-     * policy for common system-level images. Images not covered by the global
-     * policy will be subject to the project admission policy. This setting
-     * has no effect when specified inside a global admission policy.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return This builder for chaining. - */ - public Builder clearGlobalPolicyEvaluationMode() { - - globalPolicyEvaluationMode_ = 0; - onChanged(); - return this; - } - - private java.util.List - admissionWhitelistPatterns_ = java.util.Collections.emptyList(); - - private void ensureAdmissionWhitelistPatternsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - admissionWhitelistPatterns_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern>( - admissionWhitelistPatterns_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder> - admissionWhitelistPatternsBuilder_; - - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List - getAdmissionWhitelistPatternsList() { - if (admissionWhitelistPatternsBuilder_ == null) { - return java.util.Collections.unmodifiableList(admissionWhitelistPatterns_); - } else { - return admissionWhitelistPatternsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public int getAdmissionWhitelistPatternsCount() { - if (admissionWhitelistPatternsBuilder_ == null) { - return admissionWhitelistPatterns_.size(); - } else { - return admissionWhitelistPatternsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getAdmissionWhitelistPatterns(int index) { - if (admissionWhitelistPatternsBuilder_ == null) { - return admissionWhitelistPatterns_.get(index); - } else { - return admissionWhitelistPatternsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setAdmissionWhitelistPatterns( - int index, com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern value) { - if (admissionWhitelistPatternsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.set(index, value); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setAdmissionWhitelistPatterns( - int index, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - builderForValue) { - if (admissionWhitelistPatternsBuilder_ == null) { - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.set(index, builderForValue.build()); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAdmissionWhitelistPatterns( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern value) { - if (admissionWhitelistPatternsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.add(value); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAdmissionWhitelistPatterns( - int index, com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern value) { - if (admissionWhitelistPatternsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.add(index, value); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAdmissionWhitelistPatterns( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - builderForValue) { - if (admissionWhitelistPatternsBuilder_ == null) { - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.add(builderForValue.build()); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAdmissionWhitelistPatterns( - int index, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - builderForValue) { - if (admissionWhitelistPatternsBuilder_ == null) { - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.add(index, builderForValue.build()); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAllAdmissionWhitelistPatterns( - java.lang.Iterable< - ? extends com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern> - values) { - if (admissionWhitelistPatternsBuilder_ == null) { - ensureAdmissionWhitelistPatternsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, admissionWhitelistPatterns_); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder clearAdmissionWhitelistPatterns() { - if (admissionWhitelistPatternsBuilder_ == null) { - admissionWhitelistPatterns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder removeAdmissionWhitelistPatterns(int index) { - if (admissionWhitelistPatternsBuilder_ == null) { - ensureAdmissionWhitelistPatternsIsMutable(); - admissionWhitelistPatterns_.remove(index); - onChanged(); - } else { - admissionWhitelistPatternsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - getAdmissionWhitelistPatternsBuilder(int index) { - return getAdmissionWhitelistPatternsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder - getAdmissionWhitelistPatternsOrBuilder(int index) { - if (admissionWhitelistPatternsBuilder_ == null) { - return admissionWhitelistPatterns_.get(index); - } else { - return admissionWhitelistPatternsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List< - ? extends - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder> - getAdmissionWhitelistPatternsOrBuilderList() { - if (admissionWhitelistPatternsBuilder_ != null) { - return admissionWhitelistPatternsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(admissionWhitelistPatterns_); - } - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - addAdmissionWhitelistPatternsBuilder() { - return getAdmissionWhitelistPatternsFieldBuilder() - .addBuilder( - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - .getDefaultInstance()); - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder - addAdmissionWhitelistPatternsBuilder(int index) { - return getAdmissionWhitelistPatternsFieldBuilder() - .addBuilder( - index, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - .getDefaultInstance()); - } - /** - * - * - *
-     * Optional. Admission policy allowlisting. A matching admission request will
-     * always be permitted. This feature is typically used to exclude Google or
-     * third-party infrastructure images from Binary Authorization policies.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder> - getAdmissionWhitelistPatternsBuilderList() { - return getAdmissionWhitelistPatternsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder> - getAdmissionWhitelistPatternsFieldBuilder() { - if (admissionWhitelistPatternsBuilder_ == null) { - admissionWhitelistPatternsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder>( - admissionWhitelistPatterns_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - admissionWhitelistPatterns_ = null; - } - return admissionWhitelistPatternsBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - clusterAdmissionRules_; - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - internalGetClusterAdmissionRules() { - if (clusterAdmissionRules_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry); - } - return clusterAdmissionRules_; - } - - private com.google.protobuf.MapField< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - internalGetMutableClusterAdmissionRules() { - onChanged(); - ; - if (clusterAdmissionRules_ == null) { - clusterAdmissionRules_ = - com.google.protobuf.MapField.newMapField( - ClusterAdmissionRulesDefaultEntryHolder.defaultEntry); - } - if (!clusterAdmissionRules_.isMutable()) { - clusterAdmissionRules_ = clusterAdmissionRules_.copy(); - } - return clusterAdmissionRules_; - } - - public int getClusterAdmissionRulesCount() { - return internalGetClusterAdmissionRules().getMap().size(); - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public boolean containsClusterAdmissionRules(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetClusterAdmissionRules().getMap().containsKey(key); - } - /** Use {@link #getClusterAdmissionRulesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - getClusterAdmissionRules() { - return getClusterAdmissionRulesMap(); - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.Map< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - getClusterAdmissionRulesMap() { - return internalGetClusterAdmissionRules().getMap(); - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule - getClusterAdmissionRulesOrDefault( - java.lang.String key, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map - map = internalGetClusterAdmissionRules().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule - getClusterAdmissionRulesOrThrow(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map - map = internalGetClusterAdmissionRules().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearClusterAdmissionRules() { - internalGetMutableClusterAdmissionRules().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder removeClusterAdmissionRules(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableClusterAdmissionRules().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map< - java.lang.String, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule> - getMutableClusterAdmissionRules() { - return internalGetMutableClusterAdmissionRules().getMutableMap(); - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder putClusterAdmissionRules( - java.lang.String key, com.google.cloud.binaryauthorization.v1beta1.AdmissionRule value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableClusterAdmissionRules().getMutableMap().put(key, value); - return this; - } - /** - * - * - *
-     * Optional. Per-cluster admission rules. Cluster spec format:
-     * `location.clusterId`. There can be at most one admission rule per cluster
-     * spec.
-     * A `location` is either a compute zone (e.g. us-central1-a) or a region
-     * (e.g. us-central1).
-     * For `clusterId` syntax restrictions see
-     * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-     * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder putAllClusterAdmissionRules( - java.util.Map - values) { - internalGetMutableClusterAdmissionRules().getMutableMap().putAll(values); - return this; - } - - private com.google.cloud.binaryauthorization.v1beta1.AdmissionRule defaultAdmissionRule_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder> - defaultAdmissionRuleBuilder_; - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the defaultAdmissionRule field is set. - */ - public boolean hasDefaultAdmissionRule() { - return defaultAdmissionRuleBuilder_ != null || defaultAdmissionRule_ != null; - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The defaultAdmissionRule. - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getDefaultAdmissionRule() { - if (defaultAdmissionRuleBuilder_ == null) { - return defaultAdmissionRule_ == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.getDefaultInstance() - : defaultAdmissionRule_; - } else { - return defaultAdmissionRuleBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDefaultAdmissionRule( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule value) { - if (defaultAdmissionRuleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultAdmissionRule_ = value; - onChanged(); - } else { - defaultAdmissionRuleBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDefaultAdmissionRule( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder builderForValue) { - if (defaultAdmissionRuleBuilder_ == null) { - defaultAdmissionRule_ = builderForValue.build(); - onChanged(); - } else { - defaultAdmissionRuleBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDefaultAdmissionRule( - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule value) { - if (defaultAdmissionRuleBuilder_ == null) { - if (defaultAdmissionRule_ != null) { - defaultAdmissionRule_ = - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.newBuilder( - defaultAdmissionRule_) - .mergeFrom(value) - .buildPartial(); - } else { - defaultAdmissionRule_ = value; - } - onChanged(); - } else { - defaultAdmissionRuleBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDefaultAdmissionRule() { - if (defaultAdmissionRuleBuilder_ == null) { - defaultAdmissionRule_ = null; - onChanged(); - } else { - defaultAdmissionRule_ = null; - defaultAdmissionRuleBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder - getDefaultAdmissionRuleBuilder() { - - onChanged(); - return getDefaultAdmissionRuleFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder - getDefaultAdmissionRuleOrBuilder() { - if (defaultAdmissionRuleBuilder_ != null) { - return defaultAdmissionRuleBuilder_.getMessageOrBuilder(); - } else { - return defaultAdmissionRule_ == null - ? com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.getDefaultInstance() - : defaultAdmissionRule_; - } - } - /** - * - * - *
-     * Required. Default admission rule for a cluster without a per-cluster, per-
-     * kubernetes-service-account, or per-istio-service-identity admission rule.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder> - getDefaultAdmissionRuleFieldBuilder() { - if (defaultAdmissionRuleBuilder_ == null) { - defaultAdmissionRuleBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule.Builder, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder>( - getDefaultAdmissionRule(), getParentForChildren(), isClean()); - defaultAdmissionRule_ = null; - } - return defaultAdmissionRuleBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * Output only. Time when the policy was last updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.binaryauthorization.v1beta1.Policy) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.Policy) - private static final com.google.cloud.binaryauthorization.v1beta1.Policy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.Policy(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.Policy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Policy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Policy(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.binaryauthorization.v1beta1.Policy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyName.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyName.java deleted file mode 100644 index 80c0bb2a..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class PolicyName implements ResourceName { - private static final PathTemplate PROJECT = - PathTemplate.createWithoutUrlEncoding("projects/{project}/policy"); - private volatile Map fieldValuesMap; - private final String project; - - @Deprecated - protected PolicyName() { - project = null; - } - - private PolicyName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - } - - public String getProject() { - return project; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static PolicyName of(String project) { - return newBuilder().setProject(project).build(); - } - - public static String format(String project) { - return newBuilder().setProject(project).build().toString(); - } - - public static PolicyName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT.validatedMatch( - formattedString, "PolicyName.parse: formattedString not in valid format"); - return of(matchMap.get("project")); - } - - 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 (PolicyName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT.instantiate("project", project); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - PolicyName that = ((PolicyName) o); - return Objects.equals(this.project, that.project); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - return h; - } - - /** Builder for projects/{project}/policy. */ - public static class Builder { - private String project; - - protected Builder() {} - - public String getProject() { - return project; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder(PolicyName policyName) { - this.project = policyName.project; - } - - public PolicyName build() { - return new PolicyName(this); - } - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyOrBuilder.java deleted file mode 100644 index c81c969d..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/PolicyOrBuilder.java +++ /dev/null @@ -1,371 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface PolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.Policy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Output only. The resource name, in the format `projects/*/policy`. There is
-   * at most one policy per project.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Output only. The resource name, in the format `projects/*/policy`. There is
-   * at most one policy per project.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Optional. A descriptive comment.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-   * Optional. A descriptive comment.
-   * 
- * - * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - - /** - * - * - *
-   * Optional. Controls the evaluation of a Google-maintained global admission
-   * policy for common system-level images. Images not covered by the global
-   * policy will be subject to the project admission policy. This setting
-   * has no effect when specified inside a global admission policy.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The enum numeric value on the wire for globalPolicyEvaluationMode. - */ - int getGlobalPolicyEvaluationModeValue(); - /** - * - * - *
-   * Optional. Controls the evaluation of a Google-maintained global admission
-   * policy for common system-level images. Images not covered by the global
-   * policy will be subject to the project admission policy. This setting
-   * has no effect when specified inside a global admission policy.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The globalPolicyEvaluationMode. - */ - com.google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - getGlobalPolicyEvaluationMode(); - - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.List - getAdmissionWhitelistPatternsList(); - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - getAdmissionWhitelistPatterns(int index); - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - int getAdmissionWhitelistPatternsCount(); - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.List< - ? extends com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder> - getAdmissionWhitelistPatternsOrBuilderList(); - /** - * - * - *
-   * Optional. Admission policy allowlisting. A matching admission request will
-   * always be permitted. This feature is typically used to exclude Google or
-   * third-party infrastructure images from Binary Authorization policies.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPatternOrBuilder - getAdmissionWhitelistPatternsOrBuilder(int index); - - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - int getClusterAdmissionRulesCount(); - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - boolean containsClusterAdmissionRules(java.lang.String key); - /** Use {@link #getClusterAdmissionRulesMap()} instead. */ - @java.lang.Deprecated - java.util.Map - getClusterAdmissionRules(); - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.Map - getClusterAdmissionRulesMap(); - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getClusterAdmissionRulesOrDefault( - java.lang.String key, - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule defaultValue); - /** - * - * - *
-   * Optional. Per-cluster admission rules. Cluster spec format:
-   * `location.clusterId`. There can be at most one admission rule per cluster
-   * spec.
-   * A `location` is either a compute zone (e.g. us-central1-a) or a region
-   * (e.g. us-central1).
-   * For `clusterId` syntax restrictions see
-   * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
-   * 
- * - * - * map<string, .google.cloud.binaryauthorization.v1beta1.AdmissionRule> cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getClusterAdmissionRulesOrThrow( - java.lang.String key); - - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the defaultAdmissionRule field is set. - */ - boolean hasDefaultAdmissionRule(); - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The defaultAdmissionRule. - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRule getDefaultAdmissionRule(); - /** - * - * - *
-   * Required. Default admission rule for a cluster without a per-cluster, per-
-   * kubernetes-service-account, or per-istio-service-identity admission rule.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AdmissionRuleOrBuilder - getDefaultAdmissionRuleOrBuilder(); - - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * Output only. Time when the policy was last updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ProjectName.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ProjectName.java deleted file mode 100644 index 657e1a23..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ProjectName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * 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.binaryauthorization.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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ProjectName implements ResourceName { - private static final PathTemplate PROJECT = - PathTemplate.createWithoutUrlEncoding("projects/{project}"); - private volatile Map fieldValuesMap; - private final String project; - - @Deprecated - protected ProjectName() { - project = null; - } - - private ProjectName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - } - - public String getProject() { - return project; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProjectName of(String project) { - return newBuilder().setProject(project).build(); - } - - public static String format(String project) { - return newBuilder().setProject(project).build().toString(); - } - - public static ProjectName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT.validatedMatch( - formattedString, "ProjectName.parse: formattedString not in valid format"); - return of(matchMap.get("project")); - } - - 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 (ProjectName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT.instantiate("project", project); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ProjectName that = ((ProjectName) o); - return Objects.equals(this.project, that.project); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - return h; - } - - /** Builder for projects/{project}. */ - public static class Builder { - private String project; - - protected Builder() {} - - public String getProject() { - return project; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder(ProjectName projectName) { - this.project = projectName.project; - } - - public ProjectName build() { - return new ProjectName(this); - } - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequest.java deleted file mode 100644 index 826cbb4e..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequest.java +++ /dev/null @@ -1,831 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.UpdateAttestor][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest} - */ -public final class UpdateAttestorRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) - UpdateAttestorRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateAttestorRequest.newBuilder() to construct. - private UpdateAttestorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateAttestorRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateAttestorRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateAttestorRequest( - 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.binaryauthorization.v1beta1.Attestor.Builder subBuilder = null; - if (attestor_ != null) { - subBuilder = attestor_.toBuilder(); - } - attestor_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.Attestor.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(attestor_); - attestor_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.Builder.class); - } - - public static final int ATTESTOR_FIELD_NUMBER = 1; - private com.google.cloud.binaryauthorization.v1beta1.Attestor attestor_; - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - @java.lang.Override - public boolean hasAttestor() { - return attestor_ != null; - } - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor() { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder() { - return getAttestor(); - } - - 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 (attestor_ != null) { - output.writeMessage(1, getAttestor()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (attestor_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAttestor()); - } - 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.binaryauthorization.v1beta1.UpdateAttestorRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest other = - (com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) obj; - - if (hasAttestor() != other.hasAttestor()) return false; - if (hasAttestor()) { - if (!getAttestor().equals(other.getAttestor())) 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 (hasAttestor()) { - hash = (37 * hash) + ATTESTOR_FIELD_NUMBER; - hash = (53 * hash) + getAttestor().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest 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.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest 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.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest 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.binaryauthorization.v1beta1.UpdateAttestorRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - 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.binaryauthorization.v1beta1.UpdateAttestorRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest 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.binaryauthorization.v1beta1.UpdateAttestorRequest 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 message for [BinauthzManagementService.UpdateAttestor][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.class, - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest.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 (attestorBuilder_ == null) { - attestor_ = null; - } else { - attestor_ = null; - attestorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdateAttestorRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest build() { - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest result = - new com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest(this); - if (attestorBuilder_ == null) { - result.attestor_ = attestor_; - } else { - result.attestor_ = attestorBuilder_.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.binaryauthorization.v1beta1.UpdateAttestorRequest) { - return mergeFrom( - (com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - .getDefaultInstance()) return this; - if (other.hasAttestor()) { - mergeAttestor(other.getAttestor()); - } - 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.binaryauthorization.v1beta1.UpdateAttestorRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.binaryauthorization.v1beta1.Attestor attestor_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - attestorBuilder_; - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - public boolean hasAttestor() { - return attestorBuilder_ != null || attestor_ != null; - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor() { - if (attestorBuilder_ == null) { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } else { - return attestorBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAttestor(com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - attestor_ = value; - onChanged(); - } else { - attestorBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAttestor( - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder builderForValue) { - if (attestorBuilder_ == null) { - attestor_ = builderForValue.build(); - onChanged(); - } else { - attestorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAttestor(com.google.cloud.binaryauthorization.v1beta1.Attestor value) { - if (attestorBuilder_ == null) { - if (attestor_ != null) { - attestor_ = - com.google.cloud.binaryauthorization.v1beta1.Attestor.newBuilder(attestor_) - .mergeFrom(value) - .buildPartial(); - } else { - attestor_ = value; - } - onChanged(); - } else { - attestorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAttestor() { - if (attestorBuilder_ == null) { - attestor_ = null; - onChanged(); - } else { - attestor_ = null; - attestorBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder getAttestorBuilder() { - - onChanged(); - return getAttestorFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder() { - if (attestorBuilder_ != null) { - return attestorBuilder_.getMessageOrBuilder(); - } else { - return attestor_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Attestor.getDefaultInstance() - : attestor_; - } - } - /** - * - * - *
-     * Required. The updated
-     * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-     * service will overwrite the [attestor
-     * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-     * the resource name in the request URL, in the format
-     * `projects/*/attestors/*`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder> - getAttestorFieldBuilder() { - if (attestorBuilder_ == null) { - attestorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Attestor, - com.google.cloud.binaryauthorization.v1beta1.Attestor.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder>( - getAttestor(), getParentForChildren(), isClean()); - attestor_ = null; - } - return attestorBuilder_; - } - - @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.binaryauthorization.v1beta1.UpdateAttestorRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateAttestorRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateAttestorRequest(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.binaryauthorization.v1beta1.UpdateAttestorRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequestOrBuilder.java deleted file mode 100644 index 67b57d87..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdateAttestorRequestOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface UpdateAttestorRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the attestor field is set. - */ - boolean hasAttestor(); - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The attestor. - */ - com.google.cloud.binaryauthorization.v1beta1.Attestor getAttestor(); - /** - * - * - *
-   * Required. The updated
-   * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The
-   * service will overwrite the [attestor
-   * name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
-   * the resource name in the request URL, in the format
-   * `projects/*/attestors/*`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AttestorOrBuilder getAttestorOrBuilder(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequest.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequest.java deleted file mode 100644 index a5516515..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequest.java +++ /dev/null @@ -1,815 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * Request message for [BinauthzManagementService.UpdatePolicy][].
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest} - */ -public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) - UpdatePolicyRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdatePolicyRequest.newBuilder() to construct. - private UpdatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdatePolicyRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdatePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdatePolicyRequest( - 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.binaryauthorization.v1beta1.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.Policy.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = 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.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.class, - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.Builder.class); - } - - public static final int POLICY_FIELD_NUMBER = 1; - private com.google.cloud.binaryauthorization.v1beta1.Policy policy_; - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policy field is set. - */ - @java.lang.Override - public boolean hasPolicy() { - return policy_ != null; - } - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policy. - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.Policy getPolicy() { - return policy_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Policy.getDefaultInstance() - : policy_; - } - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder getPolicyOrBuilder() { - return getPolicy(); - } - - 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 (policy_ != null) { - output.writeMessage(1, getPolicy()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (policy_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); - } - 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.binaryauthorization.v1beta1.UpdatePolicyRequest)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest other = - (com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) obj; - - if (hasPolicy() != other.hasPolicy()) return false; - if (hasPolicy()) { - if (!getPolicy().equals(other.getPolicy())) 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 (hasPolicy()) { - hash = (37 * hash) + POLICY_FIELD_NUMBER; - hash = (53 * hash) + getPolicy().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest 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.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest 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.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest 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.binaryauthorization.v1beta1.UpdatePolicyRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest 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.binaryauthorization.v1beta1.UpdatePolicyRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest 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.binaryauthorization.v1beta1.UpdatePolicyRequest 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 message for [BinauthzManagementService.UpdatePolicy][].
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.class, - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.Builder.class); - } - - // Construct using com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.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 (policyBuilder_ == null) { - policy_ = null; - } else { - policy_ = null; - policyBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationServiceProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UpdatePolicyRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest build() { - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest result = - new com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest(this); - if (policyBuilder_ == null) { - result.policy_ = policy_; - } else { - result.policy_ = policyBuilder_.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.binaryauthorization.v1beta1.UpdatePolicyRequest) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest.getDefaultInstance()) - return this; - if (other.hasPolicy()) { - mergePolicy(other.getPolicy()); - } - 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.binaryauthorization.v1beta1.UpdatePolicyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.binaryauthorization.v1beta1.Policy policy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Policy, - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder, - com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder> - policyBuilder_; - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policy field is set. - */ - public boolean hasPolicy() { - return policyBuilder_ != null || policy_ != null; - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policy. - */ - public com.google.cloud.binaryauthorization.v1beta1.Policy getPolicy() { - if (policyBuilder_ == null) { - return policy_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Policy.getDefaultInstance() - : policy_; - } else { - return policyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPolicy(com.google.cloud.binaryauthorization.v1beta1.Policy value) { - if (policyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policy_ = value; - onChanged(); - } else { - policyBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPolicy( - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder builderForValue) { - if (policyBuilder_ == null) { - policy_ = builderForValue.build(); - onChanged(); - } else { - policyBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergePolicy(com.google.cloud.binaryauthorization.v1beta1.Policy value) { - if (policyBuilder_ == null) { - if (policy_ != null) { - policy_ = - com.google.cloud.binaryauthorization.v1beta1.Policy.newBuilder(policy_) - .mergeFrom(value) - .buildPartial(); - } else { - policy_ = value; - } - onChanged(); - } else { - policyBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearPolicy() { - if (policyBuilder_ == null) { - policy_ = null; - onChanged(); - } else { - policy_ = null; - policyBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.Policy.Builder getPolicyBuilder() { - - onChanged(); - return getPolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder getPolicyOrBuilder() { - if (policyBuilder_ != null) { - return policyBuilder_.getMessageOrBuilder(); - } else { - return policy_ == null - ? com.google.cloud.binaryauthorization.v1beta1.Policy.getDefaultInstance() - : policy_; - } - } - /** - * - * - *
-     * Required. A new or updated
-     * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-     * service will overwrite the [policy
-     * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-     * resource name in the request URL, in the format `projects/*/policy`.
-     * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Policy, - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder, - com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder> - getPolicyFieldBuilder() { - if (policyBuilder_ == null) { - policyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.Policy, - com.google.cloud.binaryauthorization.v1beta1.Policy.Builder, - com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder>( - getPolicy(), getParentForChildren(), isClean()); - policy_ = null; - } - return policyBuilder_; - } - - @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.binaryauthorization.v1beta1.UpdatePolicyRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) - private static final com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdatePolicyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdatePolicyRequest(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.binaryauthorization.v1beta1.UpdatePolicyRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequestOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequestOrBuilder.java deleted file mode 100644 index a22366a6..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UpdatePolicyRequestOrBuilder.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/service.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface UpdatePolicyRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policy field is set. - */ - boolean hasPolicy(); - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policy. - */ - com.google.cloud.binaryauthorization.v1beta1.Policy getPolicy(); - /** - * - * - *
-   * Required. A new or updated
-   * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The
-   * service will overwrite the [policy
-   * name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
-   * resource name in the request URL, in the format `projects/*/policy`.
-   * 
- * - * - * .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.PolicyOrBuilder getPolicyOrBuilder(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNote.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNote.java deleted file mode 100644 index e20a9861..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNote.java +++ /dev/null @@ -1,1629 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -/** - * - * - *
- * An [user owned drydock
- * note][google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote]
- * references a Drydock ATTESTATION_AUTHORITY Note created by the user.
- * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote} - */ -public final class UserOwnedDrydockNote extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - UserOwnedDrydockNoteOrBuilder { - private static final long serialVersionUID = 0L; - // Use UserOwnedDrydockNote.newBuilder() to construct. - private UserOwnedDrydockNote(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UserOwnedDrydockNote() { - noteReference_ = ""; - publicKeys_ = java.util.Collections.emptyList(); - delegationServiceAccountEmail_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UserOwnedDrydockNote(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UserOwnedDrydockNote( - 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(); - - noteReference_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - publicKeys_ = - new java.util.ArrayList< - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey>(); - mutable_bitField0_ |= 0x00000001; - } - publicKeys_.add( - input.readMessage( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.parser(), - extensionRegistry)); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - delegationServiceAccountEmail_ = 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)) { - publicKeys_ = java.util.Collections.unmodifiableList(publicKeys_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.class, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder.class); - } - - public static final int NOTE_REFERENCE_FIELD_NUMBER = 1; - private volatile java.lang.Object noteReference_; - /** - * - * - *
-   * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-   * created by the user, in the format: `projects/*/notes/*` (or the legacy
-   * `providers/*/notes/*`). This field may not be updated.
-   * An attestation by this attestor is stored as a Drydock
-   * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-   * links to this Note. Drydock is an external dependency.
-   * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The noteReference. - */ - @java.lang.Override - public java.lang.String getNoteReference() { - java.lang.Object ref = noteReference_; - 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(); - noteReference_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-   * created by the user, in the format: `projects/*/notes/*` (or the legacy
-   * `providers/*/notes/*`). This field may not be updated.
-   * An attestation by this attestor is stored as a Drydock
-   * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-   * links to this Note. Drydock is an external dependency.
-   * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for noteReference. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNoteReferenceBytes() { - java.lang.Object ref = noteReference_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - noteReference_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PUBLIC_KEYS_FIELD_NUMBER = 2; - private java.util.List - publicKeys_; - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.List - getPublicKeysList() { - return publicKeys_; - } - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder> - getPublicKeysOrBuilderList() { - return publicKeys_; - } - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public int getPublicKeysCount() { - return publicKeys_.size(); - } - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey getPublicKeys(int index) { - return publicKeys_.get(index); - } - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder - getPublicKeysOrBuilder(int index) { - return publicKeys_.get(index); - } - - public static final int DELEGATION_SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 3; - private volatile java.lang.Object delegationServiceAccountEmail_; - /** - * - * - *
-   * Output only. This field will contain the service account email address
-   * that this Attestor will use as the principal when querying Container
-   * Analysis. Attestor administrators must grant this service account the
-   * IAM role needed to read attestations from the [note_reference][Note] in
-   * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-   * This email address is fixed for the lifetime of the Attestor, but callers
-   * should not make any other assumptions about the service account email;
-   * future versions may use an email based on a different naming pattern.
-   * 
- * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The delegationServiceAccountEmail. - */ - @java.lang.Override - public java.lang.String getDelegationServiceAccountEmail() { - java.lang.Object ref = delegationServiceAccountEmail_; - 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(); - delegationServiceAccountEmail_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. This field will contain the service account email address
-   * that this Attestor will use as the principal when querying Container
-   * Analysis. Attestor administrators must grant this service account the
-   * IAM role needed to read attestations from the [note_reference][Note] in
-   * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-   * This email address is fixed for the lifetime of the Attestor, but callers
-   * should not make any other assumptions about the service account email;
-   * future versions may use an email based on a different naming pattern.
-   * 
- * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for delegationServiceAccountEmail. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDelegationServiceAccountEmailBytes() { - java.lang.Object ref = delegationServiceAccountEmail_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - delegationServiceAccountEmail_ = 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 (!getNoteReferenceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, noteReference_); - } - for (int i = 0; i < publicKeys_.size(); i++) { - output.writeMessage(2, publicKeys_.get(i)); - } - if (!getDelegationServiceAccountEmailBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, delegationServiceAccountEmail_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNoteReferenceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, noteReference_); - } - for (int i = 0; i < publicKeys_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, publicKeys_.get(i)); - } - if (!getDelegationServiceAccountEmailBytes().isEmpty()) { - size += - com.google.protobuf.GeneratedMessageV3.computeStringSize( - 3, delegationServiceAccountEmail_); - } - 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.binaryauthorization.v1beta1.UserOwnedDrydockNote)) { - return super.equals(obj); - } - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote other = - (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) obj; - - if (!getNoteReference().equals(other.getNoteReference())) return false; - if (!getPublicKeysList().equals(other.getPublicKeysList())) return false; - if (!getDelegationServiceAccountEmail().equals(other.getDelegationServiceAccountEmail())) - 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) + NOTE_REFERENCE_FIELD_NUMBER; - hash = (53 * hash) + getNoteReference().hashCode(); - if (getPublicKeysCount() > 0) { - hash = (37 * hash) + PUBLIC_KEYS_FIELD_NUMBER; - hash = (53 * hash) + getPublicKeysList().hashCode(); - } - hash = (37 * hash) + DELEGATION_SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getDelegationServiceAccountEmail().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote 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.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote 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.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote 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.binaryauthorization.v1beta1.UserOwnedDrydockNote - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - 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.binaryauthorization.v1beta1.UserOwnedDrydockNote parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote 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.binaryauthorization.v1beta1.UserOwnedDrydockNote 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 [user owned drydock
-   * note][google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote]
-   * references a Drydock ATTESTATION_AUTHORITY Note created by the user.
-   * 
- * - * Protobuf type {@code google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNoteOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.class, - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.Builder.class); - } - - // Construct using - // com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getPublicKeysFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - noteReference_ = ""; - - if (publicKeysBuilder_ == null) { - publicKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - publicKeysBuilder_.clear(); - } - delegationServiceAccountEmail_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.binaryauthorization.v1beta1.BinaryAuthorizationResourcesProto - .internal_static_google_cloud_binaryauthorization_v1beta1_UserOwnedDrydockNote_descriptor; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - getDefaultInstanceForType() { - return com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote build() { - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote buildPartial() { - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote result = - new com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote(this); - int from_bitField0_ = bitField0_; - result.noteReference_ = noteReference_; - if (publicKeysBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - publicKeys_ = java.util.Collections.unmodifiableList(publicKeys_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.publicKeys_ = publicKeys_; - } else { - result.publicKeys_ = publicKeysBuilder_.build(); - } - result.delegationServiceAccountEmail_ = delegationServiceAccountEmail_; - 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.binaryauthorization.v1beta1.UserOwnedDrydockNote) { - return mergeFrom((com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote other) { - if (other - == com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.getDefaultInstance()) - return this; - if (!other.getNoteReference().isEmpty()) { - noteReference_ = other.noteReference_; - onChanged(); - } - if (publicKeysBuilder_ == null) { - if (!other.publicKeys_.isEmpty()) { - if (publicKeys_.isEmpty()) { - publicKeys_ = other.publicKeys_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePublicKeysIsMutable(); - publicKeys_.addAll(other.publicKeys_); - } - onChanged(); - } - } else { - if (!other.publicKeys_.isEmpty()) { - if (publicKeysBuilder_.isEmpty()) { - publicKeysBuilder_.dispose(); - publicKeysBuilder_ = null; - publicKeys_ = other.publicKeys_; - bitField0_ = (bitField0_ & ~0x00000001); - publicKeysBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPublicKeysFieldBuilder() - : null; - } else { - publicKeysBuilder_.addAllMessages(other.publicKeys_); - } - } - } - if (!other.getDelegationServiceAccountEmail().isEmpty()) { - delegationServiceAccountEmail_ = other.delegationServiceAccountEmail_; - 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.binaryauthorization.v1beta1.UserOwnedDrydockNote parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object noteReference_ = ""; - /** - * - * - *
-     * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-     * created by the user, in the format: `projects/*/notes/*` (or the legacy
-     * `providers/*/notes/*`). This field may not be updated.
-     * An attestation by this attestor is stored as a Drydock
-     * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-     * links to this Note. Drydock is an external dependency.
-     * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The noteReference. - */ - public java.lang.String getNoteReference() { - java.lang.Object ref = noteReference_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - noteReference_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-     * created by the user, in the format: `projects/*/notes/*` (or the legacy
-     * `providers/*/notes/*`). This field may not be updated.
-     * An attestation by this attestor is stored as a Drydock
-     * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-     * links to this Note. Drydock is an external dependency.
-     * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for noteReference. - */ - public com.google.protobuf.ByteString getNoteReferenceBytes() { - java.lang.Object ref = noteReference_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - noteReference_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-     * created by the user, in the format: `projects/*/notes/*` (or the legacy
-     * `providers/*/notes/*`). This field may not be updated.
-     * An attestation by this attestor is stored as a Drydock
-     * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-     * links to this Note. Drydock is an external dependency.
-     * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The noteReference to set. - * @return This builder for chaining. - */ - public Builder setNoteReference(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - noteReference_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-     * created by the user, in the format: `projects/*/notes/*` (or the legacy
-     * `providers/*/notes/*`). This field may not be updated.
-     * An attestation by this attestor is stored as a Drydock
-     * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-     * links to this Note. Drydock is an external dependency.
-     * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearNoteReference() { - - noteReference_ = getDefaultInstance().getNoteReference(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-     * created by the user, in the format: `projects/*/notes/*` (or the legacy
-     * `providers/*/notes/*`). This field may not be updated.
-     * An attestation by this attestor is stored as a Drydock
-     * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-     * links to this Note. Drydock is an external dependency.
-     * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for noteReference to set. - * @return This builder for chaining. - */ - public Builder setNoteReferenceBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - noteReference_ = value; - onChanged(); - return this; - } - - private java.util.List - publicKeys_ = java.util.Collections.emptyList(); - - private void ensurePublicKeysIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - publicKeys_ = - new java.util.ArrayList( - publicKeys_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder> - publicKeysBuilder_; - - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List - getPublicKeysList() { - if (publicKeysBuilder_ == null) { - return java.util.Collections.unmodifiableList(publicKeys_); - } else { - return publicKeysBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public int getPublicKeysCount() { - if (publicKeysBuilder_ == null) { - return publicKeys_.size(); - } else { - return publicKeysBuilder_.getCount(); - } - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey getPublicKeys(int index) { - if (publicKeysBuilder_ == null) { - return publicKeys_.get(index); - } else { - return publicKeysBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setPublicKeys( - int index, com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey value) { - if (publicKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePublicKeysIsMutable(); - publicKeys_.set(index, value); - onChanged(); - } else { - publicKeysBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setPublicKeys( - int index, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder builderForValue) { - if (publicKeysBuilder_ == null) { - ensurePublicKeysIsMutable(); - publicKeys_.set(index, builderForValue.build()); - onChanged(); - } else { - publicKeysBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addPublicKeys( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey value) { - if (publicKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePublicKeysIsMutable(); - publicKeys_.add(value); - onChanged(); - } else { - publicKeysBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addPublicKeys( - int index, com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey value) { - if (publicKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePublicKeysIsMutable(); - publicKeys_.add(index, value); - onChanged(); - } else { - publicKeysBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addPublicKeys( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder builderForValue) { - if (publicKeysBuilder_ == null) { - ensurePublicKeysIsMutable(); - publicKeys_.add(builderForValue.build()); - onChanged(); - } else { - publicKeysBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addPublicKeys( - int index, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder builderForValue) { - if (publicKeysBuilder_ == null) { - ensurePublicKeysIsMutable(); - publicKeys_.add(index, builderForValue.build()); - onChanged(); - } else { - publicKeysBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder addAllPublicKeys( - java.lang.Iterable - values) { - if (publicKeysBuilder_ == null) { - ensurePublicKeysIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, publicKeys_); - onChanged(); - } else { - publicKeysBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder clearPublicKeys() { - if (publicKeysBuilder_ == null) { - publicKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - publicKeysBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder removePublicKeys(int index) { - if (publicKeysBuilder_ == null) { - ensurePublicKeysIsMutable(); - publicKeys_.remove(index); - onChanged(); - } else { - publicKeysBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder - getPublicKeysBuilder(int index) { - return getPublicKeysFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder - getPublicKeysOrBuilder(int index) { - if (publicKeysBuilder_ == null) { - return publicKeys_.get(index); - } else { - return publicKeysBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List< - ? extends com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder> - getPublicKeysOrBuilderList() { - if (publicKeysBuilder_ != null) { - return publicKeysBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(publicKeys_); - } - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder - addPublicKeysBuilder() { - return getPublicKeysFieldBuilder() - .addBuilder( - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance()); - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder - addPublicKeysBuilder(int index) { - return getPublicKeysFieldBuilder() - .addBuilder( - index, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.getDefaultInstance()); - } - /** - * - * - *
-     * Optional. Public keys that verify attestations signed by this
-     * attestor.  This field may be updated.
-     * If this field is non-empty, one of the specified public keys must
-     * verify that an attestation was signed by this attestor for the
-     * image specified in the admission request.
-     * If this field is empty, this attestor always returns that no
-     * valid attestations exist.
-     * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public java.util.List - getPublicKeysBuilderList() { - return getPublicKeysFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder> - getPublicKeysFieldBuilder() { - if (publicKeysBuilder_ == null) { - publicKeysBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.Builder, - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder>( - publicKeys_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - publicKeys_ = null; - } - return publicKeysBuilder_; - } - - private java.lang.Object delegationServiceAccountEmail_ = ""; - /** - * - * - *
-     * Output only. This field will contain the service account email address
-     * that this Attestor will use as the principal when querying Container
-     * Analysis. Attestor administrators must grant this service account the
-     * IAM role needed to read attestations from the [note_reference][Note] in
-     * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-     * This email address is fixed for the lifetime of the Attestor, but callers
-     * should not make any other assumptions about the service account email;
-     * future versions may use an email based on a different naming pattern.
-     * 
- * - * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The delegationServiceAccountEmail. - */ - public java.lang.String getDelegationServiceAccountEmail() { - java.lang.Object ref = delegationServiceAccountEmail_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - delegationServiceAccountEmail_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. This field will contain the service account email address
-     * that this Attestor will use as the principal when querying Container
-     * Analysis. Attestor administrators must grant this service account the
-     * IAM role needed to read attestations from the [note_reference][Note] in
-     * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-     * This email address is fixed for the lifetime of the Attestor, but callers
-     * should not make any other assumptions about the service account email;
-     * future versions may use an email based on a different naming pattern.
-     * 
- * - * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for delegationServiceAccountEmail. - */ - public com.google.protobuf.ByteString getDelegationServiceAccountEmailBytes() { - java.lang.Object ref = delegationServiceAccountEmail_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - delegationServiceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. This field will contain the service account email address
-     * that this Attestor will use as the principal when querying Container
-     * Analysis. Attestor administrators must grant this service account the
-     * IAM role needed to read attestations from the [note_reference][Note] in
-     * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-     * This email address is fixed for the lifetime of the Attestor, but callers
-     * should not make any other assumptions about the service account email;
-     * future versions may use an email based on a different naming pattern.
-     * 
- * - * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The delegationServiceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setDelegationServiceAccountEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - delegationServiceAccountEmail_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. This field will contain the service account email address
-     * that this Attestor will use as the principal when querying Container
-     * Analysis. Attestor administrators must grant this service account the
-     * IAM role needed to read attestations from the [note_reference][Note] in
-     * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-     * This email address is fixed for the lifetime of the Attestor, but callers
-     * should not make any other assumptions about the service account email;
-     * future versions may use an email based on a different naming pattern.
-     * 
- * - * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearDelegationServiceAccountEmail() { - - delegationServiceAccountEmail_ = getDefaultInstance().getDelegationServiceAccountEmail(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. This field will contain the service account email address
-     * that this Attestor will use as the principal when querying Container
-     * Analysis. Attestor administrators must grant this service account the
-     * IAM role needed to read attestations from the [note_reference][Note] in
-     * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-     * This email address is fixed for the lifetime of the Attestor, but callers
-     * should not make any other assumptions about the service account email;
-     * future versions may use an email based on a different naming pattern.
-     * 
- * - * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The bytes for delegationServiceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setDelegationServiceAccountEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - delegationServiceAccountEmail_ = 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.binaryauthorization.v1beta1.UserOwnedDrydockNote) - } - - // @@protoc_insertion_point(class_scope:google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - private static final com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote(); - } - - public static com.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UserOwnedDrydockNote parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UserOwnedDrydockNote(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.binaryauthorization.v1beta1.UserOwnedDrydockNote - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNoteOrBuilder.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNoteOrBuilder.java deleted file mode 100644 index 5a2c8227..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/UserOwnedDrydockNoteOrBuilder.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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/binaryauthorization/v1beta1/resources.proto - -package com.google.cloud.binaryauthorization.v1beta1; - -public interface UserOwnedDrydockNoteOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-   * created by the user, in the format: `projects/*/notes/*` (or the legacy
-   * `providers/*/notes/*`). This field may not be updated.
-   * An attestation by this attestor is stored as a Drydock
-   * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-   * links to this Note. Drydock is an external dependency.
-   * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The noteReference. - */ - java.lang.String getNoteReference(); - /** - * - * - *
-   * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
-   * created by the user, in the format: `projects/*/notes/*` (or the legacy
-   * `providers/*/notes/*`). This field may not be updated.
-   * An attestation by this attestor is stored as a Drydock
-   * ATTESTATION_AUTHORITY Occurrence that names a container image and that
-   * links to this Note. Drydock is an external dependency.
-   * 
- * - * string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for noteReference. - */ - com.google.protobuf.ByteString getNoteReferenceBytes(); - - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.List - getPublicKeysList(); - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey getPublicKeys(int index); - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - int getPublicKeysCount(); - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - java.util.List - getPublicKeysOrBuilderList(); - /** - * - * - *
-   * Optional. Public keys that verify attestations signed by this
-   * attestor.  This field may be updated.
-   * If this field is non-empty, one of the specified public keys must
-   * verify that an attestation was signed by this attestor for the
-   * image specified in the admission request.
-   * If this field is empty, this attestor always returns that no
-   * valid attestations exist.
-   * 
- * - * - * repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.binaryauthorization.v1beta1.AttestorPublicKeyOrBuilder getPublicKeysOrBuilder( - int index); - - /** - * - * - *
-   * Output only. This field will contain the service account email address
-   * that this Attestor will use as the principal when querying Container
-   * Analysis. Attestor administrators must grant this service account the
-   * IAM role needed to read attestations from the [note_reference][Note] in
-   * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-   * This email address is fixed for the lifetime of the Attestor, but callers
-   * should not make any other assumptions about the service account email;
-   * future versions may use an email based on a different naming pattern.
-   * 
- * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The delegationServiceAccountEmail. - */ - java.lang.String getDelegationServiceAccountEmail(); - /** - * - * - *
-   * Output only. This field will contain the service account email address
-   * that this Attestor will use as the principal when querying Container
-   * Analysis. Attestor administrators must grant this service account the
-   * IAM role needed to read attestations from the [note_reference][Note] in
-   * Container Analysis (`containeranalysis.notes.occurrences.viewer`).
-   * This email address is fixed for the lifetime of the Attestor, but callers
-   * should not make any other assumptions about the service account email;
-   * future versions may use an email based on a different naming pattern.
-   * 
- * - * string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for delegationServiceAccountEmail. - */ - com.google.protobuf.ByteString getDelegationServiceAccountEmailBytes(); -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto b/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto deleted file mode 100644 index 4f7bfdd8..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// 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.binaryauthorization.v1beta1; - -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1;binaryauthorization"; -option java_multiple_files = true; -option java_outer_classname = "ContinuousValidationLoggingProto"; -option java_package = "com.google.cloud.binaryauthorization.v1beta1"; -option php_namespace = "Google\\Cloud\\BinaryAuthorization\\V1beta1"; -option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1"; - -// Represents an auditing event from Continuous Validation. -message ContinuousValidationEvent { - // An auditing event for one Pod. - message ContinuousValidationPodEvent { - // Container image with auditing details. - message ImageDetails { - // Result of the audit. - enum AuditResult { - // Unspecified result. This is an error. - AUDIT_RESULT_UNSPECIFIED = 0; - - // Image is allowed. - ALLOW = 1; - - // Image is denied. - DENY = 2; - } - - // The name of the image. - string image = 1; - - // The result of the audit for this image. - AuditResult result = 2; - - // Description of the above result. - string description = 3; - } - - // Audit time policy conformance verdict. - enum PolicyConformanceVerdict { - // We should always have a verdict. This is an error. - POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - - // The pod violates the policy. - VIOLATES_POLICY = 1; - } - - // The name of the Pod. - string pod = 1; - - // Deploy time of the Pod from k8s. - google.protobuf.Timestamp deploy_time = 2; - - // Termination time of the Pod from k8s, or nothing if still running. - google.protobuf.Timestamp end_time = 3; - - // Auditing verdict for this Pod. - PolicyConformanceVerdict verdict = 4; - - // List of images with auditing details. - repeated ImageDetails images = 5; - } - - // An event describing that the project policy is unsupported by CV. - message UnsupportedPolicyEvent { - // A description of the unsupported policy. - string description = 1; - } - - // Type of CV event. - oneof event_type { - // Pod event. - ContinuousValidationPodEvent pod_event = 1; - - // Unsupported policy event. - UnsupportedPolicyEvent unsupported_policy_event = 2; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/resources.proto b/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/resources.proto deleted file mode 100644 index b596df9b..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/resources.proto +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2021 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// 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.binaryauthorization.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1;binaryauthorization"; -option java_multiple_files = true; -option java_outer_classname = "BinaryAuthorizationResourcesProto"; -option java_package = "com.google.cloud.binaryauthorization.v1beta1"; -option php_namespace = "Google\\Cloud\\BinaryAuthorization\\V1beta1"; -option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1"; - -// A [policy][google.cloud.binaryauthorization.v1beta1.Policy] for container -// image binary authorization. -message Policy { - option (google.api.resource) = { - type: "binaryauthorization.googleapis.com/Policy" - pattern: "projects/{project}/policy" - }; - - enum GlobalPolicyEvaluationMode { - // Not specified: DISABLE is assumed. - GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - - // Enables system policy evaluation. - ENABLE = 1; - - // Disables system policy evaluation. - DISABLE = 2; - } - - // Output only. The resource name, in the format `projects/*/policy`. There is - // at most one policy per project. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A descriptive comment. - string description = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Controls the evaluation of a Google-maintained global admission - // policy for common system-level images. Images not covered by the global - // policy will be subject to the project admission policy. This setting - // has no effect when specified inside a global admission policy. - GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Admission policy allowlisting. A matching admission request will - // always be permitted. This feature is typically used to exclude Google or - // third-party infrastructure images from Binary Authorization policies. - repeated AdmissionWhitelistPattern admission_whitelist_patterns = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Per-cluster admission rules. Cluster spec format: - // `location.clusterId`. There can be at most one admission rule per cluster - // spec. - // A `location` is either a compute zone (e.g. us-central1-a) or a region - // (e.g. us-central1). - // For `clusterId` syntax restrictions see - // https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - map cluster_admission_rules = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Default admission rule for a cluster without a per-cluster, per- - // kubernetes-service-account, or per-istio-service-identity admission rule. - AdmissionRule default_admission_rule = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Output only. Time when the policy was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// An [admission allowlist -// pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern] -// exempts images from checks by [admission -// rules][google.cloud.binaryauthorization.v1beta1.AdmissionRule]. -message AdmissionWhitelistPattern { - // An image name pattern to allow, in the form `registry/path/to/image`. - // This supports a trailing `*` as a wildcard, but this is allowed only in - // text after the `registry/` part. - string name_pattern = 1; -} - -// An [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule] -// specifies either that all container images used in a pod creation request -// must be attested to by one or more -// [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod -// creations will be allowed, or that all pod creations will be denied. -// -// Images matching an [admission allowlist -// pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern] -// are exempted from admission rules and will never block a pod creation. -message AdmissionRule { - enum EvaluationMode { - // Do not use. - EVALUATION_MODE_UNSPECIFIED = 0; - - // This rule allows all all pod creations. - ALWAYS_ALLOW = 1; - - // This rule allows a pod creation if all the attestors listed in - // 'require_attestations_by' have valid attestations for all of the - // images in the pod spec. - REQUIRE_ATTESTATION = 2; - - // This rule denies all pod creations. - ALWAYS_DENY = 3; - } - - // Defines the possible actions when a pod creation is denied by an admission - // rule. - enum EnforcementMode { - // Do not use. - ENFORCEMENT_MODE_UNSPECIFIED = 0; - - // Enforce the admission rule by blocking the pod creation. - ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - - // Dryrun mode: Audit logging only. This will allow the pod creation as if - // the admission request had specified break-glass. - DRYRUN_AUDIT_LOG_ONLY = 2; - } - - // Required. How this admission rule will be evaluated. - EvaluationMode evaluation_mode = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The resource names of the attestors that must attest to - // a container image, in the format `projects/*/attestors/*`. Each - // attestor must exist before a policy can reference it. To add an attestor - // to a policy the principal issuing the policy change request must be able - // to read the attestor resource. - // - // Note: this field must be non-empty when the evaluation_mode field specifies - // REQUIRE_ATTESTATION, otherwise it must be empty. - repeated string require_attestations_by = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The action when a pod creation is denied by the admission rule. - EnforcementMode enforcement_mode = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// An [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests -// to container image artifacts. An existing attestor cannot be modified except -// where indicated. -message Attestor { - option (google.api.resource) = { - type: "binaryauthorization.googleapis.com/Attestor" - pattern: "projects/{project}/attestors/{attestor}" - }; - - // Required. The resource name, in the format: - // `projects/*/attestors/*`. This field may not be updated. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A descriptive comment. This field may be updated. - // The field may be displayed in chooser dialogs. - string description = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Identifies an - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests - // to a container image artifact. This determines how an attestation will be - // stored, and how it will be used during policy enforcement. Updates may not - // change the attestor type, but individual attestor fields may be updated - oneof attestor_type { - // A Drydock ATTESTATION_AUTHORITY Note, created by the user. - UserOwnedDrydockNote user_owned_drydock_note = 3; - } - - // Output only. Time when the attestor was last updated. - google.protobuf.Timestamp update_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// An [user owned drydock -// note][google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote] -// references a Drydock ATTESTATION_AUTHORITY Note created by the user. -message UserOwnedDrydockNote { - // Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - // created by the user, in the format: `projects/*/notes/*` (or the legacy - // `providers/*/notes/*`). This field may not be updated. - // - // An attestation by this attestor is stored as a Drydock - // ATTESTATION_AUTHORITY Occurrence that names a container image and that - // links to this Note. Drydock is an external dependency. - string note_reference = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Public keys that verify attestations signed by this - // attestor. This field may be updated. - // - // If this field is non-empty, one of the specified public keys must - // verify that an attestation was signed by this attestor for the - // image specified in the admission request. - // - // If this field is empty, this attestor always returns that no - // valid attestations exist. - repeated AttestorPublicKey public_keys = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. This field will contain the service account email address - // that this Attestor will use as the principal when querying Container - // Analysis. Attestor administrators must grant this service account the - // IAM role needed to read attestations from the [note_reference][Note] in - // Container Analysis (`containeranalysis.notes.occurrences.viewer`). - // - // This email address is fixed for the lifetime of the Attestor, but callers - // should not make any other assumptions about the service account email; - // future versions may use an email based on a different naming pattern. - string delegation_service_account_email = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A public key in the PkixPublicKey format (see -// https://tools.ietf.org/html/rfc5280#section-4.1.2.7 for details). -// Public keys of this type are typically textually encoded using the PEM -// format. -message PkixPublicKey { - // Represents a signature algorithm and other information necessary to verify - // signatures with a given public key. - // This is based primarily on the public key types supported by Tink's - // PemKeyType, which is in turn based on KMS's supported signing algorithms. - // See https://cloud.google.com/kms/docs/algorithms. In the future, BinAuthz - // might support additional public key types independently of Tink and/or KMS. - enum SignatureAlgorithm { - // Not specified. - SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - - // RSASSA-PSS 2048 bit key with a SHA256 digest. - RSA_PSS_2048_SHA256 = 1; - - // RSASSA-PSS 3072 bit key with a SHA256 digest. - RSA_PSS_3072_SHA256 = 2; - - // RSASSA-PSS 4096 bit key with a SHA256 digest. - RSA_PSS_4096_SHA256 = 3; - - // RSASSA-PSS 4096 bit key with a SHA512 digest. - RSA_PSS_4096_SHA512 = 4; - - // RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_2048_SHA256 = 5; - - // RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_3072_SHA256 = 6; - - // RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_4096_SHA256 = 7; - - // RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. - RSA_SIGN_PKCS1_4096_SHA512 = 8; - - // ECDSA on the NIST P-256 curve with a SHA256 digest. - ECDSA_P256_SHA256 = 9; - - // ECDSA on the NIST P-384 curve with a SHA384 digest. - ECDSA_P384_SHA384 = 10; - - // ECDSA on the NIST P-521 curve with a SHA512 digest. - ECDSA_P521_SHA512 = 11; - } - - // A PEM-encoded public key, as described in - // https://tools.ietf.org/html/rfc7468#section-13 - string public_key_pem = 1; - - // The signature algorithm used to verify a message against a signature using - // this key. - // These signature algorithm must match the structure and any object - // identifiers encoded in `public_key_pem` (i.e. this algorithm must match - // that of the public key). - SignatureAlgorithm signature_algorithm = 2; -} - -// An [attestor public -// key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be -// used to verify attestations signed by this attestor. -message AttestorPublicKey { - // Optional. A descriptive comment. This field may be updated. - string comment = 1 [(google.api.field_behavior) = OPTIONAL]; - - // The ID of this public key. - // Signatures verified by BinAuthz must include the ID of the public key that - // can be used to verify them, and that ID must match the contents of this - // field exactly. - // Additional restrictions on this field can be imposed based on which public - // key type is encapsulated. See the documentation on `public_key` cases below - // for details. - string id = 2; - - // Required. A public key reference or serialized instance. This field may be - // updated. - oneof public_key { - // ASCII-armored representation of a PGP public key, as the entire output by - // the command `gpg --export --armor foo@example.com` (either LF or CRLF - // line endings). - // When using this field, `id` should be left blank. The BinAuthz API - // handlers will calculate the ID and fill it in automatically. BinAuthz - // computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - // upper-case hex. If `id` is provided by the caller, it will be - // overwritten by the API-calculated ID. - string ascii_armored_pgp_public_key = 3; - - // A raw PKIX SubjectPublicKeyInfo format public key. - // - // NOTE: `id` may be explicitly provided by the caller when using this - // type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - // blank, a default one will be computed based on the digest of the DER - // encoding of the public key. - PkixPublicKey pkix_public_key = 5; - } -} diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/service.proto b/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/service.proto deleted file mode 100644 index 3f6c5abb..00000000 --- a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/service.proto +++ /dev/null @@ -1,257 +0,0 @@ -// 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. -// - -syntax = "proto3"; - -package google.cloud.binaryauthorization.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/binaryauthorization/v1beta1/resources.proto"; -import "google/protobuf/empty.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1;binaryauthorization"; -option java_multiple_files = true; -option java_outer_classname = "BinaryAuthorizationServiceProto"; -option java_package = "com.google.cloud.binaryauthorization.v1beta1"; -option php_namespace = "Google\\Cloud\\BinaryAuthorization\\V1beta1"; -option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1"; - -// Customer-facing API for Cloud Binary Authorization. - -// Google Cloud Management Service for Binary Authorization admission policies -// and attestation authorities. -// -// This API implements a REST model with the following objects: -// -// * [Policy][google.cloud.binaryauthorization.v1beta1.Policy] -// * [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor] -service BinauthzManagementServiceV1Beta1 { - option (google.api.default_host) = "binaryauthorization.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the - // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must - // attest to a container image, before the project is allowed to deploy that - // image. There is at most one policy per project. All image admission - // requests are permitted if a project has no policy. - // - // Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this - // project. Returns a default - // [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project - // does not have one. - rpc GetPolicy(GetPolicyRequest) returns (Policy) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/policy}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates or updates a project's - // [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a - // copy of the new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. - // A policy is always updated as a whole, to avoid race conditions with - // concurrent policy enforcement (or management!) requests. Returns NOT_FOUND - // if the project does not exist, INVALID_ARGUMENT if the request is - // malformed. - rpc UpdatePolicy(UpdatePolicyRequest) returns (Policy) { - option (google.api.http) = { - put: "/v1beta1/{policy.name=projects/*/policy}" - body: "policy" - }; - option (google.api.method_signature) = "policy"; - } - - // Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], - // and returns a copy of the new - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns - // NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is - // malformed, ALREADY_EXISTS if the - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already - // exists. - rpc CreateAttestor(CreateAttestorRequest) returns (Attestor) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/attestors" - body: "attestor" - }; - option (google.api.method_signature) = "parent,attestor_id,attestor"; - } - - // Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - // Returns NOT_FOUND if the - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not - // exist. - rpc GetAttestor(GetAttestorRequest) returns (Attestor) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/attestors/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - // Returns NOT_FOUND if the - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not - // exist. - rpc UpdateAttestor(UpdateAttestorRequest) returns (Attestor) { - option (google.api.http) = { - put: "/v1beta1/{attestor.name=projects/*/attestors/*}" - body: "attestor" - }; - option (google.api.method_signature) = "attestor"; - } - - // Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - // Returns INVALID_ARGUMENT if the project does not exist. - rpc ListAttestors(ListAttestorsRequest) returns (ListAttestorsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/attestors" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - // Returns NOT_FOUND if the - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not - // exist. - rpc DeleteAttestor(DeleteAttestorRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/attestors/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [BinauthzManagementService.GetPolicy][]. -message GetPolicyRequest { - // Required. The resource name of the - // [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in - // the format `projects/*/policy`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "binaryauthorization.googleapis.com/Policy" - } - ]; -} - -// Request message for [BinauthzManagementService.UpdatePolicy][]. -message UpdatePolicyRequest { - // Required. A new or updated - // [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The - // service will overwrite the [policy - // name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the - // resource name in the request URL, in the format `projects/*/policy`. - Policy policy = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [BinauthzManagementService.CreateAttestor][]. -message CreateAttestorRequest { - // Required. The parent of this - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The - // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - string attestor_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The initial - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The - // service will overwrite the [attestor - // name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with - // the resource name, in the format `projects/*/attestors/*`. - Attestor attestor = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [BinauthzManagementService.GetAttestor][]. -message GetAttestorRequest { - // Required. The name of the - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, - // in the format `projects/*/attestors/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "binaryauthorization.googleapis.com/Attestor" - } - ]; -} - -// Request message for [BinauthzManagementService.UpdateAttestor][]. -message UpdateAttestorRequest { - // Required. The updated - // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The - // service will overwrite the [attestor - // name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with - // the resource name in the request URL, in the format - // `projects/*/attestors/*`. - Attestor attestor = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [BinauthzManagementService.ListAttestors][]. -message ListAttestorsRequest { - // Required. The resource name of the project associated with the - // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the - // format `projects/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Requested page size. The server may return fewer results than requested. If - // unspecified, the server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. Typically, - // this is the value of - // [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] - // returned from the previous call to the `ListAttestors` method. - string page_token = 3; -} - -// Response message for [BinauthzManagementService.ListAttestors][]. -message ListAttestorsResponse { - // The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - repeated Attestor attestors = 1; - - // A token to retrieve the next page of results. Pass this value in the - // [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] - // field in the subsequent call to the `ListAttestors` method to retrieve the - // next page of results. - string next_page_token = 2; -} - -// Request message for [BinauthzManagementService.DeleteAttestor][]. -message DeleteAttestorRequest { - // Required. The name of the - // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, - // in the format `projects/*/attestors/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "binaryauthorization.googleapis.com/Attestor" - } - ]; -} diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 8a97e7d3..00000000 --- a/renovate.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "extends": [ - ":separateMajorReleases", - ":combinePatchMinorReleases", - ":ignoreUnstable", - ":prImmediately", - ":updateNotScheduled", - ":automergeDisabled", - ":ignoreModulesAndTests", - ":maintainLockFilesDisabled", - ":autodetectPinVersions" - ], - "packageRules": [ - { - "packagePatterns": [ - "^com.google.guava:" - ], - "versionScheme": "docker" - }, - { - "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-binary-authorization", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], - "semanticCommitType": "chore", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^junit:junit", - "^com.google.truth:truth", - "^org.mockito:mockito-core", - "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-conformance-tests" - ], - "semanticCommitType": "test", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" - } - ], - "semanticCommits": true, - "dependencyDashboard": true -} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml deleted file mode 100644 index 036d2285..00000000 --- a/samples/install-without-bom/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - com.google.cloud - binary-authorization-install-without-bom - jar - Google Binary Authorization Install Without Bom - https://github.com/googleapis/java-binary-authorization - - - - com.google.cloud.samples - shared-configuration - 1.0.23 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - com.google.cloud - google-cloud-binary-authorization - 0.3.1 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - 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 deleted file mode 100644 index 8ad890ae..00000000 --- a/samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-binary-authorization-samples - 0.0.1-SNAPSHOT - pom - Google Binary Authorization Samples Parent - https://github.com/googleapis/java-binary-authorization - - Java idiomatic client for Google Cloud Platform services. - - - - - com.google.cloud.samples - shared-configuration - 1.0.23 - - - - 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 deleted file mode 100644 index f0cd8fb9..00000000 --- a/samples/snapshot/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - com.google.cloud - binary-authorization-snapshot - jar - Google Binary Authorization Snapshot Samples - https://github.com/googleapis/java-binary-authorization - - - - com.google.cloud.samples - shared-configuration - 1.0.23 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-binary-authorization - 0.3.1 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - 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 deleted file mode 100644 index 83015f6e..00000000 --- a/samples/snippets/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.google.cloud - binary-authorization-snippets - jar - Google Binary Authorization Snippets - https://github.com/googleapis/java-binary-authorization - - - - com.google.cloud.samples - shared-configuration - 1.0.23 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-binary-authorization - 0.3.1 - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - diff --git a/versions.txt b/versions.txt deleted file mode 100644 index 21401060..00000000 --- a/versions.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Format: -# module:released-version:current-version - -google-cloud-binary-authorization:0.3.2:0.3.3-SNAPSHOT -grpc-google-cloud-binary-authorization-v1beta1:0.3.2:0.3.3-SNAPSHOT -proto-google-cloud-binary-authorization-v1beta1:0.3.2:0.3.3-SNAPSHOT