diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..324024d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-accessapproval/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. accessapproval version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0bd0ee06 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1 @@ +Fixes # (it's a good idea to open an issue first for context and/or discussion) \ No newline at end of file diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fadd6afc --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..c5814c00 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/java-accessapproval/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..f1ae5840 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,79 @@ +#!/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}/.. + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + bash ${KOKORO_GFILE_DIR}/codecov.sh + bash .kokoro/coerce_logs.sh + ;; +lint) + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + bash .kokoro/coerce_logs.sh + ;; +samples) + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + bash .kokoro/coerce_logs.sh + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + ;; +*) + ;; +esac diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..b22ddd60 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-accessapproval/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/build.sh" +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..21565ba4 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg new file mode 100644 index 00000000..687971d4 --- /dev/null +++ b/.kokoro/continuous/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/continuous/java7.cfg b/.kokoro/continuous/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg new file mode 100644 index 00000000..1bed9385 --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 00000000..35ea7a35 --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/continuous/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg new file mode 100644 index 00000000..8ec8bec1 --- /dev/null +++ b/.kokoro/continuous/propose_release.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.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-accessapproval/.kokoro/continuous/propose_release.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/continuous/propose_release.sh b/.kokoro/continuous/propose_release.sh new file mode 100755 index 00000000..a92c0747 --- /dev/null +++ b/.kokoro/continuous/propose_release.sh @@ -0,0 +1,29 @@ +#!/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 +# +# 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. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the release PR as new commits are merged. + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-accessapproval \ + --package-name="accessapproval" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --release-type=java-yoshi +fi diff --git a/.kokoro/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..bc8158bf --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,31 @@ +#!/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 + +cd github/java-accessapproval/ + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..a19f9dd3 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +# Display commands being run. +set -x + +cd github/java-accessapproval/ + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..21565ba4 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg new file mode 100644 index 00000000..687971d4 --- /dev/null +++ b/.kokoro/nightly/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..1bed9385 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..35ea7a35 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/nightly/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/nightly/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..9a910249 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..4cd340af --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..687971d4 --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..141f90c1 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..1bed9385 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..35ea7a35 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accessapproval/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..e35e5ad0 --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..40c33d7d --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.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-accessapproval/.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/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh new file mode 100755 index 00000000..fb309939 --- /dev/null +++ b/.kokoro/release/bump_snapshot.sh @@ -0,0 +1,30 @@ +#!/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 +# +# 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. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the snapshot release PR immediately after publishing a release + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-accessapproval \ + --package-name="accessapproval" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --snapshot \ + --release-type=java-auth-yoshi +fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..865ed314 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-accessapproval/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..a8a5a173 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..fc1b784e --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..184d1575 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/release/publish_javadoc.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..9f8f1480 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-cloud-accessapproval +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..844100f2 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..276cba76 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,44 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accessapproval/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-accessapproval/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-accessapproval" + } +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..ba17ce01 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..e2e6af14 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "accessapproval", + "name_pretty": "Access Approval", + "product_documentation": "https://cloud.google.com/access-approval/docs/", + "api_description": "enables controlling access to your organization's data by Google personnel.", + "client_documentation": "https://googleapis.dev/java/google-cloud-accessapproval/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "requires_billing": true, + "language": "java", + "repo": "googleapis/java-accessapproval", + "repo_short": "java-accessapproval", + "distribution_name": "com.google.cloud:google-cloud-accessapproval", + "api_id": "accessapproval.googleapis.com" +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..085021dd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,130 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 00000000..03fe6814 --- /dev/null +++ b/README.md @@ -0,0 +1,161 @@ +# Google Access Approval Client for Java + +Java idiomatic client for [Access Approval][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file +```xml + + + + com.google.cloud + libraries-bom + 3.5.0 + pom + import + + + + + + + com.google.cloud + google-cloud-accessapproval + + +``` + +[//]: # ({x-version-update-start:google-cloud-accessapproval:released}) + +If you are using Maven without BOM, add this to your dependencies: + +```xml + + com.google.cloud + google-cloud-accessapproval + 0.0.0 + +``` + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-accessapproval:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-accessapproval" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Access Approval [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Access Approval. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-accessapproval` library. See the [Quickstart](#quickstart) section +to add `google-cloud-accessapproval` as a dependency in your code. + +## About Access Approval + + +[Access Approval][product-docs] enables controlling access to your organization's data by Google personnel. + +See the [Access Approval client library docs][javadocs] to learn how to +use this Access Approval Client Library. + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Access Approval uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +[product-docs]: https://cloud.google.com/access-approval/docs/ +[javadocs]: https://googleapis.dev/java/google-cloud-accessapproval/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accessapproval/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-accessapproval.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-accessapproval&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-accessapproval/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-accessapproval/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-accessapproval/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=accessapproval.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM \ No newline at end of file diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-accessapproval-bom/pom.xml b/google-cloud-accessapproval-bom/pom.xml new file mode 100644 index 00000000..a4e0e966 --- /dev/null +++ b/google-cloud-accessapproval-bom/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + com.google.cloud + google-cloud-accessapproval-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + Google Cloud Access Approval BOM + https://github.com/googleapis/java-accessapproval + + BOM for Google Cloud Access Approval + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-accessapproval.git + scm:git:git@github.com:googleapis/java-accessapproval.git + https://github.com/googleapis/java-accessapproval + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.api.grpc + proto-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-accessapproval + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-accessapproval/pom.xml b/google-cloud-accessapproval/pom.xml new file mode 100644 index 00000000..8ff6811f --- /dev/null +++ b/google-cloud-accessapproval/pom.xml @@ -0,0 +1,103 @@ + + + 4.0.0 + com.google.cloud + google-cloud-accessapproval + 0.0.1-SNAPSHOT + jar + Google Cloud Access Approval + https://github.com/googleapis/java-accessapproval + Java idiomatic client for Google Cloud accessapproval + + com.google.cloud + google-cloud-accessapproval-parent + 0.0.1-SNAPSHOT + + + google-cloud-accessapproval + + + + 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-iam-v1 + + + com.google.api.grpc + proto-google-cloud-accessapproval-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + + + com.google.api.grpc + grpc-google-cloud-accessapproval-v1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalClient.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalClient.java new file mode 100644 index 00000000..f84e4f9a --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalClient.java @@ -0,0 +1,651 @@ +/* + * 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.accessapproval.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.accessapproval.v1.stub.AccessApprovalStub; +import com.google.cloud.accessapproval.v1.stub.AccessApprovalStubSettings; +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 SERVICE +/** + * Service Description: This API allows a customer to manage accesses to cloud resources by Google + * personnel. It defines the following resource model: + * + *

- The API has a collection of + * [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest] resources, named + * `approvalRequests/{approval_request_id}` - The API has top-level settings per + * Project/Folder/Organization, named `accessApprovalSettings` + * + *

The service also periodically emails a list of recipients, defined at the + * Project/Folder/Organization level in the accessApprovalSettings, when there is a pending + * ApprovalRequest for them to act on. The ApprovalRequests can also optionally be published to a + * Cloud Pub/Sub topic owned by the customer (for Beta, the Pub/Sub setup is managed manually). + * + *

ApprovalRequests can be approved or dismissed. Google personel can only access the indicated + * resource or resources if the request is approved (subject to some exclusions: + * https://cloud.google.com/access-approval/docs/overview#exclusions). + * + *

Note: Using Access Approval functionality will mean that Google may not be able to meet the + * SLAs for your chosen products, as any support response times may be dramatically increased. As + * such the SLAs do not apply to any service disruption to the extent impacted by Customer's use of + * Access Approval. Do not enable Access Approval for projects where you may require high service + * availability and rapid response by Google Cloud Support. + * + *

After a request is approved or dismissed, no further action may be taken on it. Requests with + * the requested_expiration in the past or with no activity for 14 days are considered dismissed. + * When an approval expires, the request is considered dismissed. + * + *

If a request is not approved or dismissed, we call it pending. LINT.IfChange + * + *

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

+ * 
+ * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+ *   GetApprovalRequestMessage request = GetApprovalRequestMessage.newBuilder().build();
+ *   ApprovalRequest response = accessApprovalClient.getApprovalRequest(request);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * AccessApprovalSettings accessApprovalSettings =
+ *     AccessApprovalSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AccessApprovalClient accessApprovalClient =
+ *     AccessApprovalClient.create(accessApprovalSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AccessApprovalSettings accessApprovalSettings =
+ *     AccessApprovalSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AccessApprovalClient accessApprovalClient =
+ *     AccessApprovalClient.create(accessApprovalSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AccessApprovalClient implements BackgroundResource { + private final AccessApprovalSettings settings; + private final AccessApprovalStub stub; + + /** Constructs an instance of AccessApprovalClient with default settings. */ + public static final AccessApprovalClient create() throws IOException { + return create(AccessApprovalSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AccessApprovalClient, 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 AccessApprovalClient create(AccessApprovalSettings settings) + throws IOException { + return new AccessApprovalClient(settings); + } + + /** + * Constructs an instance of AccessApprovalClient, using the given stub for making calls. This is + * for advanced usage - prefer to use AccessApprovalSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AccessApprovalClient create(AccessApprovalStub stub) { + return new AccessApprovalClient(stub); + } + + /** + * Constructs an instance of AccessApprovalClient, 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 AccessApprovalClient(AccessApprovalSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AccessApprovalStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AccessApprovalClient(AccessApprovalStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AccessApprovalSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AccessApprovalStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists approval requests associated with a project, folder, or organization. Approval requests + * can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   ListApprovalRequestsMessage request = ListApprovalRequestsMessage.newBuilder().build();
+   *   for (ApprovalRequest element : accessApprovalClient.listApprovalRequests(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 ListApprovalRequestsPagedResponse listApprovalRequests( + ListApprovalRequestsMessage request) { + return listApprovalRequestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists approval requests associated with a project, folder, or organization. Approval requests + * can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   ListApprovalRequestsMessage request = ListApprovalRequestsMessage.newBuilder().build();
+   *   ApiFuture<ListApprovalRequestsPagedResponse> future = accessApprovalClient.listApprovalRequestsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ApprovalRequest element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listApprovalRequestsPagedCallable() { + return stub.listApprovalRequestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists approval requests associated with a project, folder, or organization. Approval requests + * can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   ListApprovalRequestsMessage request = ListApprovalRequestsMessage.newBuilder().build();
+   *   while (true) {
+   *     ListApprovalRequestsResponse response = accessApprovalClient.listApprovalRequestsCallable().call(request);
+   *     for (ApprovalRequest element : response.getApprovalRequestsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listApprovalRequestsCallable() { + return stub.listApprovalRequestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an approval request. Returns NOT_FOUND if the request does not exist. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   GetApprovalRequestMessage request = GetApprovalRequestMessage.newBuilder().build();
+   *   ApprovalRequest response = accessApprovalClient.getApprovalRequest(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 ApprovalRequest getApprovalRequest(GetApprovalRequestMessage request) { + return getApprovalRequestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets an approval request. Returns NOT_FOUND if the request does not exist. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   GetApprovalRequestMessage request = GetApprovalRequestMessage.newBuilder().build();
+   *   ApiFuture<ApprovalRequest> future = accessApprovalClient.getApprovalRequestCallable().futureCall(request);
+   *   // Do something
+   *   ApprovalRequest response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getApprovalRequestCallable() { + return stub.getApprovalRequestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Approves a request and returns the updated ApprovalRequest. + * + *

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request + * exists but is not in a pending state. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   ApproveApprovalRequestMessage request = ApproveApprovalRequestMessage.newBuilder().build();
+   *   ApprovalRequest response = accessApprovalClient.approveApprovalRequest(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 ApprovalRequest approveApprovalRequest(ApproveApprovalRequestMessage request) { + return approveApprovalRequestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Approves a request and returns the updated ApprovalRequest. + * + *

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request + * exists but is not in a pending state. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   ApproveApprovalRequestMessage request = ApproveApprovalRequestMessage.newBuilder().build();
+   *   ApiFuture<ApprovalRequest> future = accessApprovalClient.approveApprovalRequestCallable().futureCall(request);
+   *   // Do something
+   *   ApprovalRequest response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + approveApprovalRequestCallable() { + return stub.approveApprovalRequestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Dismisses a request. Returns the updated ApprovalRequest. + * + *

NOTE: This does not deny access to the resource if another request has been made and + * approved. It is equivalent in effect to ignoring the request altogether. + * + *

Returns NOT_FOUND if the request does not exist. + * + *

Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   DismissApprovalRequestMessage request = DismissApprovalRequestMessage.newBuilder().build();
+   *   ApprovalRequest response = accessApprovalClient.dismissApprovalRequest(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 ApprovalRequest dismissApprovalRequest(DismissApprovalRequestMessage request) { + return dismissApprovalRequestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Dismisses a request. Returns the updated ApprovalRequest. + * + *

NOTE: This does not deny access to the resource if another request has been made and + * approved. It is equivalent in effect to ignoring the request altogether. + * + *

Returns NOT_FOUND if the request does not exist. + * + *

Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   DismissApprovalRequestMessage request = DismissApprovalRequestMessage.newBuilder().build();
+   *   ApiFuture<ApprovalRequest> future = accessApprovalClient.dismissApprovalRequestCallable().futureCall(request);
+   *   // Do something
+   *   ApprovalRequest response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + dismissApprovalRequestCallable() { + return stub.dismissApprovalRequestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings associated with a project, folder, or organization. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   GetAccessApprovalSettingsMessage request = GetAccessApprovalSettingsMessage.newBuilder().build();
+   *   AccessApprovalSettings response = accessApprovalClient.getAccessApprovalSettings(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 AccessApprovalSettings getAccessApprovalSettings( + GetAccessApprovalSettingsMessage request) { + return getAccessApprovalSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings associated with a project, folder, or organization. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   GetAccessApprovalSettingsMessage request = GetAccessApprovalSettingsMessage.newBuilder().build();
+   *   ApiFuture<AccessApprovalSettings> future = accessApprovalClient.getAccessApprovalSettingsCallable().futureCall(request);
+   *   // Do something
+   *   AccessApprovalSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getAccessApprovalSettingsCallable() { + return stub.getAccessApprovalSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the settings associated with a project, folder, or organization. Settings to update are + * determined by the value of field_mask. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   UpdateAccessApprovalSettingsMessage request = UpdateAccessApprovalSettingsMessage.newBuilder().build();
+   *   AccessApprovalSettings response = accessApprovalClient.updateAccessApprovalSettings(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 AccessApprovalSettings updateAccessApprovalSettings( + UpdateAccessApprovalSettingsMessage request) { + return updateAccessApprovalSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the settings associated with a project, folder, or organization. Settings to update are + * determined by the value of field_mask. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   UpdateAccessApprovalSettingsMessage request = UpdateAccessApprovalSettingsMessage.newBuilder().build();
+   *   ApiFuture<AccessApprovalSettings> future = accessApprovalClient.updateAccessApprovalSettingsCallable().futureCall(request);
+   *   // Do something
+   *   AccessApprovalSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateAccessApprovalSettingsCallable() { + return stub.updateAccessApprovalSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the settings associated with a project, folder, or organization. This will have the + * effect of disabling Access Approval for the project, folder, or organization, but only if all + * ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level + * of the hierarchy, then Access Approval will still be enabled at this level as the settings are + * inherited. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   DeleteAccessApprovalSettingsMessage request = DeleteAccessApprovalSettingsMessage.newBuilder().build();
+   *   accessApprovalClient.deleteAccessApprovalSettings(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 deleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage request) { + deleteAccessApprovalSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the settings associated with a project, folder, or organization. This will have the + * effect of disabling Access Approval for the project, folder, or organization, but only if all + * ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level + * of the hierarchy, then Access Approval will still be enabled at this level as the settings are + * inherited. + * + *

Sample code: + * + *


+   * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+   *   DeleteAccessApprovalSettingsMessage request = DeleteAccessApprovalSettingsMessage.newBuilder().build();
+   *   ApiFuture<Void> future = accessApprovalClient.deleteAccessApprovalSettingsCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteAccessApprovalSettingsCallable() { + return stub.deleteAccessApprovalSettingsCallable(); + } + + @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 ListApprovalRequestsPagedResponse + extends AbstractPagedListResponse< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ApprovalRequest, + ListApprovalRequestsPage, + ListApprovalRequestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListApprovalRequestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListApprovalRequestsPagedResponse apply(ListApprovalRequestsPage input) { + return new ListApprovalRequestsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListApprovalRequestsPagedResponse(ListApprovalRequestsPage page) { + super(page, ListApprovalRequestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListApprovalRequestsPage + extends AbstractPage< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ApprovalRequest, + ListApprovalRequestsPage> { + + private ListApprovalRequestsPage( + PageContext + context, + ListApprovalRequestsResponse response) { + super(context, response); + } + + private static ListApprovalRequestsPage createEmptyPage() { + return new ListApprovalRequestsPage(null, null); + } + + @Override + protected ListApprovalRequestsPage createPage( + PageContext + context, + ListApprovalRequestsResponse response) { + return new ListApprovalRequestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListApprovalRequestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ApprovalRequest, + ListApprovalRequestsPage, + ListApprovalRequestsFixedSizeCollection> { + + private ListApprovalRequestsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListApprovalRequestsFixedSizeCollection createEmptyCollection() { + return new ListApprovalRequestsFixedSizeCollection(null, 0); + } + + @Override + protected ListApprovalRequestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListApprovalRequestsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java new file mode 100644 index 00000000..cd6199f4 --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java @@ -0,0 +1,260 @@ +/* + * 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.accessapproval.v1; + +import static com.google.cloud.accessapproval.v1.AccessApprovalClient.ListApprovalRequestsPagedResponse; + +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.accessapproval.v1.stub.AccessApprovalStubSettings; +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 AccessApprovalClient}. + * + *

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

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

+ * 
+ * AccessApprovalSettings.Builder accessApprovalSettingsBuilder =
+ *     AccessApprovalSettings.newBuilder();
+ * accessApprovalSettingsBuilder.getApprovalRequestSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AccessApprovalSettings accessApprovalSettings = accessApprovalSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AccessApprovalSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listApprovalRequests. */ + public PagedCallSettings< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).listApprovalRequestsSettings(); + } + + /** Returns the object with the settings used for calls to getApprovalRequest. */ + public UnaryCallSettings + getApprovalRequestSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).getApprovalRequestSettings(); + } + + /** Returns the object with the settings used for calls to approveApprovalRequest. */ + public UnaryCallSettings + approveApprovalRequestSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).approveApprovalRequestSettings(); + } + + /** Returns the object with the settings used for calls to dismissApprovalRequest. */ + public UnaryCallSettings + dismissApprovalRequestSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).dismissApprovalRequestSettings(); + } + + /** Returns the object with the settings used for calls to getAccessApprovalSettings. */ + public UnaryCallSettings + getAccessApprovalSettingsSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).getAccessApprovalSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateAccessApprovalSettings. */ + public UnaryCallSettings + updateAccessApprovalSettingsSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).updateAccessApprovalSettingsSettings(); + } + + /** Returns the object with the settings used for calls to deleteAccessApprovalSettings. */ + public UnaryCallSettings + deleteAccessApprovalSettingsSettings() { + return ((AccessApprovalStubSettings) getStubSettings()).deleteAccessApprovalSettingsSettings(); + } + + public static final AccessApprovalSettings create(AccessApprovalStubSettings stub) + throws IOException { + return new AccessApprovalSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AccessApprovalStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AccessApprovalStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AccessApprovalStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AccessApprovalStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AccessApprovalStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AccessApprovalStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AccessApprovalStubSettings.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 AccessApprovalSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AccessApprovalSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AccessApprovalStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AccessApprovalStubSettings.newBuilder()); + } + + protected Builder(AccessApprovalSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AccessApprovalStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AccessApprovalStubSettings.Builder getStubSettingsBuilder() { + return ((AccessApprovalStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listApprovalRequests. */ + public PagedCallSettings.Builder< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings() { + return getStubSettingsBuilder().listApprovalRequestsSettings(); + } + + /** Returns the builder for the settings used for calls to getApprovalRequest. */ + public UnaryCallSettings.Builder + getApprovalRequestSettings() { + return getStubSettingsBuilder().getApprovalRequestSettings(); + } + + /** Returns the builder for the settings used for calls to approveApprovalRequest. */ + public UnaryCallSettings.Builder + approveApprovalRequestSettings() { + return getStubSettingsBuilder().approveApprovalRequestSettings(); + } + + /** Returns the builder for the settings used for calls to dismissApprovalRequest. */ + public UnaryCallSettings.Builder + dismissApprovalRequestSettings() { + return getStubSettingsBuilder().dismissApprovalRequestSettings(); + } + + /** Returns the builder for the settings used for calls to getAccessApprovalSettings. */ + public UnaryCallSettings.Builder + getAccessApprovalSettingsSettings() { + return getStubSettingsBuilder().getAccessApprovalSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateAccessApprovalSettings. */ + public UnaryCallSettings.Builder + updateAccessApprovalSettingsSettings() { + return getStubSettingsBuilder().updateAccessApprovalSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAccessApprovalSettings. */ + public UnaryCallSettings.Builder + deleteAccessApprovalSettingsSettings() { + return getStubSettingsBuilder().deleteAccessApprovalSettingsSettings(); + } + + @Override + public AccessApprovalSettings build() throws IOException { + return new AccessApprovalSettings(this); + } + } +} diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/package-info.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/package-info.java new file mode 100644 index 00000000..fa309f0c --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/package-info.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Access Approval API. + * + *

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

==================== AccessApprovalClient ==================== + * + *

Service Description: This API allows a customer to manage accesses to cloud resources by + * Google personnel. It defines the following resource model: + * + *

- The API has a collection of + * [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest] resources, named + * `approvalRequests/{approval_request_id}` - The API has top-level settings per + * Project/Folder/Organization, named `accessApprovalSettings` + * + *

The service also periodically emails a list of recipients, defined at the + * Project/Folder/Organization level in the accessApprovalSettings, when there is a pending + * ApprovalRequest for them to act on. The ApprovalRequests can also optionally be published to a + * Cloud Pub/Sub topic owned by the customer (for Beta, the Pub/Sub setup is managed manually). + * + *

ApprovalRequests can be approved or dismissed. Google personel can only access the indicated + * resource or resources if the request is approved (subject to some exclusions: + * https://cloud.google.com/access-approval/docs/overview#exclusions). + * + *

Note: Using Access Approval functionality will mean that Google may not be able to meet the + * SLAs for your chosen products, as any support response times may be dramatically increased. As + * such the SLAs do not apply to any service disruption to the extent impacted by Customer's use of + * Access Approval. Do not enable Access Approval for projects where you may require high service + * availability and rapid response by Google Cloud Support. + * + *

After a request is approved or dismissed, no further action may be taken on it. Requests with + * the requested_expiration in the past or with no activity for 14 days are considered dismissed. + * When an approval expires, the request is considered dismissed. + * + *

If a request is not approved or dismissed, we call it pending. LINT.IfChange + * + *

Sample for AccessApprovalClient: + * + *

+ * 
+ * try (AccessApprovalClient accessApprovalClient = AccessApprovalClient.create()) {
+ *   GetApprovalRequestMessage request = GetApprovalRequestMessage.newBuilder().build();
+ *   ApprovalRequest response = accessApprovalClient.getApprovalRequest(request);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.accessapproval.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStub.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStub.java new file mode 100644 index 00000000..06233b89 --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStub.java @@ -0,0 +1,89 @@ +/* + * 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.accessapproval.v1.stub; + +import static com.google.cloud.accessapproval.v1.AccessApprovalClient.ListApprovalRequestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.accessapproval.v1.AccessApprovalSettings; +import com.google.cloud.accessapproval.v1.ApprovalRequest; +import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.GetApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse; +import com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Access Approval API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AccessApprovalStub implements BackgroundResource { + + public UnaryCallable + listApprovalRequestsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listApprovalRequestsPagedCallable()"); + } + + public UnaryCallable + listApprovalRequestsCallable() { + throw new UnsupportedOperationException("Not implemented: listApprovalRequestsCallable()"); + } + + public UnaryCallable getApprovalRequestCallable() { + throw new UnsupportedOperationException("Not implemented: getApprovalRequestCallable()"); + } + + public UnaryCallable + approveApprovalRequestCallable() { + throw new UnsupportedOperationException("Not implemented: approveApprovalRequestCallable()"); + } + + public UnaryCallable + dismissApprovalRequestCallable() { + throw new UnsupportedOperationException("Not implemented: dismissApprovalRequestCallable()"); + } + + public UnaryCallable + getAccessApprovalSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getAccessApprovalSettingsCallable()"); + } + + public UnaryCallable + updateAccessApprovalSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAccessApprovalSettingsCallable()"); + } + + public UnaryCallable + deleteAccessApprovalSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAccessApprovalSettingsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStubSettings.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStubSettings.java new file mode 100644 index 00000000..fd6cccd5 --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/AccessApprovalStubSettings.java @@ -0,0 +1,537 @@ +/* + * 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.accessapproval.v1.stub; + +import static com.google.cloud.accessapproval.v1.AccessApprovalClient.ListApprovalRequestsPagedResponse; + +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.accessapproval.v1.AccessApprovalSettings; +import com.google.cloud.accessapproval.v1.ApprovalRequest; +import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.GetApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse; +import com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage; +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 AccessApprovalStub}. + * + *

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

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

+ * 
+ * AccessApprovalStubSettings.Builder accessApprovalSettingsBuilder =
+ *     AccessApprovalStubSettings.newBuilder();
+ * accessApprovalSettingsBuilder.getApprovalRequestSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AccessApprovalStubSettings accessApprovalSettings = accessApprovalSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AccessApprovalStubSettings 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 PagedCallSettings< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings; + private final UnaryCallSettings + getApprovalRequestSettings; + private final UnaryCallSettings + approveApprovalRequestSettings; + private final UnaryCallSettings + dismissApprovalRequestSettings; + private final UnaryCallSettings + getAccessApprovalSettingsSettings; + private final UnaryCallSettings + updateAccessApprovalSettingsSettings; + private final UnaryCallSettings + deleteAccessApprovalSettingsSettings; + + /** Returns the object with the settings used for calls to listApprovalRequests. */ + public PagedCallSettings< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings() { + return listApprovalRequestsSettings; + } + + /** Returns the object with the settings used for calls to getApprovalRequest. */ + public UnaryCallSettings + getApprovalRequestSettings() { + return getApprovalRequestSettings; + } + + /** Returns the object with the settings used for calls to approveApprovalRequest. */ + public UnaryCallSettings + approveApprovalRequestSettings() { + return approveApprovalRequestSettings; + } + + /** Returns the object with the settings used for calls to dismissApprovalRequest. */ + public UnaryCallSettings + dismissApprovalRequestSettings() { + return dismissApprovalRequestSettings; + } + + /** Returns the object with the settings used for calls to getAccessApprovalSettings. */ + public UnaryCallSettings + getAccessApprovalSettingsSettings() { + return getAccessApprovalSettingsSettings; + } + + /** Returns the object with the settings used for calls to updateAccessApprovalSettings. */ + public UnaryCallSettings + updateAccessApprovalSettingsSettings() { + return updateAccessApprovalSettingsSettings; + } + + /** Returns the object with the settings used for calls to deleteAccessApprovalSettings. */ + public UnaryCallSettings + deleteAccessApprovalSettingsSettings() { + return deleteAccessApprovalSettingsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AccessApprovalStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAccessApprovalStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "accessapproval.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AccessApprovalStubSettings.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 AccessApprovalStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listApprovalRequestsSettings = settingsBuilder.listApprovalRequestsSettings().build(); + getApprovalRequestSettings = settingsBuilder.getApprovalRequestSettings().build(); + approveApprovalRequestSettings = settingsBuilder.approveApprovalRequestSettings().build(); + dismissApprovalRequestSettings = settingsBuilder.dismissApprovalRequestSettings().build(); + getAccessApprovalSettingsSettings = settingsBuilder.getAccessApprovalSettingsSettings().build(); + updateAccessApprovalSettingsSettings = + settingsBuilder.updateAccessApprovalSettingsSettings().build(); + deleteAccessApprovalSettingsSettings = + settingsBuilder.deleteAccessApprovalSettingsSettings().build(); + } + + private static final PagedListDescriptor< + ListApprovalRequestsMessage, ListApprovalRequestsResponse, ApprovalRequest> + LIST_APPROVAL_REQUESTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListApprovalRequestsMessage, ListApprovalRequestsResponse, ApprovalRequest>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListApprovalRequestsMessage injectToken( + ListApprovalRequestsMessage payload, String token) { + return ListApprovalRequestsMessage.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListApprovalRequestsMessage injectPageSize( + ListApprovalRequestsMessage payload, int pageSize) { + return ListApprovalRequestsMessage.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListApprovalRequestsMessage payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListApprovalRequestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListApprovalRequestsResponse payload) { + return payload.getApprovalRequestsList() != null + ? payload.getApprovalRequestsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + LIST_APPROVAL_REQUESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListApprovalRequestsMessage request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListApprovalRequestsMessage, ListApprovalRequestsResponse, ApprovalRequest> + pageContext = + PageContext.create( + callable, LIST_APPROVAL_REQUESTS_PAGE_STR_DESC, request, context); + return ListApprovalRequestsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AccessApprovalStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings; + private final UnaryCallSettings.Builder + getApprovalRequestSettings; + private final UnaryCallSettings.Builder + approveApprovalRequestSettings; + private final UnaryCallSettings.Builder + dismissApprovalRequestSettings; + private final UnaryCallSettings.Builder< + GetAccessApprovalSettingsMessage, AccessApprovalSettings> + getAccessApprovalSettingsSettings; + private final UnaryCallSettings.Builder< + UpdateAccessApprovalSettingsMessage, AccessApprovalSettings> + updateAccessApprovalSettingsSettings; + private final UnaryCallSettings.Builder + deleteAccessApprovalSettingsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listApprovalRequestsSettings = + PagedCallSettings.newBuilder(LIST_APPROVAL_REQUESTS_PAGE_STR_FACT); + + getApprovalRequestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + approveApprovalRequestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + dismissApprovalRequestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getAccessApprovalSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateAccessApprovalSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteAccessApprovalSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listApprovalRequestsSettings, + getApprovalRequestSettings, + approveApprovalRequestSettings, + dismissApprovalRequestSettings, + getAccessApprovalSettingsSettings, + updateAccessApprovalSettingsSettings, + deleteAccessApprovalSettingsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listApprovalRequestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getApprovalRequestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .approveApprovalRequestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .dismissApprovalRequestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getAccessApprovalSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateAccessApprovalSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteAccessApprovalSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(AccessApprovalStubSettings settings) { + super(settings); + + listApprovalRequestsSettings = settings.listApprovalRequestsSettings.toBuilder(); + getApprovalRequestSettings = settings.getApprovalRequestSettings.toBuilder(); + approveApprovalRequestSettings = settings.approveApprovalRequestSettings.toBuilder(); + dismissApprovalRequestSettings = settings.dismissApprovalRequestSettings.toBuilder(); + getAccessApprovalSettingsSettings = settings.getAccessApprovalSettingsSettings.toBuilder(); + updateAccessApprovalSettingsSettings = + settings.updateAccessApprovalSettingsSettings.toBuilder(); + deleteAccessApprovalSettingsSettings = + settings.deleteAccessApprovalSettingsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listApprovalRequestsSettings, + getApprovalRequestSettings, + approveApprovalRequestSettings, + dismissApprovalRequestSettings, + getAccessApprovalSettingsSettings, + updateAccessApprovalSettingsSettings, + deleteAccessApprovalSettingsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listApprovalRequests. */ + public PagedCallSettings.Builder< + ListApprovalRequestsMessage, + ListApprovalRequestsResponse, + ListApprovalRequestsPagedResponse> + listApprovalRequestsSettings() { + return listApprovalRequestsSettings; + } + + /** Returns the builder for the settings used for calls to getApprovalRequest. */ + public UnaryCallSettings.Builder + getApprovalRequestSettings() { + return getApprovalRequestSettings; + } + + /** Returns the builder for the settings used for calls to approveApprovalRequest. */ + public UnaryCallSettings.Builder + approveApprovalRequestSettings() { + return approveApprovalRequestSettings; + } + + /** Returns the builder for the settings used for calls to dismissApprovalRequest. */ + public UnaryCallSettings.Builder + dismissApprovalRequestSettings() { + return dismissApprovalRequestSettings; + } + + /** Returns the builder for the settings used for calls to getAccessApprovalSettings. */ + public UnaryCallSettings.Builder + getAccessApprovalSettingsSettings() { + return getAccessApprovalSettingsSettings; + } + + /** Returns the builder for the settings used for calls to updateAccessApprovalSettings. */ + public UnaryCallSettings.Builder + updateAccessApprovalSettingsSettings() { + return updateAccessApprovalSettingsSettings; + } + + /** Returns the builder for the settings used for calls to deleteAccessApprovalSettings. */ + public UnaryCallSettings.Builder + deleteAccessApprovalSettingsSettings() { + return deleteAccessApprovalSettingsSettings; + } + + @Override + public AccessApprovalStubSettings build() throws IOException { + return new AccessApprovalStubSettings(this); + } + } +} diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalCallableFactory.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalCallableFactory.java new file mode 100644 index 00000000..9c832ef1 --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.accessapproval.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Access Approval API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcAccessApprovalCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalStub.java b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalStub.java new file mode 100644 index 00000000..4441d70c --- /dev/null +++ b/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/stub/GrpcAccessApprovalStub.java @@ -0,0 +1,405 @@ +/* + * 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.accessapproval.v1.stub; + +import static com.google.cloud.accessapproval.v1.AccessApprovalClient.ListApprovalRequestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.accessapproval.v1.AccessApprovalSettings; +import com.google.cloud.accessapproval.v1.ApprovalRequest; +import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage; +import com.google.cloud.accessapproval.v1.GetApprovalRequestMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage; +import com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse; +import com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Access Approval API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcAccessApprovalStub extends AccessApprovalStub { + + private static final MethodDescriptor + listApprovalRequestsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/ListApprovalRequests") + .setRequestMarshaller( + ProtoUtils.marshaller(ListApprovalRequestsMessage.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListApprovalRequestsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getApprovalRequestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.accessapproval.v1.AccessApproval/GetApprovalRequest") + .setRequestMarshaller( + ProtoUtils.marshaller(GetApprovalRequestMessage.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApprovalRequest.getDefaultInstance())) + .build(); + private static final MethodDescriptor + approveApprovalRequestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/ApproveApprovalRequest") + .setRequestMarshaller( + ProtoUtils.marshaller(ApproveApprovalRequestMessage.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApprovalRequest.getDefaultInstance())) + .build(); + private static final MethodDescriptor + dismissApprovalRequestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/DismissApprovalRequest") + .setRequestMarshaller( + ProtoUtils.marshaller(DismissApprovalRequestMessage.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApprovalRequest.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getAccessApprovalSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/GetAccessApprovalSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAccessApprovalSettingsMessage.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AccessApprovalSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateAccessApprovalSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/UpdateAccessApprovalSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAccessApprovalSettingsMessage.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AccessApprovalSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteAccessApprovalSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.accessapproval.v1.AccessApproval/DeleteAccessApprovalSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAccessApprovalSettingsMessage.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + listApprovalRequestsCallable; + private final UnaryCallable + listApprovalRequestsPagedCallable; + private final UnaryCallable + getApprovalRequestCallable; + private final UnaryCallable + approveApprovalRequestCallable; + private final UnaryCallable + dismissApprovalRequestCallable; + private final UnaryCallable + getAccessApprovalSettingsCallable; + private final UnaryCallable + updateAccessApprovalSettingsCallable; + private final UnaryCallable + deleteAccessApprovalSettingsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAccessApprovalStub create(AccessApprovalStubSettings settings) + throws IOException { + return new GrpcAccessApprovalStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAccessApprovalStub create(ClientContext clientContext) + throws IOException { + return new GrpcAccessApprovalStub( + AccessApprovalStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAccessApprovalStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAccessApprovalStub( + AccessApprovalStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAccessApprovalStub, 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 GrpcAccessApprovalStub(AccessApprovalStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAccessApprovalCallableFactory()); + } + + /** + * Constructs an instance of GrpcAccessApprovalStub, 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 GrpcAccessApprovalStub( + AccessApprovalStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + listApprovalRequestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listApprovalRequestsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListApprovalRequestsMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getApprovalRequestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getApprovalRequestMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetApprovalRequestMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + approveApprovalRequestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(approveApprovalRequestMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ApproveApprovalRequestMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + dismissApprovalRequestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(dismissApprovalRequestMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DismissApprovalRequestMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getAccessApprovalSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAccessApprovalSettingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetAccessApprovalSettingsMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateAccessApprovalSettingsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(updateAccessApprovalSettingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateAccessApprovalSettingsMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "settings.name", String.valueOf(request.getSettings().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteAccessApprovalSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAccessApprovalSettingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + DeleteAccessApprovalSettingsMessage request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listApprovalRequestsCallable = + callableFactory.createUnaryCallable( + listApprovalRequestsTransportSettings, + settings.listApprovalRequestsSettings(), + clientContext); + this.listApprovalRequestsPagedCallable = + callableFactory.createPagedCallable( + listApprovalRequestsTransportSettings, + settings.listApprovalRequestsSettings(), + clientContext); + this.getApprovalRequestCallable = + callableFactory.createUnaryCallable( + getApprovalRequestTransportSettings, + settings.getApprovalRequestSettings(), + clientContext); + this.approveApprovalRequestCallable = + callableFactory.createUnaryCallable( + approveApprovalRequestTransportSettings, + settings.approveApprovalRequestSettings(), + clientContext); + this.dismissApprovalRequestCallable = + callableFactory.createUnaryCallable( + dismissApprovalRequestTransportSettings, + settings.dismissApprovalRequestSettings(), + clientContext); + this.getAccessApprovalSettingsCallable = + callableFactory.createUnaryCallable( + getAccessApprovalSettingsTransportSettings, + settings.getAccessApprovalSettingsSettings(), + clientContext); + this.updateAccessApprovalSettingsCallable = + callableFactory.createUnaryCallable( + updateAccessApprovalSettingsTransportSettings, + settings.updateAccessApprovalSettingsSettings(), + clientContext); + this.deleteAccessApprovalSettingsCallable = + callableFactory.createUnaryCallable( + deleteAccessApprovalSettingsTransportSettings, + settings.deleteAccessApprovalSettingsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + listApprovalRequestsPagedCallable() { + return listApprovalRequestsPagedCallable; + } + + public UnaryCallable + listApprovalRequestsCallable() { + return listApprovalRequestsCallable; + } + + public UnaryCallable getApprovalRequestCallable() { + return getApprovalRequestCallable; + } + + public UnaryCallable + approveApprovalRequestCallable() { + return approveApprovalRequestCallable; + } + + public UnaryCallable + dismissApprovalRequestCallable() { + return dismissApprovalRequestCallable; + } + + public UnaryCallable + getAccessApprovalSettingsCallable() { + return getAccessApprovalSettingsCallable; + } + + public UnaryCallable + updateAccessApprovalSettingsCallable() { + return updateAccessApprovalSettingsCallable; + } + + public UnaryCallable + deleteAccessApprovalSettingsCallable() { + return deleteAccessApprovalSettingsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/AccessApprovalClientTest.java b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/AccessApprovalClientTest.java new file mode 100644 index 00000000..8d90d751 --- /dev/null +++ b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/AccessApprovalClientTest.java @@ -0,0 +1,67 @@ +/* + * 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.accessapproval.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +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 java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +@javax.annotation.Generated("by GAPIC") +public class AccessApprovalClientTest { + private static MockAccessApproval mockAccessApproval; + private static MockServiceHelper serviceHelper; + private AccessApprovalClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAccessApproval = new MockAccessApproval(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAccessApproval)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AccessApprovalSettings settings = + AccessApprovalSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AccessApprovalClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } +} diff --git a/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApproval.java b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApproval.java new file mode 100644 index 00000000..7de89dec --- /dev/null +++ b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApproval.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.accessapproval.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAccessApproval implements MockGrpcService { + private final MockAccessApprovalImpl serviceImpl; + + public MockAccessApproval() { + serviceImpl = new MockAccessApprovalImpl(); + } + + @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-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApprovalImpl.java b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApprovalImpl.java new file mode 100644 index 00000000..8d53d678 --- /dev/null +++ b/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApprovalImpl.java @@ -0,0 +1,167 @@ +/* + * 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.accessapproval.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.accessapproval.v1.AccessApprovalGrpc.AccessApprovalImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAccessApprovalImpl extends AccessApprovalImplBase { + private List requests; + private Queue responses; + + public MockAccessApprovalImpl() { + 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 listApprovalRequests( + ListApprovalRequestsMessage request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListApprovalRequestsResponse) { + requests.add(request); + responseObserver.onNext((ListApprovalRequestsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getApprovalRequest( + GetApprovalRequestMessage request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ApprovalRequest) { + requests.add(request); + responseObserver.onNext((ApprovalRequest) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void approveApprovalRequest( + ApproveApprovalRequestMessage request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ApprovalRequest) { + requests.add(request); + responseObserver.onNext((ApprovalRequest) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void dismissApprovalRequest( + DismissApprovalRequestMessage request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ApprovalRequest) { + requests.add(request); + responseObserver.onNext((ApprovalRequest) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getAccessApprovalSettings( + GetAccessApprovalSettingsMessage request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AccessApprovalSettings) { + requests.add(request); + responseObserver.onNext((AccessApprovalSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateAccessApprovalSettings( + UpdateAccessApprovalSettingsMessage request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AccessApprovalSettings) { + requests.add(request); + responseObserver.onNext((AccessApprovalSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteAccessApprovalSettings( + DeleteAccessApprovalSettingsMessage request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-accessapproval-v1/pom.xml b/grpc-google-cloud-accessapproval-v1/pom.xml new file mode 100644 index 00000000..ab17048a --- /dev/null +++ b/grpc-google-cloud-accessapproval-v1/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-accessapproval-v1 + GRPC library for grpc-google-cloud-accessapproval-v1 + + com.google.cloud + google-cloud-accessapproval-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-accessapproval-v1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalGrpc.java b/grpc-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalGrpc.java new file mode 100644 index 00000000..b2025ba1 --- /dev/null +++ b/grpc-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalGrpc.java @@ -0,0 +1,1302 @@ +/* + * 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.accessapproval.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * This API allows a customer to manage accesses to cloud resources by
+ * Google personnel. It defines the following resource model:
+ * - The API has a collection of
+ *   [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
+ *   resources, named `approvalRequests/{approval_request_id}`
+ * - The API has top-level settings per Project/Folder/Organization, named
+ *   `accessApprovalSettings`
+ * The service also periodically emails a list of recipients, defined at the
+ * Project/Folder/Organization level in the accessApprovalSettings, when there
+ * is a pending ApprovalRequest for them to act on. The ApprovalRequests can
+ * also optionally be published to a Cloud Pub/Sub topic owned by the customer
+ * (for Beta, the Pub/Sub setup is managed manually).
+ * ApprovalRequests can be approved or dismissed. Google personel can only
+ * access the indicated resource or resources if the request is approved
+ * (subject to some exclusions:
+ * https://cloud.google.com/access-approval/docs/overview#exclusions).
+ * Note: Using Access Approval functionality will mean that Google may not be
+ * able to meet the SLAs for your chosen products, as any support response times
+ * may be dramatically increased. As such the SLAs do not apply to any service
+ * disruption to the extent impacted by Customer's use of Access Approval. Do
+ * not enable Access Approval for projects where you may require high service
+ * availability and rapid response by Google Cloud Support.
+ * After a request is approved or dismissed, no further action may be taken on
+ * it. Requests with the requested_expiration in the past or with no activity
+ * for 14 days are considered dismissed. When an approval expires, the request
+ * is considered dismissed.
+ * If a request is not approved or dismissed, we call it pending.
+ * LINT.IfChange
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/accessapproval/v1/accessapproval.proto") +public final class AccessApprovalGrpc { + + private AccessApprovalGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.accessapproval.v1.AccessApproval"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse> + getListApprovalRequestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListApprovalRequests", + requestType = com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.class, + responseType = com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse> + getListApprovalRequestsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse> + getListApprovalRequestsMethod; + if ((getListApprovalRequestsMethod = AccessApprovalGrpc.getListApprovalRequestsMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getListApprovalRequestsMethod = AccessApprovalGrpc.getListApprovalRequestsMethod) + == null) { + AccessApprovalGrpc.getListApprovalRequestsMethod = + getListApprovalRequestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListApprovalRequests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier("ListApprovalRequests")) + .build(); + } + } + } + return getListApprovalRequestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getGetApprovalRequestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetApprovalRequest", + requestType = com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.class, + responseType = com.google.cloud.accessapproval.v1.ApprovalRequest.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getGetApprovalRequestMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getGetApprovalRequestMethod; + if ((getGetApprovalRequestMethod = AccessApprovalGrpc.getGetApprovalRequestMethod) == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getGetApprovalRequestMethod = AccessApprovalGrpc.getGetApprovalRequestMethod) + == null) { + AccessApprovalGrpc.getGetApprovalRequestMethod = + getGetApprovalRequestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetApprovalRequest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ApprovalRequest + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier("GetApprovalRequest")) + .build(); + } + } + } + return getGetApprovalRequestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getApproveApprovalRequestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ApproveApprovalRequest", + requestType = com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.class, + responseType = com.google.cloud.accessapproval.v1.ApprovalRequest.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getApproveApprovalRequestMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getApproveApprovalRequestMethod; + if ((getApproveApprovalRequestMethod = AccessApprovalGrpc.getApproveApprovalRequestMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getApproveApprovalRequestMethod = AccessApprovalGrpc.getApproveApprovalRequestMethod) + == null) { + AccessApprovalGrpc.getApproveApprovalRequestMethod = + getApproveApprovalRequestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ApproveApprovalRequest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ApprovalRequest + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier("ApproveApprovalRequest")) + .build(); + } + } + } + return getApproveApprovalRequestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getDismissApprovalRequestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DismissApprovalRequest", + requestType = com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.class, + responseType = com.google.cloud.accessapproval.v1.ApprovalRequest.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getDismissApprovalRequestMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest> + getDismissApprovalRequestMethod; + if ((getDismissApprovalRequestMethod = AccessApprovalGrpc.getDismissApprovalRequestMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getDismissApprovalRequestMethod = AccessApprovalGrpc.getDismissApprovalRequestMethod) + == null) { + AccessApprovalGrpc.getDismissApprovalRequestMethod = + getDismissApprovalRequestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DismissApprovalRequest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.ApprovalRequest + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier("DismissApprovalRequest")) + .build(); + } + } + } + return getDismissApprovalRequestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getGetAccessApprovalSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAccessApprovalSettings", + requestType = com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.class, + responseType = com.google.cloud.accessapproval.v1.AccessApprovalSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getGetAccessApprovalSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getGetAccessApprovalSettingsMethod; + if ((getGetAccessApprovalSettingsMethod = AccessApprovalGrpc.getGetAccessApprovalSettingsMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getGetAccessApprovalSettingsMethod = + AccessApprovalGrpc.getGetAccessApprovalSettingsMethod) + == null) { + AccessApprovalGrpc.getGetAccessApprovalSettingsMethod = + getGetAccessApprovalSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetAccessApprovalSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.AccessApprovalSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier("GetAccessApprovalSettings")) + .build(); + } + } + } + return getGetAccessApprovalSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getUpdateAccessApprovalSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAccessApprovalSettings", + requestType = com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.class, + responseType = com.google.cloud.accessapproval.v1.AccessApprovalSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getUpdateAccessApprovalSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getUpdateAccessApprovalSettingsMethod; + if ((getUpdateAccessApprovalSettingsMethod = + AccessApprovalGrpc.getUpdateAccessApprovalSettingsMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getUpdateAccessApprovalSettingsMethod = + AccessApprovalGrpc.getUpdateAccessApprovalSettingsMethod) + == null) { + AccessApprovalGrpc.getUpdateAccessApprovalSettingsMethod = + getUpdateAccessApprovalSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAccessApprovalSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.AccessApprovalSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier( + "UpdateAccessApprovalSettings")) + .build(); + } + } + } + return getUpdateAccessApprovalSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage, + com.google.protobuf.Empty> + getDeleteAccessApprovalSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAccessApprovalSettings", + requestType = com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage, + com.google.protobuf.Empty> + getDeleteAccessApprovalSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage, + com.google.protobuf.Empty> + getDeleteAccessApprovalSettingsMethod; + if ((getDeleteAccessApprovalSettingsMethod = + AccessApprovalGrpc.getDeleteAccessApprovalSettingsMethod) + == null) { + synchronized (AccessApprovalGrpc.class) { + if ((getDeleteAccessApprovalSettingsMethod = + AccessApprovalGrpc.getDeleteAccessApprovalSettingsMethod) + == null) { + AccessApprovalGrpc.getDeleteAccessApprovalSettingsMethod = + getDeleteAccessApprovalSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteAccessApprovalSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AccessApprovalMethodDescriptorSupplier( + "DeleteAccessApprovalSettings")) + .build(); + } + } + } + return getDeleteAccessApprovalSettingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AccessApprovalStub newStub(io.grpc.Channel channel) { + return new AccessApprovalStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AccessApprovalBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new AccessApprovalBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AccessApprovalFutureStub newFutureStub(io.grpc.Channel channel) { + return new AccessApprovalFutureStub(channel); + } + + /** + * + * + *
+   * This API allows a customer to manage accesses to cloud resources by
+   * Google personnel. It defines the following resource model:
+   * - The API has a collection of
+   *   [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
+   *   resources, named `approvalRequests/{approval_request_id}`
+   * - The API has top-level settings per Project/Folder/Organization, named
+   *   `accessApprovalSettings`
+   * The service also periodically emails a list of recipients, defined at the
+   * Project/Folder/Organization level in the accessApprovalSettings, when there
+   * is a pending ApprovalRequest for them to act on. The ApprovalRequests can
+   * also optionally be published to a Cloud Pub/Sub topic owned by the customer
+   * (for Beta, the Pub/Sub setup is managed manually).
+   * ApprovalRequests can be approved or dismissed. Google personel can only
+   * access the indicated resource or resources if the request is approved
+   * (subject to some exclusions:
+   * https://cloud.google.com/access-approval/docs/overview#exclusions).
+   * Note: Using Access Approval functionality will mean that Google may not be
+   * able to meet the SLAs for your chosen products, as any support response times
+   * may be dramatically increased. As such the SLAs do not apply to any service
+   * disruption to the extent impacted by Customer's use of Access Approval. Do
+   * not enable Access Approval for projects where you may require high service
+   * availability and rapid response by Google Cloud Support.
+   * After a request is approved or dismissed, no further action may be taken on
+   * it. Requests with the requested_expiration in the past or with no activity
+   * for 14 days are considered dismissed. When an approval expires, the request
+   * is considered dismissed.
+   * If a request is not approved or dismissed, we call it pending.
+   * LINT.IfChange
+   * 
+ */ + public abstract static class AccessApprovalImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists approval requests associated with a project, folder, or organization.
+     * Approval requests can be filtered by state (pending, active, dismissed).
+     * The order is reverse chronological.
+     * 
+ */ + public void listApprovalRequests( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListApprovalRequestsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets an approval request. Returns NOT_FOUND if the request does not exist.
+     * 
+ */ + public void getApprovalRequest( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetApprovalRequestMethod(), responseObserver); + } + + /** + * + * + *
+     * Approves a request and returns the updated ApprovalRequest.
+     * Returns NOT_FOUND if the request does not exist. Returns
+     * FAILED_PRECONDITION if the request exists but is not in a pending state.
+     * 
+ */ + public void approveApprovalRequest( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getApproveApprovalRequestMethod(), responseObserver); + } + + /** + * + * + *
+     * Dismisses a request. Returns the updated ApprovalRequest.
+     * NOTE: This does not deny access to the resource if another request has been
+     * made and approved. It is equivalent in effect to ignoring the request
+     * altogether.
+     * Returns NOT_FOUND if the request does not exist.
+     * Returns FAILED_PRECONDITION if the request exists but is not in a pending
+     * state.
+     * 
+ */ + public void dismissApprovalRequest( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getDismissApprovalRequestMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the settings associated with a project, folder, or organization.
+     * 
+ */ + public void getAccessApprovalSettings( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetAccessApprovalSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the settings associated with a project, folder, or organization.
+     * Settings to update are determined by the value of field_mask.
+     * 
+ */ + public void updateAccessApprovalSettings( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateAccessApprovalSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the settings associated with a project, folder, or organization.
+     * This will have the effect of disabling Access Approval for the project,
+     * folder, or organization, but only if all ancestors also have Access
+     * Approval disabled. If Access Approval is enabled at a higher level of the
+     * hierarchy, then Access Approval will still be enabled at this level as
+     * the settings are inherited.
+     * 
+ */ + public void deleteAccessApprovalSettings( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteAccessApprovalSettingsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListApprovalRequestsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse>( + this, METHODID_LIST_APPROVAL_REQUESTS))) + .addMethod( + getGetApprovalRequestMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest>( + this, METHODID_GET_APPROVAL_REQUEST))) + .addMethod( + getApproveApprovalRequestMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest>( + this, METHODID_APPROVE_APPROVAL_REQUEST))) + .addMethod( + getDismissApprovalRequestMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage, + com.google.cloud.accessapproval.v1.ApprovalRequest>( + this, METHODID_DISMISS_APPROVAL_REQUEST))) + .addMethod( + getGetAccessApprovalSettingsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings>( + this, METHODID_GET_ACCESS_APPROVAL_SETTINGS))) + .addMethod( + getUpdateAccessApprovalSettingsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage, + com.google.cloud.accessapproval.v1.AccessApprovalSettings>( + this, METHODID_UPDATE_ACCESS_APPROVAL_SETTINGS))) + .addMethod( + getDeleteAccessApprovalSettingsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage, + com.google.protobuf.Empty>(this, METHODID_DELETE_ACCESS_APPROVAL_SETTINGS))) + .build(); + } + } + + /** + * + * + *
+   * This API allows a customer to manage accesses to cloud resources by
+   * Google personnel. It defines the following resource model:
+   * - The API has a collection of
+   *   [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
+   *   resources, named `approvalRequests/{approval_request_id}`
+   * - The API has top-level settings per Project/Folder/Organization, named
+   *   `accessApprovalSettings`
+   * The service also periodically emails a list of recipients, defined at the
+   * Project/Folder/Organization level in the accessApprovalSettings, when there
+   * is a pending ApprovalRequest for them to act on. The ApprovalRequests can
+   * also optionally be published to a Cloud Pub/Sub topic owned by the customer
+   * (for Beta, the Pub/Sub setup is managed manually).
+   * ApprovalRequests can be approved or dismissed. Google personel can only
+   * access the indicated resource or resources if the request is approved
+   * (subject to some exclusions:
+   * https://cloud.google.com/access-approval/docs/overview#exclusions).
+   * Note: Using Access Approval functionality will mean that Google may not be
+   * able to meet the SLAs for your chosen products, as any support response times
+   * may be dramatically increased. As such the SLAs do not apply to any service
+   * disruption to the extent impacted by Customer's use of Access Approval. Do
+   * not enable Access Approval for projects where you may require high service
+   * availability and rapid response by Google Cloud Support.
+   * After a request is approved or dismissed, no further action may be taken on
+   * it. Requests with the requested_expiration in the past or with no activity
+   * for 14 days are considered dismissed. When an approval expires, the request
+   * is considered dismissed.
+   * If a request is not approved or dismissed, we call it pending.
+   * LINT.IfChange
+   * 
+ */ + public static final class AccessApprovalStub + extends io.grpc.stub.AbstractStub { + private AccessApprovalStub(io.grpc.Channel channel) { + super(channel); + } + + private AccessApprovalStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccessApprovalStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccessApprovalStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists approval requests associated with a project, folder, or organization.
+     * Approval requests can be filtered by state (pending, active, dismissed).
+     * The order is reverse chronological.
+     * 
+ */ + public void listApprovalRequests( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListApprovalRequestsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets an approval request. Returns NOT_FOUND if the request does not exist.
+     * 
+ */ + public void getApprovalRequest( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetApprovalRequestMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Approves a request and returns the updated ApprovalRequest.
+     * Returns NOT_FOUND if the request does not exist. Returns
+     * FAILED_PRECONDITION if the request exists but is not in a pending state.
+     * 
+ */ + public void approveApprovalRequest( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getApproveApprovalRequestMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Dismisses a request. Returns the updated ApprovalRequest.
+     * NOTE: This does not deny access to the resource if another request has been
+     * made and approved. It is equivalent in effect to ignoring the request
+     * altogether.
+     * Returns NOT_FOUND if the request does not exist.
+     * Returns FAILED_PRECONDITION if the request exists but is not in a pending
+     * state.
+     * 
+ */ + public void dismissApprovalRequest( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDismissApprovalRequestMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the settings associated with a project, folder, or organization.
+     * 
+ */ + public void getAccessApprovalSettings( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetAccessApprovalSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the settings associated with a project, folder, or organization.
+     * Settings to update are determined by the value of field_mask.
+     * 
+ */ + public void updateAccessApprovalSettings( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateAccessApprovalSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the settings associated with a project, folder, or organization.
+     * This will have the effect of disabling Access Approval for the project,
+     * folder, or organization, but only if all ancestors also have Access
+     * Approval disabled. If Access Approval is enabled at a higher level of the
+     * hierarchy, then Access Approval will still be enabled at this level as
+     * the settings are inherited.
+     * 
+ */ + public void deleteAccessApprovalSettings( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteAccessApprovalSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * This API allows a customer to manage accesses to cloud resources by
+   * Google personnel. It defines the following resource model:
+   * - The API has a collection of
+   *   [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
+   *   resources, named `approvalRequests/{approval_request_id}`
+   * - The API has top-level settings per Project/Folder/Organization, named
+   *   `accessApprovalSettings`
+   * The service also periodically emails a list of recipients, defined at the
+   * Project/Folder/Organization level in the accessApprovalSettings, when there
+   * is a pending ApprovalRequest for them to act on. The ApprovalRequests can
+   * also optionally be published to a Cloud Pub/Sub topic owned by the customer
+   * (for Beta, the Pub/Sub setup is managed manually).
+   * ApprovalRequests can be approved or dismissed. Google personel can only
+   * access the indicated resource or resources if the request is approved
+   * (subject to some exclusions:
+   * https://cloud.google.com/access-approval/docs/overview#exclusions).
+   * Note: Using Access Approval functionality will mean that Google may not be
+   * able to meet the SLAs for your chosen products, as any support response times
+   * may be dramatically increased. As such the SLAs do not apply to any service
+   * disruption to the extent impacted by Customer's use of Access Approval. Do
+   * not enable Access Approval for projects where you may require high service
+   * availability and rapid response by Google Cloud Support.
+   * After a request is approved or dismissed, no further action may be taken on
+   * it. Requests with the requested_expiration in the past or with no activity
+   * for 14 days are considered dismissed. When an approval expires, the request
+   * is considered dismissed.
+   * If a request is not approved or dismissed, we call it pending.
+   * LINT.IfChange
+   * 
+ */ + public static final class AccessApprovalBlockingStub + extends io.grpc.stub.AbstractStub { + private AccessApprovalBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private AccessApprovalBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccessApprovalBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccessApprovalBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists approval requests associated with a project, folder, or organization.
+     * Approval requests can be filtered by state (pending, active, dismissed).
+     * The order is reverse chronological.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse listApprovalRequests( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage request) { + return blockingUnaryCall( + getChannel(), getListApprovalRequestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets an approval request. Returns NOT_FOUND if the request does not exist.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.ApprovalRequest getApprovalRequest( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage request) { + return blockingUnaryCall( + getChannel(), getGetApprovalRequestMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Approves a request and returns the updated ApprovalRequest.
+     * Returns NOT_FOUND if the request does not exist. Returns
+     * FAILED_PRECONDITION if the request exists but is not in a pending state.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.ApprovalRequest approveApprovalRequest( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage request) { + return blockingUnaryCall( + getChannel(), getApproveApprovalRequestMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Dismisses a request. Returns the updated ApprovalRequest.
+     * NOTE: This does not deny access to the resource if another request has been
+     * made and approved. It is equivalent in effect to ignoring the request
+     * altogether.
+     * Returns NOT_FOUND if the request does not exist.
+     * Returns FAILED_PRECONDITION if the request exists but is not in a pending
+     * state.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.ApprovalRequest dismissApprovalRequest( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage request) { + return blockingUnaryCall( + getChannel(), getDismissApprovalRequestMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the settings associated with a project, folder, or organization.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettings getAccessApprovalSettings( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage request) { + return blockingUnaryCall( + getChannel(), getGetAccessApprovalSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings associated with a project, folder, or organization.
+     * Settings to update are determined by the value of field_mask.
+     * 
+ */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettings updateAccessApprovalSettings( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage request) { + return blockingUnaryCall( + getChannel(), getUpdateAccessApprovalSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the settings associated with a project, folder, or organization.
+     * This will have the effect of disabling Access Approval for the project,
+     * folder, or organization, but only if all ancestors also have Access
+     * Approval disabled. If Access Approval is enabled at a higher level of the
+     * hierarchy, then Access Approval will still be enabled at this level as
+     * the settings are inherited.
+     * 
+ */ + public com.google.protobuf.Empty deleteAccessApprovalSettings( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage request) { + return blockingUnaryCall( + getChannel(), getDeleteAccessApprovalSettingsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * This API allows a customer to manage accesses to cloud resources by
+   * Google personnel. It defines the following resource model:
+   * - The API has a collection of
+   *   [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
+   *   resources, named `approvalRequests/{approval_request_id}`
+   * - The API has top-level settings per Project/Folder/Organization, named
+   *   `accessApprovalSettings`
+   * The service also periodically emails a list of recipients, defined at the
+   * Project/Folder/Organization level in the accessApprovalSettings, when there
+   * is a pending ApprovalRequest for them to act on. The ApprovalRequests can
+   * also optionally be published to a Cloud Pub/Sub topic owned by the customer
+   * (for Beta, the Pub/Sub setup is managed manually).
+   * ApprovalRequests can be approved or dismissed. Google personel can only
+   * access the indicated resource or resources if the request is approved
+   * (subject to some exclusions:
+   * https://cloud.google.com/access-approval/docs/overview#exclusions).
+   * Note: Using Access Approval functionality will mean that Google may not be
+   * able to meet the SLAs for your chosen products, as any support response times
+   * may be dramatically increased. As such the SLAs do not apply to any service
+   * disruption to the extent impacted by Customer's use of Access Approval. Do
+   * not enable Access Approval for projects where you may require high service
+   * availability and rapid response by Google Cloud Support.
+   * After a request is approved or dismissed, no further action may be taken on
+   * it. Requests with the requested_expiration in the past or with no activity
+   * for 14 days are considered dismissed. When an approval expires, the request
+   * is considered dismissed.
+   * If a request is not approved or dismissed, we call it pending.
+   * LINT.IfChange
+   * 
+ */ + public static final class AccessApprovalFutureStub + extends io.grpc.stub.AbstractStub { + private AccessApprovalFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private AccessApprovalFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccessApprovalFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccessApprovalFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists approval requests associated with a project, folder, or organization.
+     * Approval requests can be filtered by state (pending, active, dismissed).
+     * The order is reverse chronological.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse> + listApprovalRequests( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage request) { + return futureUnaryCall( + getChannel().newCall(getListApprovalRequestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets an approval request. Returns NOT_FOUND if the request does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.ApprovalRequest> + getApprovalRequest(com.google.cloud.accessapproval.v1.GetApprovalRequestMessage request) { + return futureUnaryCall( + getChannel().newCall(getGetApprovalRequestMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Approves a request and returns the updated ApprovalRequest.
+     * Returns NOT_FOUND if the request does not exist. Returns
+     * FAILED_PRECONDITION if the request exists but is not in a pending state.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.ApprovalRequest> + approveApprovalRequest( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage request) { + return futureUnaryCall( + getChannel().newCall(getApproveApprovalRequestMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Dismisses a request. Returns the updated ApprovalRequest.
+     * NOTE: This does not deny access to the resource if another request has been
+     * made and approved. It is equivalent in effect to ignoring the request
+     * altogether.
+     * Returns NOT_FOUND if the request does not exist.
+     * Returns FAILED_PRECONDITION if the request exists but is not in a pending
+     * state.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.ApprovalRequest> + dismissApprovalRequest( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage request) { + return futureUnaryCall( + getChannel().newCall(getDismissApprovalRequestMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the settings associated with a project, folder, or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + getAccessApprovalSettings( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage request) { + return futureUnaryCall( + getChannel().newCall(getGetAccessApprovalSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings associated with a project, folder, or organization.
+     * Settings to update are determined by the value of field_mask.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.accessapproval.v1.AccessApprovalSettings> + updateAccessApprovalSettings( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage request) { + return futureUnaryCall( + getChannel().newCall(getUpdateAccessApprovalSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the settings associated with a project, folder, or organization.
+     * This will have the effect of disabling Access Approval for the project,
+     * folder, or organization, but only if all ancestors also have Access
+     * Approval disabled. If Access Approval is enabled at a higher level of the
+     * hierarchy, then Access Approval will still be enabled at this level as
+     * the settings are inherited.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAccessApprovalSettings( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage request) { + return futureUnaryCall( + getChannel().newCall(getDeleteAccessApprovalSettingsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_APPROVAL_REQUESTS = 0; + private static final int METHODID_GET_APPROVAL_REQUEST = 1; + private static final int METHODID_APPROVE_APPROVAL_REQUEST = 2; + private static final int METHODID_DISMISS_APPROVAL_REQUEST = 3; + private static final int METHODID_GET_ACCESS_APPROVAL_SETTINGS = 4; + private static final int METHODID_UPDATE_ACCESS_APPROVAL_SETTINGS = 5; + private static final int METHODID_DELETE_ACCESS_APPROVAL_SETTINGS = 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 AccessApprovalImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AccessApprovalImplBase 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_LIST_APPROVAL_REQUESTS: + serviceImpl.listApprovalRequests( + (com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse>) + responseObserver); + break; + case METHODID_GET_APPROVAL_REQUEST: + serviceImpl.getApprovalRequest( + (com.google.cloud.accessapproval.v1.GetApprovalRequestMessage) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_APPROVE_APPROVAL_REQUEST: + serviceImpl.approveApprovalRequest( + (com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DISMISS_APPROVAL_REQUEST: + serviceImpl.dismissApprovalRequest( + (com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ACCESS_APPROVAL_SETTINGS: + serviceImpl.getAccessApprovalSettings( + (com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.accessapproval.v1.AccessApprovalSettings>) + responseObserver); + break; + case METHODID_UPDATE_ACCESS_APPROVAL_SETTINGS: + serviceImpl.updateAccessApprovalSettings( + (com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.accessapproval.v1.AccessApprovalSettings>) + responseObserver); + break; + case METHODID_DELETE_ACCESS_APPROVAL_SETTINGS: + serviceImpl.deleteAccessApprovalSettings( + (com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) 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 AccessApprovalBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AccessApprovalBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AccessApproval"); + } + } + + private static final class AccessApprovalFileDescriptorSupplier + extends AccessApprovalBaseDescriptorSupplier { + AccessApprovalFileDescriptorSupplier() {} + } + + private static final class AccessApprovalMethodDescriptorSupplier + extends AccessApprovalBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AccessApprovalMethodDescriptorSupplier(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 (AccessApprovalGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AccessApprovalFileDescriptorSupplier()) + .addMethod(getListApprovalRequestsMethod()) + .addMethod(getGetApprovalRequestMethod()) + .addMethod(getApproveApprovalRequestMethod()) + .addMethod(getDismissApprovalRequestMethod()) + .addMethod(getGetAccessApprovalSettingsMethod()) + .addMethod(getUpdateAccessApprovalSettingsMethod()) + .addMethod(getDeleteAccessApprovalSettingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..d4775ce4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,266 @@ + + + 4.0.0 + com.google.cloud + google-cloud-accessapproval-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Access Approval Parent + https://github.com/googleapis/java-accessapproval + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-accessapproval.git + scm:git:git@github.com:googleapis/java-accessapproval.git + https://github.com/googleapis/java-accessapproval + HEAD + + + https://github.com/googleapis/java-accessapproval/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-accessapproval-parent + 1.92.3 + 1.8.1 + 1.17.0 + 1.53.1 + 1.27.0 + 3.11.1 + 4.13 + 28.2-android + 1.4.1 + 1.3.2 + 1.18 + + + + + + com.google.api.grpc + proto-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-accessapproval + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + com.google.api + gax-bom + ${gax.version} + pom + import + + + com.google.guava + guava-bom + ${guava.version} + pom + import + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.api + api-common + ${google.api-common.version} + + + com.google.api.grpc + proto-google-common-protos + ${google.common-protos.version} + + + com.google.cloud + google-cloud-core + ${google.core.version} + + + org.threeten + threetenbp + ${threeten.version} + + + javax.annotation + javax.annotation-api + ${javax.annotations.version} + + + org.codehaus.mojo + animal-sniffer-annotations + ${animal-sniffer.version} + + + com.google.api.grpc + proto-google-iam-v1 + 0.13.0 + + + + junit + junit + ${junit.version} + test + + + com.google.api + gax-grpc + ${gax.version} + testlib + test + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + proto-google-cloud-accessapproval-v1 + grpc-google-cloud-accessapproval-v1 + google-cloud-accessapproval + google-cloud-accessapproval-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-accessapproval-v1/pom.xml b/proto-google-cloud-accessapproval-v1/pom.xml new file mode 100644 index 00000000..0b5defb7 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-accessapproval-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-accessapproval-v1beta1 + PROTO library for proto-google-cloud-accessapproval-v1 + + com.google.cloud + google-cloud-accessapproval-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.guava + guava + + + com.google.api + api-common + + + com.google.api.grpc + proto-google-iam-v1 + + + \ No newline at end of file diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalProto.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalProto.java new file mode 100644 index 00000000..7b5bb724 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalProto.java @@ -0,0 +1,391 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public final class AccessApprovalProto { + private AccessApprovalProto() {} + + 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_accessapproval_v1_AccessLocations_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_AccessLocations_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_AccessReason_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ApproveDecision_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_DismissDecision_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ResourceProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ApprovalRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_EnrolledService_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/accessapproval/v1/accessa" + + "pproval.proto\022\036google.cloud.accessapprov" + + "al.v1\032\034google/api/annotations.proto\032\037goo" + + "gle/api/field_behavior.proto\032\033google/pro" + + "tobuf/empty.proto\032 google/protobuf/field" + + "_mask.proto\032\037google/protobuf/timestamp.p" + + "roto\032\027google/api/client.proto\"`\n\017AccessL" + + "ocations\022 \n\030principal_office_country\030\001 \001" + + "(\t\022+\n#principal_physical_location_countr" + + "y\030\002 \001(\t\"\330\001\n\014AccessReason\022?\n\004type\030\001 \001(\01621" + + ".google.cloud.accessapproval.v1.AccessRe" + + "ason.Type\022\016\n\006detail\030\002 \001(\t\"w\n\004Type\022\024\n\020TYP" + + "E_UNSPECIFIED\020\000\022\036\n\032CUSTOMER_INITIATED_SU" + + "PPORT\020\001\022\034\n\030GOOGLE_INITIATED_SERVICE\020\002\022\033\n" + + "\027GOOGLE_INITIATED_REVIEW\020\003\"t\n\017ApproveDec" + + "ision\0220\n\014approve_time\030\001 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022/\n\013expire_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\"C\n\017DismissDecis" + + "ion\0220\n\014dismiss_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\"2\n\022ResourceProperties\022\034\n\024e" + + "xcludes_descendants\030\001 \001(\010\"\261\004\n\017ApprovalRe" + + "quest\022\014\n\004name\030\001 \001(\t\022\037\n\027requested_resourc" + + "e_name\030\002 \001(\t\022Y\n\035requested_resource_prope" + + "rties\030\t \001(\01322.google.cloud.accessapprova" + + "l.v1.ResourceProperties\022F\n\020requested_rea" + + "son\030\003 \001(\0132,.google.cloud.accessapproval." + + "v1.AccessReason\022L\n\023requested_locations\030\004" + + " \001(\0132/.google.cloud.accessapproval.v1.Ac" + + "cessLocations\0220\n\014request_time\030\005 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\0228\n\024requested_exp" + + "iration\030\006 \001(\0132\032.google.protobuf.Timestam" + + "p\022B\n\007approve\030\007 \001(\0132/.google.cloud.access" + + "approval.v1.ApproveDecisionH\000\022B\n\007dismiss" + + "\030\010 \001(\0132/.google.cloud.accessapproval.v1." + + "DismissDecisionH\000B\n\n\010decision\"s\n\017Enrolle" + + "dService\022\025\n\rcloud_product\030\001 \001(\t\022I\n\020enrol" + + "lment_level\030\002 \001(\0162/.google.cloud.accessa" + + "pproval.v1.EnrollmentLevel\"\257\001\n\026AccessApp" + + "rovalSettings\022\014\n\004name\030\001 \001(\t\022\033\n\023notificat" + + "ion_emails\030\002 \003(\t\022J\n\021enrolled_services\030\003 " + + "\003(\0132/.google.cloud.accessapproval.v1.Enr" + + "olledService\022\036\n\021enrolled_ancestor\030\004 \001(\010B" + + "\003\340A\003\"d\n\033ListApprovalRequestsMessage\022\016\n\006p" + + "arent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size" + + "\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"\203\001\n\034ListAppro" + + "valRequestsResponse\022J\n\021approval_requests" + + "\030\001 \003(\0132/.google.cloud.accessapproval.v1." + + "ApprovalRequest\022\027\n\017next_page_token\030\002 \001(\t" + + "\")\n\031GetApprovalRequestMessage\022\014\n\004name\030\001 " + + "\001(\t\"^\n\035ApproveApprovalRequestMessage\022\014\n\004" + + "name\030\001 \001(\t\022/\n\013expire_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\"-\n\035DismissApprovalRe" + + "questMessage\022\014\n\004name\030\001 \001(\t\"0\n GetAccessA" + + "pprovalSettingsMessage\022\014\n\004name\030\001 \001(\t\"\240\001\n" + + "#UpdateAccessApprovalSettingsMessage\022H\n\010" + + "settings\030\001 \001(\01326.google.cloud.accessappr" + + "oval.v1.AccessApprovalSettings\022/\n\013update" + + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"" + + "3\n#DeleteAccessApprovalSettingsMessage\022\014" + + "\n\004name\030\001 \001(\t*B\n\017EnrollmentLevel\022 \n\034ENROL" + + "LMENT_LEVEL_UNSPECIFIED\020\000\022\r\n\tBLOCK_ALL\020\001" + + "2\323\021\n\016AccessApproval\022\241\002\n\024ListApprovalRequ" + + "ests\022;.google.cloud.accessapproval.v1.Li" + + "stApprovalRequestsMessage\032<.google.cloud" + + ".accessapproval.v1.ListApprovalRequestsR" + + "esponse\"\215\001\202\323\344\223\002\206\001\022(/v1/{parent=projects/" + + "*}/approvalRequestsZ)\022\'/v1/{parent=folde" + + "rs/*}/approvalRequestsZ/\022-/v1/{parent=or" + + "ganizations/*}/approvalRequests\022\220\002\n\022GetA" + + "pprovalRequest\0229.google.cloud.accessappr" + + "oval.v1.GetApprovalRequestMessage\032/.goog" + + "le.cloud.accessapproval.v1.ApprovalReque" + + "st\"\215\001\202\323\344\223\002\206\001\022(/v1/{name=projects/*/appro" + + "valRequests/*}Z)\022\'/v1/{name=folders/*/ap" + + "provalRequests/*}Z/\022-/v1/{name=organizat" + + "ions/*/approvalRequests/*}\022\271\002\n\026ApproveAp" + + "provalRequest\022=.google.cloud.accessappro" + + "val.v1.ApproveApprovalRequestMessage\032/.g" + + "oogle.cloud.accessapproval.v1.ApprovalRe" + + "quest\"\256\001\202\323\344\223\002\247\001\"0/v1/{name=projects/*/ap" + + "provalRequests/*}:approve:\001*Z4\"//v1/{nam" + + "e=folders/*/approvalRequests/*}:approve:" + + "\001*Z:\"5/v1/{name=organizations/*/approval" + + "Requests/*}:approve:\001*\022\271\002\n\026DismissApprov" + + "alRequest\022=.google.cloud.accessapproval." + + "v1.DismissApprovalRequestMessage\032/.googl" + + "e.cloud.accessapproval.v1.ApprovalReques" + + "t\"\256\001\202\323\344\223\002\247\001\"0/v1/{name=projects/*/approv" + + "alRequests/*}:dismiss:\001*Z4\"//v1/{name=fo" + + "lders/*/approvalRequests/*}:dismiss:\001*Z:" + + "\"5/v1/{name=organizations/*/approvalRequ" + + "ests/*}:dismiss:\001*\022\261\002\n\031GetAccessApproval" + + "Settings\022@.google.cloud.accessapproval.v" + + "1.GetAccessApprovalSettingsMessage\0326.goo" + + "gle.cloud.accessapproval.v1.AccessApprov" + + "alSettings\"\231\001\202\323\344\223\002\222\001\022,/v1/{name=projects" + + "/*/accessApprovalSettings}Z-\022+/v1/{name=" + + "folders/*/accessApprovalSettings}Z3\0221/v1" + + "/{name=organizations/*/accessApprovalSet" + + "tings}\022\360\002\n\034UpdateAccessApprovalSettings\022" + + "C.google.cloud.accessapproval.v1.UpdateA" + + "ccessApprovalSettingsMessage\0326.google.cl" + + "oud.accessapproval.v1.AccessApprovalSett" + + "ings\"\322\001\202\323\344\223\002\313\00125/v1/{settings.name=proje" + + "cts/*/accessApprovalSettings}:\010settingsZ" + + "@24/v1/{settings.name=folders/*/accessAp" + + "provalSettings}:\010settingsZF2:/v1/{settin" + + "gs.name=organizations/*/accessApprovalSe" + + "ttings}:\010settings\022\227\002\n\034DeleteAccessApprov" + + "alSettings\022C.google.cloud.accessapproval" + + ".v1.DeleteAccessApprovalSettingsMessage\032" + + "\026.google.protobuf.Empty\"\231\001\202\323\344\223\002\222\001*,/v1/{" + + "name=projects/*/accessApprovalSettings}Z" + + "-*+/v1/{name=folders/*/accessApprovalSet" + + "tings}Z3*1/v1/{name=organizations/*/acce" + + "ssApprovalSettings}\032Q\312A\035accessapproval.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformB\211\001\n\"com.google.cl" + + "oud.accessapproval.v1B\023AccessApprovalPro" + + "toP\001ZLgoogle.golang.org/genproto/googlea" + + "pis/cloud/accessapproval/v1;accessapprov" + + "alb\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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_accessapproval_v1_AccessLocations_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_accessapproval_v1_AccessLocations_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_AccessLocations_descriptor, + new java.lang.String[] { + "PrincipalOfficeCountry", "PrincipalPhysicalLocationCountry", + }); + internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_accessapproval_v1_AccessReason_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor, + new java.lang.String[] { + "Type", "Detail", + }); + internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_accessapproval_v1_ApproveDecision_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor, + new java.lang.String[] { + "ApproveTime", "ExpireTime", + }); + internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_accessapproval_v1_DismissDecision_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor, + new java.lang.String[] { + "DismissTime", + }); + internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_accessapproval_v1_ResourceProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor, + new java.lang.String[] { + "ExcludesDescendants", + }); + internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_accessapproval_v1_ApprovalRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor, + new java.lang.String[] { + "Name", + "RequestedResourceName", + "RequestedResourceProperties", + "RequestedReason", + "RequestedLocations", + "RequestTime", + "RequestedExpiration", + "Approve", + "Dismiss", + "Decision", + }); + internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_accessapproval_v1_EnrolledService_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor, + new java.lang.String[] { + "CloudProduct", "EnrollmentLevel", + }); + internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor, + new java.lang.String[] { + "Name", "NotificationEmails", "EnrolledServices", "EnrolledAncestor", + }); + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor, + new java.lang.String[] { + "ApprovalRequests", "NextPageToken", + }); + internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor, + new java.lang.String[] { + "Name", "ExpireTime", + }); + internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor, + new java.lang.String[] { + "Settings", "UpdateMask", + }); + internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_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.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java new file mode 100644 index 00000000..dfd8d01e --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettings.java @@ -0,0 +1,1799 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Settings on a Project/Folder/Organization related to Access Approval.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.AccessApprovalSettings} + */ +public final class AccessApprovalSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.AccessApprovalSettings) + AccessApprovalSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessApprovalSettings.newBuilder() to construct. + private AccessApprovalSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessApprovalSettings() { + name_ = ""; + notificationEmails_ = com.google.protobuf.LazyStringArrayList.EMPTY; + enrolledServices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessApprovalSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessApprovalSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + notificationEmails_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + notificationEmails_.add(s); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + enrolledServices_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + enrolledServices_.add( + input.readMessage( + com.google.cloud.accessapproval.v1.EnrolledService.parser(), + extensionRegistry)); + break; + } + case 32: + { + enrolledAncestor_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + notificationEmails_ = notificationEmails_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + enrolledServices_ = java.util.Collections.unmodifiableList(enrolledServices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessApprovalSettings.class, + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the settings. Format is one of:
+   * <ol>
+   *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+   *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+   *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+   * <ol>
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the settings. Format is one of:
+   * <ol>
+   *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+   *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+   *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+   * <ol>
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFICATION_EMAILS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList notificationEmails_; + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @return A list containing the notificationEmails. + */ + public com.google.protobuf.ProtocolStringList getNotificationEmailsList() { + return notificationEmails_; + } + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @return The count of notificationEmails. + */ + public int getNotificationEmailsCount() { + return notificationEmails_.size(); + } + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index of the element to return. + * @return The notificationEmails at the given index. + */ + public java.lang.String getNotificationEmails(int index) { + return notificationEmails_.get(index); + } + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index of the value to return. + * @return The bytes of the notificationEmails at the given index. + */ + public com.google.protobuf.ByteString getNotificationEmailsBytes(int index) { + return notificationEmails_.getByteString(index); + } + + public static final int ENROLLED_SERVICES_FIELD_NUMBER = 3; + private java.util.List enrolledServices_; + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public java.util.List + getEnrolledServicesList() { + return enrolledServices_; + } + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public java.util.List + getEnrolledServicesOrBuilderList() { + return enrolledServices_; + } + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public int getEnrolledServicesCount() { + return enrolledServices_.size(); + } + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledService getEnrolledServices(int index) { + return enrolledServices_.get(index); + } + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder getEnrolledServicesOrBuilder( + int index) { + return enrolledServices_.get(index); + } + + public static final int ENROLLED_ANCESTOR_FIELD_NUMBER = 4; + private boolean enrolledAncestor_; + /** + * + * + *
+   * Output only. This field is read only (not settable via
+   * UpdateAccessAccessApprovalSettings method). If the field is true, that
+   * indicates that at least one service is enrolled for Access Approval in one
+   * or more ancestors of the Project or Folder (this field will always be
+   * unset for the organization since organizations do not have ancestors).
+   * 
+ * + * bool enrolled_ancestor = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The enrolledAncestor. + */ + public boolean getEnrolledAncestor() { + return enrolledAncestor_; + } + + 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 < notificationEmails_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, notificationEmails_.getRaw(i)); + } + for (int i = 0; i < enrolledServices_.size(); i++) { + output.writeMessage(3, enrolledServices_.get(i)); + } + if (enrolledAncestor_ != false) { + output.writeBool(4, enrolledAncestor_); + } + 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_); + } + { + int dataSize = 0; + for (int i = 0; i < notificationEmails_.size(); i++) { + dataSize += computeStringSizeNoTag(notificationEmails_.getRaw(i)); + } + size += dataSize; + size += 1 * getNotificationEmailsList().size(); + } + for (int i = 0; i < enrolledServices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, enrolledServices_.get(i)); + } + if (enrolledAncestor_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enrolledAncestor_); + } + 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.accessapproval.v1.AccessApprovalSettings)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.AccessApprovalSettings other = + (com.google.cloud.accessapproval.v1.AccessApprovalSettings) obj; + + if (!getName().equals(other.getName())) return false; + if (!getNotificationEmailsList().equals(other.getNotificationEmailsList())) return false; + if (!getEnrolledServicesList().equals(other.getEnrolledServicesList())) return false; + if (getEnrolledAncestor() != other.getEnrolledAncestor()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getNotificationEmailsCount() > 0) { + hash = (37 * hash) + NOTIFICATION_EMAILS_FIELD_NUMBER; + hash = (53 * hash) + getNotificationEmailsList().hashCode(); + } + if (getEnrolledServicesCount() > 0) { + hash = (37 * hash) + ENROLLED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getEnrolledServicesList().hashCode(); + } + hash = (37 * hash) + ENROLLED_ANCESTOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnrolledAncestor()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings 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.accessapproval.v1.AccessApprovalSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings 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.accessapproval.v1.AccessApprovalSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings 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.accessapproval.v1.AccessApprovalSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings 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.accessapproval.v1.AccessApprovalSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings 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.accessapproval.v1.AccessApprovalSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Settings on a Project/Folder/Organization related to Access Approval.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.AccessApprovalSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.AccessApprovalSettings) + com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessApprovalSettings.class, + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.AccessApprovalSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEnrolledServicesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + notificationEmails_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (enrolledServicesBuilder_ == null) { + enrolledServices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + enrolledServicesBuilder_.clear(); + } + enrolledAncestor_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessApprovalSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessApprovalSettings getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessApprovalSettings build() { + com.google.cloud.accessapproval.v1.AccessApprovalSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessApprovalSettings buildPartial() { + com.google.cloud.accessapproval.v1.AccessApprovalSettings result = + new com.google.cloud.accessapproval.v1.AccessApprovalSettings(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (((bitField0_ & 0x00000001) != 0)) { + notificationEmails_ = notificationEmails_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.notificationEmails_ = notificationEmails_; + if (enrolledServicesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + enrolledServices_ = java.util.Collections.unmodifiableList(enrolledServices_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.enrolledServices_ = enrolledServices_; + } else { + result.enrolledServices_ = enrolledServicesBuilder_.build(); + } + result.enrolledAncestor_ = enrolledAncestor_; + 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.accessapproval.v1.AccessApprovalSettings) { + return mergeFrom((com.google.cloud.accessapproval.v1.AccessApprovalSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.AccessApprovalSettings other) { + if (other == com.google.cloud.accessapproval.v1.AccessApprovalSettings.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.notificationEmails_.isEmpty()) { + if (notificationEmails_.isEmpty()) { + notificationEmails_ = other.notificationEmails_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNotificationEmailsIsMutable(); + notificationEmails_.addAll(other.notificationEmails_); + } + onChanged(); + } + if (enrolledServicesBuilder_ == null) { + if (!other.enrolledServices_.isEmpty()) { + if (enrolledServices_.isEmpty()) { + enrolledServices_ = other.enrolledServices_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEnrolledServicesIsMutable(); + enrolledServices_.addAll(other.enrolledServices_); + } + onChanged(); + } + } else { + if (!other.enrolledServices_.isEmpty()) { + if (enrolledServicesBuilder_.isEmpty()) { + enrolledServicesBuilder_.dispose(); + enrolledServicesBuilder_ = null; + enrolledServices_ = other.enrolledServices_; + bitField0_ = (bitField0_ & ~0x00000002); + enrolledServicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnrolledServicesFieldBuilder() + : null; + } else { + enrolledServicesBuilder_.addAllMessages(other.enrolledServices_); + } + } + } + if (other.getEnrolledAncestor() != false) { + setEnrolledAncestor(other.getEnrolledAncestor()); + } + 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.accessapproval.v1.AccessApprovalSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.AccessApprovalSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the settings. Format is one of:
+     * <ol>
+     *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+     *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+     *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+     * <ol>
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the settings. Format is one of:
+     * <ol>
+     *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+     *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+     *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+     * <ol>
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the settings. Format is one of:
+     * <ol>
+     *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+     *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+     *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+     * <ol>
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the settings. Format is one of:
+     * <ol>
+     *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+     *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+     *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+     * <ol>
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the settings. Format is one of:
+     * <ol>
+     *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+     *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+     *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+     * <ol>
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList notificationEmails_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureNotificationEmailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + notificationEmails_ = new com.google.protobuf.LazyStringArrayList(notificationEmails_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @return A list containing the notificationEmails. + */ + public com.google.protobuf.ProtocolStringList getNotificationEmailsList() { + return notificationEmails_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @return The count of notificationEmails. + */ + public int getNotificationEmailsCount() { + return notificationEmails_.size(); + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index of the element to return. + * @return The notificationEmails at the given index. + */ + public java.lang.String getNotificationEmails(int index) { + return notificationEmails_.get(index); + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param value The bytes of the notificationEmails to add. + */ + public com.google.protobuf.ByteString getNotificationEmailsBytes(int index) { + return notificationEmails_.getByteString(index); + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index to set the value at. + * @param value The notificationEmails to set. + * @return This builder for chaining. + */ + public Builder setNotificationEmails(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationEmailsIsMutable(); + notificationEmails_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param value The notificationEmails to add. + * @return This builder for chaining. + */ + public Builder addNotificationEmails(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationEmailsIsMutable(); + notificationEmails_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param values The notificationEmails to add. + * @return This builder for chaining. + */ + public Builder addAllNotificationEmails(java.lang.Iterable values) { + ensureNotificationEmailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notificationEmails_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @return This builder for chaining. + */ + public Builder clearNotificationEmails() { + notificationEmails_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of email addresses to which notifications relating to approval
+     * requests should be sent. Notifications relating to a resource will be sent
+     * to all emails in the settings of ancestor resources of that resource. A
+     * maximum of 50 email addresses are allowed.
+     * 
+ * + * repeated string notification_emails = 2; + * + * @param value The bytes of the notificationEmails to add. + * @return This builder for chaining. + */ + public Builder addNotificationEmailsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNotificationEmailsIsMutable(); + notificationEmails_.add(value); + onChanged(); + return this; + } + + private java.util.List enrolledServices_ = + java.util.Collections.emptyList(); + + private void ensureEnrolledServicesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + enrolledServices_ = + new java.util.ArrayList( + enrolledServices_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.EnrolledService, + com.google.cloud.accessapproval.v1.EnrolledService.Builder, + com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder> + enrolledServicesBuilder_; + + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public java.util.List + getEnrolledServicesList() { + if (enrolledServicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(enrolledServices_); + } else { + return enrolledServicesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public int getEnrolledServicesCount() { + if (enrolledServicesBuilder_ == null) { + return enrolledServices_.size(); + } else { + return enrolledServicesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledService getEnrolledServices(int index) { + if (enrolledServicesBuilder_ == null) { + return enrolledServices_.get(index); + } else { + return enrolledServicesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder setEnrolledServices( + int index, com.google.cloud.accessapproval.v1.EnrolledService value) { + if (enrolledServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnrolledServicesIsMutable(); + enrolledServices_.set(index, value); + onChanged(); + } else { + enrolledServicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder setEnrolledServices( + int index, com.google.cloud.accessapproval.v1.EnrolledService.Builder builderForValue) { + if (enrolledServicesBuilder_ == null) { + ensureEnrolledServicesIsMutable(); + enrolledServices_.set(index, builderForValue.build()); + onChanged(); + } else { + enrolledServicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder addEnrolledServices(com.google.cloud.accessapproval.v1.EnrolledService value) { + if (enrolledServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnrolledServicesIsMutable(); + enrolledServices_.add(value); + onChanged(); + } else { + enrolledServicesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder addEnrolledServices( + int index, com.google.cloud.accessapproval.v1.EnrolledService value) { + if (enrolledServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnrolledServicesIsMutable(); + enrolledServices_.add(index, value); + onChanged(); + } else { + enrolledServicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder addEnrolledServices( + com.google.cloud.accessapproval.v1.EnrolledService.Builder builderForValue) { + if (enrolledServicesBuilder_ == null) { + ensureEnrolledServicesIsMutable(); + enrolledServices_.add(builderForValue.build()); + onChanged(); + } else { + enrolledServicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder addEnrolledServices( + int index, com.google.cloud.accessapproval.v1.EnrolledService.Builder builderForValue) { + if (enrolledServicesBuilder_ == null) { + ensureEnrolledServicesIsMutable(); + enrolledServices_.add(index, builderForValue.build()); + onChanged(); + } else { + enrolledServicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder addAllEnrolledServices( + java.lang.Iterable values) { + if (enrolledServicesBuilder_ == null) { + ensureEnrolledServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, enrolledServices_); + onChanged(); + } else { + enrolledServicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder clearEnrolledServices() { + if (enrolledServicesBuilder_ == null) { + enrolledServices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + enrolledServicesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public Builder removeEnrolledServices(int index) { + if (enrolledServicesBuilder_ == null) { + ensureEnrolledServicesIsMutable(); + enrolledServices_.remove(index); + onChanged(); + } else { + enrolledServicesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledService.Builder getEnrolledServicesBuilder( + int index) { + return getEnrolledServicesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder getEnrolledServicesOrBuilder( + int index) { + if (enrolledServicesBuilder_ == null) { + return enrolledServices_.get(index); + } else { + return enrolledServicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public java.util.List + getEnrolledServicesOrBuilderList() { + if (enrolledServicesBuilder_ != null) { + return enrolledServicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(enrolledServices_); + } + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledService.Builder addEnrolledServicesBuilder() { + return getEnrolledServicesFieldBuilder() + .addBuilder(com.google.cloud.accessapproval.v1.EnrolledService.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public com.google.cloud.accessapproval.v1.EnrolledService.Builder addEnrolledServicesBuilder( + int index) { + return getEnrolledServicesFieldBuilder() + .addBuilder( + index, com.google.cloud.accessapproval.v1.EnrolledService.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Google Cloud Services for which the given resource has Access
+     * Approval enrolled. Access requests for the resource given by name against
+     * any of these services contained here will be required to have explicit
+     * approval. If name refers to an organization, enrollment can be done for
+     * individual services. If name refers to a folder or project, enrollment can
+     * only be done on an all or nothing basis.
+     * If a cloud_product is repeated in this list, the first entry will be
+     * honored and all following entries will be discarded. A maximum of 10
+     * enrolled services will be enforced, to be expanded as the set of supported
+     * services is expanded.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + public java.util.List + getEnrolledServicesBuilderList() { + return getEnrolledServicesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.EnrolledService, + com.google.cloud.accessapproval.v1.EnrolledService.Builder, + com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder> + getEnrolledServicesFieldBuilder() { + if (enrolledServicesBuilder_ == null) { + enrolledServicesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.EnrolledService, + com.google.cloud.accessapproval.v1.EnrolledService.Builder, + com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder>( + enrolledServices_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + enrolledServices_ = null; + } + return enrolledServicesBuilder_; + } + + private boolean enrolledAncestor_; + /** + * + * + *
+     * Output only. This field is read only (not settable via
+     * UpdateAccessAccessApprovalSettings method). If the field is true, that
+     * indicates that at least one service is enrolled for Access Approval in one
+     * or more ancestors of the Project or Folder (this field will always be
+     * unset for the organization since organizations do not have ancestors).
+     * 
+ * + * bool enrolled_ancestor = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The enrolledAncestor. + */ + public boolean getEnrolledAncestor() { + return enrolledAncestor_; + } + /** + * + * + *
+     * Output only. This field is read only (not settable via
+     * UpdateAccessAccessApprovalSettings method). If the field is true, that
+     * indicates that at least one service is enrolled for Access Approval in one
+     * or more ancestors of the Project or Folder (this field will always be
+     * unset for the organization since organizations do not have ancestors).
+     * 
+ * + * bool enrolled_ancestor = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The enrolledAncestor to set. + * @return This builder for chaining. + */ + public Builder setEnrolledAncestor(boolean value) { + + enrolledAncestor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This field is read only (not settable via
+     * UpdateAccessAccessApprovalSettings method). If the field is true, that
+     * indicates that at least one service is enrolled for Access Approval in one
+     * or more ancestors of the Project or Folder (this field will always be
+     * unset for the organization since organizations do not have ancestors).
+     * 
+ * + * bool enrolled_ancestor = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEnrolledAncestor() { + + enrolledAncestor_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.accessapproval.v1.AccessApprovalSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.AccessApprovalSettings) + private static final com.google.cloud.accessapproval.v1.AccessApprovalSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.AccessApprovalSettings(); + } + + public static com.google.cloud.accessapproval.v1.AccessApprovalSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessApprovalSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessApprovalSettings(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.accessapproval.v1.AccessApprovalSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettingsOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettingsOrBuilder.java new file mode 100644 index 00000000..6c7d66b0 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalSettingsOrBuilder.java @@ -0,0 +1,238 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface AccessApprovalSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.AccessApprovalSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the settings. Format is one of:
+   * <ol>
+   *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+   *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+   *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+   * <ol>
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the settings. Format is one of:
+   * <ol>
+   *   <li>"projects/{project_id}/accessApprovalSettings"</li>
+   *   <li>"folders/{folder_id}/accessApprovalSettings"</li>
+   *   <li>"organizations/{organization_id}/accessApprovalSettings"</li>
+   * <ol>
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @return A list containing the notificationEmails. + */ + java.util.List getNotificationEmailsList(); + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @return The count of notificationEmails. + */ + int getNotificationEmailsCount(); + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index of the element to return. + * @return The notificationEmails at the given index. + */ + java.lang.String getNotificationEmails(int index); + /** + * + * + *
+   * A list of email addresses to which notifications relating to approval
+   * requests should be sent. Notifications relating to a resource will be sent
+   * to all emails in the settings of ancestor resources of that resource. A
+   * maximum of 50 email addresses are allowed.
+   * 
+ * + * repeated string notification_emails = 2; + * + * @param index The index of the value to return. + * @return The bytes of the notificationEmails at the given index. + */ + com.google.protobuf.ByteString getNotificationEmailsBytes(int index); + + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + java.util.List getEnrolledServicesList(); + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + com.google.cloud.accessapproval.v1.EnrolledService getEnrolledServices(int index); + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + int getEnrolledServicesCount(); + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + java.util.List + getEnrolledServicesOrBuilderList(); + /** + * + * + *
+   * A list of Google Cloud Services for which the given resource has Access
+   * Approval enrolled. Access requests for the resource given by name against
+   * any of these services contained here will be required to have explicit
+   * approval. If name refers to an organization, enrollment can be done for
+   * individual services. If name refers to a folder or project, enrollment can
+   * only be done on an all or nothing basis.
+   * If a cloud_product is repeated in this list, the first entry will be
+   * honored and all following entries will be discarded. A maximum of 10
+   * enrolled services will be enforced, to be expanded as the set of supported
+   * services is expanded.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.EnrolledService enrolled_services = 3; + */ + com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder getEnrolledServicesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. This field is read only (not settable via
+   * UpdateAccessAccessApprovalSettings method). If the field is true, that
+   * indicates that at least one service is enrolled for Access Approval in one
+   * or more ancestors of the Project or Folder (this field will always be
+   * unset for the organization since organizations do not have ancestors).
+   * 
+ * + * bool enrolled_ancestor = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The enrolledAncestor. + */ + boolean getEnrolledAncestor(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocations.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocations.java new file mode 100644 index 00000000..517485ff --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocations.java @@ -0,0 +1,1012 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Home office and physical location of the principal.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.AccessLocations} + */ +public final class AccessLocations extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.AccessLocations) + AccessLocationsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessLocations.newBuilder() to construct. + private AccessLocations(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessLocations() { + principalOfficeCountry_ = ""; + principalPhysicalLocationCountry_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessLocations(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessLocations( + 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(); + + principalOfficeCountry_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + principalPhysicalLocationCountry_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessLocations_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessLocations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessLocations.class, + com.google.cloud.accessapproval.v1.AccessLocations.Builder.class); + } + + public static final int PRINCIPAL_OFFICE_COUNTRY_FIELD_NUMBER = 1; + private volatile java.lang.Object principalOfficeCountry_; + /** + * + * + *
+   * The "home office" location of the principal. A two-letter country code
+   * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+   * limited situations Google systems may refer refer to a region code instead
+   * of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_office_country = 1; + * + * @return The principalOfficeCountry. + */ + public java.lang.String getPrincipalOfficeCountry() { + java.lang.Object ref = principalOfficeCountry_; + 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(); + principalOfficeCountry_ = s; + return s; + } + } + /** + * + * + *
+   * The "home office" location of the principal. A two-letter country code
+   * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+   * limited situations Google systems may refer refer to a region code instead
+   * of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_office_country = 1; + * + * @return The bytes for principalOfficeCountry. + */ + public com.google.protobuf.ByteString getPrincipalOfficeCountryBytes() { + java.lang.Object ref = principalOfficeCountry_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalOfficeCountry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRINCIPAL_PHYSICAL_LOCATION_COUNTRY_FIELD_NUMBER = 2; + private volatile java.lang.Object principalPhysicalLocationCountry_; + /** + * + * + *
+   * Physical location of the principal at the time of the access. A
+   * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+   * a region code. In some limited situations Google systems may refer refer to
+   * a region code instead of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_physical_location_country = 2; + * + * @return The principalPhysicalLocationCountry. + */ + public java.lang.String getPrincipalPhysicalLocationCountry() { + java.lang.Object ref = principalPhysicalLocationCountry_; + 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(); + principalPhysicalLocationCountry_ = s; + return s; + } + } + /** + * + * + *
+   * Physical location of the principal at the time of the access. A
+   * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+   * a region code. In some limited situations Google systems may refer refer to
+   * a region code instead of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_physical_location_country = 2; + * + * @return The bytes for principalPhysicalLocationCountry. + */ + public com.google.protobuf.ByteString getPrincipalPhysicalLocationCountryBytes() { + java.lang.Object ref = principalPhysicalLocationCountry_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalPhysicalLocationCountry_ = 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 (!getPrincipalOfficeCountryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principalOfficeCountry_); + } + if (!getPrincipalPhysicalLocationCountryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, principalPhysicalLocationCountry_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPrincipalOfficeCountryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principalOfficeCountry_); + } + if (!getPrincipalPhysicalLocationCountryBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, principalPhysicalLocationCountry_); + } + 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.accessapproval.v1.AccessLocations)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.AccessLocations other = + (com.google.cloud.accessapproval.v1.AccessLocations) obj; + + if (!getPrincipalOfficeCountry().equals(other.getPrincipalOfficeCountry())) return false; + if (!getPrincipalPhysicalLocationCountry().equals(other.getPrincipalPhysicalLocationCountry())) + 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) + PRINCIPAL_OFFICE_COUNTRY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalOfficeCountry().hashCode(); + hash = (37 * hash) + PRINCIPAL_PHYSICAL_LOCATION_COUNTRY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalPhysicalLocationCountry().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.AccessLocations parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations 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.accessapproval.v1.AccessLocations parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations 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.accessapproval.v1.AccessLocations parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations 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.accessapproval.v1.AccessLocations parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations 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.accessapproval.v1.AccessLocations parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations 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.accessapproval.v1.AccessLocations 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; + } + /** + * + * + *
+   * Home office and physical location of the principal.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.AccessLocations} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.AccessLocations) + com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessLocations_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessLocations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessLocations.class, + com.google.cloud.accessapproval.v1.AccessLocations.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.AccessLocations.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(); + principalOfficeCountry_ = ""; + + principalPhysicalLocationCountry_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessLocations_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessLocations getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.AccessLocations.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessLocations build() { + com.google.cloud.accessapproval.v1.AccessLocations result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessLocations buildPartial() { + com.google.cloud.accessapproval.v1.AccessLocations result = + new com.google.cloud.accessapproval.v1.AccessLocations(this); + result.principalOfficeCountry_ = principalOfficeCountry_; + result.principalPhysicalLocationCountry_ = principalPhysicalLocationCountry_; + 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.accessapproval.v1.AccessLocations) { + return mergeFrom((com.google.cloud.accessapproval.v1.AccessLocations) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.AccessLocations other) { + if (other == com.google.cloud.accessapproval.v1.AccessLocations.getDefaultInstance()) + return this; + if (!other.getPrincipalOfficeCountry().isEmpty()) { + principalOfficeCountry_ = other.principalOfficeCountry_; + onChanged(); + } + if (!other.getPrincipalPhysicalLocationCountry().isEmpty()) { + principalPhysicalLocationCountry_ = other.principalPhysicalLocationCountry_; + 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.accessapproval.v1.AccessLocations parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.AccessLocations) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object principalOfficeCountry_ = ""; + /** + * + * + *
+     * The "home office" location of the principal. A two-letter country code
+     * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+     * limited situations Google systems may refer refer to a region code instead
+     * of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_office_country = 1; + * + * @return The principalOfficeCountry. + */ + public java.lang.String getPrincipalOfficeCountry() { + java.lang.Object ref = principalOfficeCountry_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalOfficeCountry_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The "home office" location of the principal. A two-letter country code
+     * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+     * limited situations Google systems may refer refer to a region code instead
+     * of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_office_country = 1; + * + * @return The bytes for principalOfficeCountry. + */ + public com.google.protobuf.ByteString getPrincipalOfficeCountryBytes() { + java.lang.Object ref = principalOfficeCountry_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalOfficeCountry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The "home office" location of the principal. A two-letter country code
+     * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+     * limited situations Google systems may refer refer to a region code instead
+     * of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_office_country = 1; + * + * @param value The principalOfficeCountry to set. + * @return This builder for chaining. + */ + public Builder setPrincipalOfficeCountry(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + principalOfficeCountry_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The "home office" location of the principal. A two-letter country code
+     * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+     * limited situations Google systems may refer refer to a region code instead
+     * of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_office_country = 1; + * + * @return This builder for chaining. + */ + public Builder clearPrincipalOfficeCountry() { + + principalOfficeCountry_ = getDefaultInstance().getPrincipalOfficeCountry(); + onChanged(); + return this; + } + /** + * + * + *
+     * The "home office" location of the principal. A two-letter country code
+     * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+     * limited situations Google systems may refer refer to a region code instead
+     * of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_office_country = 1; + * + * @param value The bytes for principalOfficeCountry to set. + * @return This builder for chaining. + */ + public Builder setPrincipalOfficeCountryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + principalOfficeCountry_ = value; + onChanged(); + return this; + } + + private java.lang.Object principalPhysicalLocationCountry_ = ""; + /** + * + * + *
+     * Physical location of the principal at the time of the access. A
+     * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+     * a region code. In some limited situations Google systems may refer refer to
+     * a region code instead of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_physical_location_country = 2; + * + * @return The principalPhysicalLocationCountry. + */ + public java.lang.String getPrincipalPhysicalLocationCountry() { + java.lang.Object ref = principalPhysicalLocationCountry_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalPhysicalLocationCountry_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Physical location of the principal at the time of the access. A
+     * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+     * a region code. In some limited situations Google systems may refer refer to
+     * a region code instead of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_physical_location_country = 2; + * + * @return The bytes for principalPhysicalLocationCountry. + */ + public com.google.protobuf.ByteString getPrincipalPhysicalLocationCountryBytes() { + java.lang.Object ref = principalPhysicalLocationCountry_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalPhysicalLocationCountry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Physical location of the principal at the time of the access. A
+     * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+     * a region code. In some limited situations Google systems may refer refer to
+     * a region code instead of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_physical_location_country = 2; + * + * @param value The principalPhysicalLocationCountry to set. + * @return This builder for chaining. + */ + public Builder setPrincipalPhysicalLocationCountry(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + principalPhysicalLocationCountry_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Physical location of the principal at the time of the access. A
+     * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+     * a region code. In some limited situations Google systems may refer refer to
+     * a region code instead of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_physical_location_country = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrincipalPhysicalLocationCountry() { + + principalPhysicalLocationCountry_ = + getDefaultInstance().getPrincipalPhysicalLocationCountry(); + onChanged(); + return this; + } + /** + * + * + *
+     * Physical location of the principal at the time of the access. A
+     * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+     * a region code. In some limited situations Google systems may refer refer to
+     * a region code instead of a country code.
+     * Possible Region Codes:
+     * <ol>
+     *   <li>ASI: Asia</li>
+     *   <li>EUR: Europe</li>
+     *   <li>OCE: Oceania</li>
+     *   <li>AFR: Africa</li>
+     *   <li>NAM: North America</li>
+     *   <li>SAM: South America</li>
+     *   <li>ANT: Antarctica</li>
+     *   <li>ANY: Any location</li>
+     * </ol>
+     * 
+ * + * string principal_physical_location_country = 2; + * + * @param value The bytes for principalPhysicalLocationCountry to set. + * @return This builder for chaining. + */ + public Builder setPrincipalPhysicalLocationCountryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + principalPhysicalLocationCountry_ = 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.accessapproval.v1.AccessLocations) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.AccessLocations) + private static final com.google.cloud.accessapproval.v1.AccessLocations DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.AccessLocations(); + } + + public static com.google.cloud.accessapproval.v1.AccessLocations getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessLocations parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessLocations(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.accessapproval.v1.AccessLocations getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocationsOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocationsOrBuilder.java new file mode 100644 index 00000000..b2fc1af3 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessLocationsOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface AccessLocationsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.AccessLocations) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The "home office" location of the principal. A two-letter country code
+   * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+   * limited situations Google systems may refer refer to a region code instead
+   * of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_office_country = 1; + * + * @return The principalOfficeCountry. + */ + java.lang.String getPrincipalOfficeCountry(); + /** + * + * + *
+   * The "home office" location of the principal. A two-letter country code
+   * (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
+   * limited situations Google systems may refer refer to a region code instead
+   * of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_office_country = 1; + * + * @return The bytes for principalOfficeCountry. + */ + com.google.protobuf.ByteString getPrincipalOfficeCountryBytes(); + + /** + * + * + *
+   * Physical location of the principal at the time of the access. A
+   * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+   * a region code. In some limited situations Google systems may refer refer to
+   * a region code instead of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_physical_location_country = 2; + * + * @return The principalPhysicalLocationCountry. + */ + java.lang.String getPrincipalPhysicalLocationCountry(); + /** + * + * + *
+   * Physical location of the principal at the time of the access. A
+   * two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
+   * a region code. In some limited situations Google systems may refer refer to
+   * a region code instead of a country code.
+   * Possible Region Codes:
+   * <ol>
+   *   <li>ASI: Asia</li>
+   *   <li>EUR: Europe</li>
+   *   <li>OCE: Oceania</li>
+   *   <li>AFR: Africa</li>
+   *   <li>NAM: North America</li>
+   *   <li>SAM: South America</li>
+   *   <li>ANT: Antarctica</li>
+   *   <li>ANY: Any location</li>
+   * </ol>
+   * 
+ * + * string principal_physical_location_country = 2; + * + * @return The bytes for principalPhysicalLocationCountry. + */ + com.google.protobuf.ByteString getPrincipalPhysicalLocationCountryBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReason.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReason.java new file mode 100644 index 00000000..1ddfcae1 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReason.java @@ -0,0 +1,969 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** Protobuf type {@code google.cloud.accessapproval.v1.AccessReason} */ +public final class AccessReason extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.AccessReason) + AccessReasonOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessReason.newBuilder() to construct. + private AccessReason(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessReason() { + type_ = 0; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessReason(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessReason( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + detail_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessReason.class, + com.google.cloud.accessapproval.v1.AccessReason.Builder.class); + } + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * Protobuf enum {@code google.cloud.accessapproval.v1.AccessReason.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     * <ol>
+     *   <li>"Feedback Report: #####"</li>
+     *   <li>"Case Number: #####"</li>
+     *   <li>"Case ID: #####"</li>
+     *   <li>"E-PIN Reference: #####"</li>
+     *   <li>"Google-#####"</li>
+     *   <li>"T-#####"</li>
+     * </ol>
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + CUSTOMER_INITIATED_SUPPORT(1), + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage. Often this access is used
+     * to confirm that customers are not affected by a suspected service issue
+     * or to remediate a reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + GOOGLE_INITIATED_SERVICE(2), + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + GOOGLE_INITIATED_REVIEW(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     * <ol>
+     *   <li>"Feedback Report: #####"</li>
+     *   <li>"Case Number: #####"</li>
+     *   <li>"Case ID: #####"</li>
+     *   <li>"E-PIN Reference: #####"</li>
+     *   <li>"Google-#####"</li>
+     *   <li>"T-#####"</li>
+     * </ol>
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + public static final int CUSTOMER_INITIATED_SUPPORT_VALUE = 1; + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage. Often this access is used
+     * to confirm that customers are not affected by a suspected service issue
+     * or to remediate a reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + public static final int GOOGLE_INITIATED_SERVICE_VALUE = 2; + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + public static final int GOOGLE_INITIATED_REVIEW_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return CUSTOMER_INITIATED_SUPPORT; + case 2: + return GOOGLE_INITIATED_SERVICE; + case 3: + return GOOGLE_INITIATED_REVIEW; + 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 Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessReason.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.accessapproval.v1.AccessReason.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + public com.google.cloud.accessapproval.v1.AccessReason.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.accessapproval.v1.AccessReason.Type result = + com.google.cloud.accessapproval.v1.AccessReason.Type.valueOf(type_); + return result == null + ? com.google.cloud.accessapproval.v1.AccessReason.Type.UNRECOGNIZED + : result; + } + + public static final int DETAIL_FIELD_NUMBER = 2; + private volatile java.lang.Object detail_; + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + 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(); + detail_ = s; + return s; + } + } + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = 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 (type_ + != com.google.cloud.accessapproval.v1.AccessReason.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (!getDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.accessapproval.v1.AccessReason.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!getDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + } + 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.accessapproval.v1.AccessReason)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.AccessReason other = + (com.google.cloud.accessapproval.v1.AccessReason) obj; + + if (type_ != other.type_) return false; + if (!getDetail().equals(other.getDetail())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.AccessReason parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessReason 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.accessapproval.v1.AccessReason parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessReason 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.accessapproval.v1.AccessReason parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.AccessReason parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.AccessReason parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessReason 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.accessapproval.v1.AccessReason parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessReason 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.accessapproval.v1.AccessReason parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.AccessReason 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.accessapproval.v1.AccessReason 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; + } + /** Protobuf type {@code google.cloud.accessapproval.v1.AccessReason} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.AccessReason) + com.google.cloud.accessapproval.v1.AccessReasonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.AccessReason.class, + com.google.cloud.accessapproval.v1.AccessReason.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.AccessReason.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(); + type_ = 0; + + detail_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_AccessReason_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessReason getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.AccessReason.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessReason build() { + com.google.cloud.accessapproval.v1.AccessReason result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.AccessReason buildPartial() { + com.google.cloud.accessapproval.v1.AccessReason result = + new com.google.cloud.accessapproval.v1.AccessReason(this); + result.type_ = type_; + result.detail_ = detail_; + 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.accessapproval.v1.AccessReason) { + return mergeFrom((com.google.cloud.accessapproval.v1.AccessReason) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.AccessReason other) { + if (other == com.google.cloud.accessapproval.v1.AccessReason.getDefaultInstance()) + return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + 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.accessapproval.v1.AccessReason parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.accessapproval.v1.AccessReason) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + public com.google.cloud.accessapproval.v1.AccessReason.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.accessapproval.v1.AccessReason.Type result = + com.google.cloud.accessapproval.v1.AccessReason.Type.valueOf(type_); + return result == null + ? com.google.cloud.accessapproval.v1.AccessReason.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.accessapproval.v1.AccessReason.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + detail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + + detail_ = getDefaultInstance().getDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + detail_ = 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.accessapproval.v1.AccessReason) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.AccessReason) + private static final com.google.cloud.accessapproval.v1.AccessReason DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.AccessReason(); + } + + public static com.google.cloud.accessapproval.v1.AccessReason getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessReason parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessReason(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.accessapproval.v1.AccessReason getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReasonOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReasonOrBuilder.java new file mode 100644 index 00000000..54741da3 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessReasonOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface AccessReasonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.AccessReason) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + com.google.cloud.accessapproval.v1.AccessReason.Type getType(); + + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + java.lang.String getDetail(); + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequest.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequest.java new file mode 100644 index 00000000..c1e855ea --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequest.java @@ -0,0 +1,2946 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * A request for the customer to approve access to a resource.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApprovalRequest} + */ +public final class ApprovalRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ApprovalRequest) + ApprovalRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApprovalRequest.newBuilder() to construct. + private ApprovalRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApprovalRequest() { + name_ = ""; + requestedResourceName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApprovalRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ApprovalRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestedResourceName_ = s; + break; + } + case 26: + { + com.google.cloud.accessapproval.v1.AccessReason.Builder subBuilder = null; + if (requestedReason_ != null) { + subBuilder = requestedReason_.toBuilder(); + } + requestedReason_ = + input.readMessage( + com.google.cloud.accessapproval.v1.AccessReason.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestedReason_); + requestedReason_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.accessapproval.v1.AccessLocations.Builder subBuilder = null; + if (requestedLocations_ != null) { + subBuilder = requestedLocations_.toBuilder(); + } + requestedLocations_ = + input.readMessage( + com.google.cloud.accessapproval.v1.AccessLocations.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestedLocations_); + requestedLocations_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (requestTime_ != null) { + subBuilder = requestTime_.toBuilder(); + } + requestTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestTime_); + requestTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (requestedExpiration_ != null) { + subBuilder = requestedExpiration_.toBuilder(); + } + requestedExpiration_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestedExpiration_); + requestedExpiration_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.cloud.accessapproval.v1.ApproveDecision.Builder subBuilder = null; + if (decisionCase_ == 7) { + subBuilder = + ((com.google.cloud.accessapproval.v1.ApproveDecision) decision_).toBuilder(); + } + decision_ = + input.readMessage( + com.google.cloud.accessapproval.v1.ApproveDecision.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.accessapproval.v1.ApproveDecision) decision_); + decision_ = subBuilder.buildPartial(); + } + decisionCase_ = 7; + break; + } + case 66: + { + com.google.cloud.accessapproval.v1.DismissDecision.Builder subBuilder = null; + if (decisionCase_ == 8) { + subBuilder = + ((com.google.cloud.accessapproval.v1.DismissDecision) decision_).toBuilder(); + } + decision_ = + input.readMessage( + com.google.cloud.accessapproval.v1.DismissDecision.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.accessapproval.v1.DismissDecision) decision_); + decision_ = subBuilder.buildPartial(); + } + decisionCase_ = 8; + break; + } + case 74: + { + com.google.cloud.accessapproval.v1.ResourceProperties.Builder subBuilder = null; + if (requestedResourceProperties_ != null) { + subBuilder = requestedResourceProperties_.toBuilder(); + } + requestedResourceProperties_ = + input.readMessage( + com.google.cloud.accessapproval.v1.ResourceProperties.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestedResourceProperties_); + requestedResourceProperties_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApprovalRequest.class, + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder.class); + } + + private int decisionCase_ = 0; + private java.lang.Object decision_; + + public enum DecisionCase implements com.google.protobuf.Internal.EnumLite { + APPROVE(7), + DISMISS(8), + DECISION_NOT_SET(0); + private final int value; + + private DecisionCase(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 DecisionCase valueOf(int value) { + return forNumber(value); + } + + public static DecisionCase forNumber(int value) { + switch (value) { + case 7: + return APPROVE; + case 8: + return DISMISS; + case 0: + return DECISION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DecisionCase getDecisionCase() { + return DecisionCase.forNumber(decisionCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the request. Format is
+   * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the request. Format is
+   * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_RESOURCE_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object requestedResourceName_; + /** + * + * + *
+   * The resource for which approval is being requested. The format of the
+   * resource name is defined at
+   * https://cloud.google.com/apis/design/resource_names. The resource name here
+   * may either be a "full" resource name (e.g.
+   * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+   * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+   * resource name specification.
+   * 
+ * + * string requested_resource_name = 2; + * + * @return The requestedResourceName. + */ + public java.lang.String getRequestedResourceName() { + java.lang.Object ref = requestedResourceName_; + 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(); + requestedResourceName_ = s; + return s; + } + } + /** + * + * + *
+   * The resource for which approval is being requested. The format of the
+   * resource name is defined at
+   * https://cloud.google.com/apis/design/resource_names. The resource name here
+   * may either be a "full" resource name (e.g.
+   * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+   * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+   * resource name specification.
+   * 
+ * + * string requested_resource_name = 2; + * + * @return The bytes for requestedResourceName. + */ + public com.google.protobuf.ByteString getRequestedResourceNameBytes() { + java.lang.Object ref = requestedResourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestedResourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_RESOURCE_PROPERTIES_FIELD_NUMBER = 9; + private com.google.cloud.accessapproval.v1.ResourceProperties requestedResourceProperties_; + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return Whether the requestedResourceProperties field is set. + */ + public boolean hasRequestedResourceProperties() { + return requestedResourceProperties_ != null; + } + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return The requestedResourceProperties. + */ + public com.google.cloud.accessapproval.v1.ResourceProperties getRequestedResourceProperties() { + return requestedResourceProperties_ == null + ? com.google.cloud.accessapproval.v1.ResourceProperties.getDefaultInstance() + : requestedResourceProperties_; + } + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder + getRequestedResourcePropertiesOrBuilder() { + return getRequestedResourceProperties(); + } + + public static final int REQUESTED_REASON_FIELD_NUMBER = 3; + private com.google.cloud.accessapproval.v1.AccessReason requestedReason_; + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + public boolean hasRequestedReason() { + return requestedReason_ != null; + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + public com.google.cloud.accessapproval.v1.AccessReason getRequestedReason() { + return requestedReason_ == null + ? com.google.cloud.accessapproval.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public com.google.cloud.accessapproval.v1.AccessReasonOrBuilder getRequestedReasonOrBuilder() { + return getRequestedReason(); + } + + public static final int REQUESTED_LOCATIONS_FIELD_NUMBER = 4; + private com.google.cloud.accessapproval.v1.AccessLocations requestedLocations_; + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return Whether the requestedLocations field is set. + */ + public boolean hasRequestedLocations() { + return requestedLocations_ != null; + } + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return The requestedLocations. + */ + public com.google.cloud.accessapproval.v1.AccessLocations getRequestedLocations() { + return requestedLocations_ == null + ? com.google.cloud.accessapproval.v1.AccessLocations.getDefaultInstance() + : requestedLocations_; + } + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder + getRequestedLocationsOrBuilder() { + return getRequestedLocations(); + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp requestTime_; + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return requestTime_ != null; + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return getRequestTime(); + } + + public static final int REQUESTED_EXPIRATION_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp requestedExpiration_; + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return Whether the requestedExpiration field is set. + */ + public boolean hasRequestedExpiration() { + return requestedExpiration_ != null; + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return The requestedExpiration. + */ + public com.google.protobuf.Timestamp getRequestedExpiration() { + return requestedExpiration_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpiration_; + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationOrBuilder() { + return getRequestedExpiration(); + } + + public static final int APPROVE_FIELD_NUMBER = 7; + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return Whether the approve field is set. + */ + public boolean hasApprove() { + return decisionCase_ == 7; + } + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return The approve. + */ + public com.google.cloud.accessapproval.v1.ApproveDecision getApprove() { + if (decisionCase_ == 7) { + return (com.google.cloud.accessapproval.v1.ApproveDecision) decision_; + } + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder getApproveOrBuilder() { + if (decisionCase_ == 7) { + return (com.google.cloud.accessapproval.v1.ApproveDecision) decision_; + } + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + + public static final int DISMISS_FIELD_NUMBER = 8; + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return Whether the dismiss field is set. + */ + public boolean hasDismiss() { + return decisionCase_ == 8; + } + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return The dismiss. + */ + public com.google.cloud.accessapproval.v1.DismissDecision getDismiss() { + if (decisionCase_ == 8) { + return (com.google.cloud.accessapproval.v1.DismissDecision) decision_; + } + return com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder getDismissOrBuilder() { + if (decisionCase_ == 8) { + return (com.google.cloud.accessapproval.v1.DismissDecision) decision_; + } + return com.google.cloud.accessapproval.v1.DismissDecision.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getRequestedResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestedResourceName_); + } + if (requestedReason_ != null) { + output.writeMessage(3, getRequestedReason()); + } + if (requestedLocations_ != null) { + output.writeMessage(4, getRequestedLocations()); + } + if (requestTime_ != null) { + output.writeMessage(5, getRequestTime()); + } + if (requestedExpiration_ != null) { + output.writeMessage(6, getRequestedExpiration()); + } + if (decisionCase_ == 7) { + output.writeMessage(7, (com.google.cloud.accessapproval.v1.ApproveDecision) decision_); + } + if (decisionCase_ == 8) { + output.writeMessage(8, (com.google.cloud.accessapproval.v1.DismissDecision) decision_); + } + if (requestedResourceProperties_ != null) { + output.writeMessage(9, getRequestedResourceProperties()); + } + 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 (!getRequestedResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestedResourceName_); + } + if (requestedReason_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestedReason()); + } + if (requestedLocations_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRequestedLocations()); + } + if (requestTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRequestTime()); + } + if (requestedExpiration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRequestedExpiration()); + } + if (decisionCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.accessapproval.v1.ApproveDecision) decision_); + } + if (decisionCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.accessapproval.v1.DismissDecision) decision_); + } + if (requestedResourceProperties_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, getRequestedResourceProperties()); + } + 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.accessapproval.v1.ApprovalRequest)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ApprovalRequest other = + (com.google.cloud.accessapproval.v1.ApprovalRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestedResourceName().equals(other.getRequestedResourceName())) return false; + if (hasRequestedResourceProperties() != other.hasRequestedResourceProperties()) return false; + if (hasRequestedResourceProperties()) { + if (!getRequestedResourceProperties().equals(other.getRequestedResourceProperties())) + return false; + } + if (hasRequestedReason() != other.hasRequestedReason()) return false; + if (hasRequestedReason()) { + if (!getRequestedReason().equals(other.getRequestedReason())) return false; + } + if (hasRequestedLocations() != other.hasRequestedLocations()) return false; + if (hasRequestedLocations()) { + if (!getRequestedLocations().equals(other.getRequestedLocations())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasRequestedExpiration() != other.hasRequestedExpiration()) return false; + if (hasRequestedExpiration()) { + if (!getRequestedExpiration().equals(other.getRequestedExpiration())) return false; + } + if (!getDecisionCase().equals(other.getDecisionCase())) return false; + switch (decisionCase_) { + case 7: + if (!getApprove().equals(other.getApprove())) return false; + break; + case 8: + if (!getDismiss().equals(other.getDismiss())) 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) + REQUESTED_RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRequestedResourceName().hashCode(); + if (hasRequestedResourceProperties()) { + hash = (37 * hash) + REQUESTED_RESOURCE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getRequestedResourceProperties().hashCode(); + } + if (hasRequestedReason()) { + hash = (37 * hash) + REQUESTED_REASON_FIELD_NUMBER; + hash = (53 * hash) + getRequestedReason().hashCode(); + } + if (hasRequestedLocations()) { + hash = (37 * hash) + REQUESTED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getRequestedLocations().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasRequestedExpiration()) { + hash = (37 * hash) + REQUESTED_EXPIRATION_FIELD_NUMBER; + hash = (53 * hash) + getRequestedExpiration().hashCode(); + } + switch (decisionCase_) { + case 7: + hash = (37 * hash) + APPROVE_FIELD_NUMBER; + hash = (53 * hash) + getApprove().hashCode(); + break; + case 8: + hash = (37 * hash) + DISMISS_FIELD_NUMBER; + hash = (53 * hash) + getDismiss().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest 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.accessapproval.v1.ApprovalRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest 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.accessapproval.v1.ApprovalRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest 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.accessapproval.v1.ApprovalRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest 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.accessapproval.v1.ApprovalRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest 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.accessapproval.v1.ApprovalRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A request for the customer to approve access to a resource.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApprovalRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ApprovalRequest) + com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApprovalRequest.class, + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ApprovalRequest.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_ = ""; + + requestedResourceName_ = ""; + + if (requestedResourcePropertiesBuilder_ == null) { + requestedResourceProperties_ = null; + } else { + requestedResourceProperties_ = null; + requestedResourcePropertiesBuilder_ = null; + } + if (requestedReasonBuilder_ == null) { + requestedReason_ = null; + } else { + requestedReason_ = null; + requestedReasonBuilder_ = null; + } + if (requestedLocationsBuilder_ == null) { + requestedLocations_ = null; + } else { + requestedLocations_ = null; + requestedLocationsBuilder_ = null; + } + if (requestTimeBuilder_ == null) { + requestTime_ = null; + } else { + requestTime_ = null; + requestTimeBuilder_ = null; + } + if (requestedExpirationBuilder_ == null) { + requestedExpiration_ = null; + } else { + requestedExpiration_ = null; + requestedExpirationBuilder_ = null; + } + decisionCase_ = 0; + decision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApprovalRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApprovalRequest getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ApprovalRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApprovalRequest build() { + com.google.cloud.accessapproval.v1.ApprovalRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApprovalRequest buildPartial() { + com.google.cloud.accessapproval.v1.ApprovalRequest result = + new com.google.cloud.accessapproval.v1.ApprovalRequest(this); + result.name_ = name_; + result.requestedResourceName_ = requestedResourceName_; + if (requestedResourcePropertiesBuilder_ == null) { + result.requestedResourceProperties_ = requestedResourceProperties_; + } else { + result.requestedResourceProperties_ = requestedResourcePropertiesBuilder_.build(); + } + if (requestedReasonBuilder_ == null) { + result.requestedReason_ = requestedReason_; + } else { + result.requestedReason_ = requestedReasonBuilder_.build(); + } + if (requestedLocationsBuilder_ == null) { + result.requestedLocations_ = requestedLocations_; + } else { + result.requestedLocations_ = requestedLocationsBuilder_.build(); + } + if (requestTimeBuilder_ == null) { + result.requestTime_ = requestTime_; + } else { + result.requestTime_ = requestTimeBuilder_.build(); + } + if (requestedExpirationBuilder_ == null) { + result.requestedExpiration_ = requestedExpiration_; + } else { + result.requestedExpiration_ = requestedExpirationBuilder_.build(); + } + if (decisionCase_ == 7) { + if (approveBuilder_ == null) { + result.decision_ = decision_; + } else { + result.decision_ = approveBuilder_.build(); + } + } + if (decisionCase_ == 8) { + if (dismissBuilder_ == null) { + result.decision_ = decision_; + } else { + result.decision_ = dismissBuilder_.build(); + } + } + result.decisionCase_ = decisionCase_; + 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.accessapproval.v1.ApprovalRequest) { + return mergeFrom((com.google.cloud.accessapproval.v1.ApprovalRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.ApprovalRequest other) { + if (other == com.google.cloud.accessapproval.v1.ApprovalRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestedResourceName().isEmpty()) { + requestedResourceName_ = other.requestedResourceName_; + onChanged(); + } + if (other.hasRequestedResourceProperties()) { + mergeRequestedResourceProperties(other.getRequestedResourceProperties()); + } + if (other.hasRequestedReason()) { + mergeRequestedReason(other.getRequestedReason()); + } + if (other.hasRequestedLocations()) { + mergeRequestedLocations(other.getRequestedLocations()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasRequestedExpiration()) { + mergeRequestedExpiration(other.getRequestedExpiration()); + } + switch (other.getDecisionCase()) { + case APPROVE: + { + mergeApprove(other.getApprove()); + break; + } + case DISMISS: + { + mergeDismiss(other.getDismiss()); + break; + } + case DECISION_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.accessapproval.v1.ApprovalRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ApprovalRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int decisionCase_ = 0; + private java.lang.Object decision_; + + public DecisionCase getDecisionCase() { + return DecisionCase.forNumber(decisionCase_); + } + + public Builder clearDecision() { + decisionCase_ = 0; + decision_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the request. Format is
+     * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the request. Format is
+     * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the request. Format is
+     * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the request. Format is
+     * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the request. Format is
+     * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestedResourceName_ = ""; + /** + * + * + *
+     * The resource for which approval is being requested. The format of the
+     * resource name is defined at
+     * https://cloud.google.com/apis/design/resource_names. The resource name here
+     * may either be a "full" resource name (e.g.
+     * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+     * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+     * resource name specification.
+     * 
+ * + * string requested_resource_name = 2; + * + * @return The requestedResourceName. + */ + public java.lang.String getRequestedResourceName() { + java.lang.Object ref = requestedResourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestedResourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource for which approval is being requested. The format of the
+     * resource name is defined at
+     * https://cloud.google.com/apis/design/resource_names. The resource name here
+     * may either be a "full" resource name (e.g.
+     * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+     * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+     * resource name specification.
+     * 
+ * + * string requested_resource_name = 2; + * + * @return The bytes for requestedResourceName. + */ + public com.google.protobuf.ByteString getRequestedResourceNameBytes() { + java.lang.Object ref = requestedResourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestedResourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource for which approval is being requested. The format of the
+     * resource name is defined at
+     * https://cloud.google.com/apis/design/resource_names. The resource name here
+     * may either be a "full" resource name (e.g.
+     * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+     * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+     * resource name specification.
+     * 
+ * + * string requested_resource_name = 2; + * + * @param value The requestedResourceName to set. + * @return This builder for chaining. + */ + public Builder setRequestedResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestedResourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource for which approval is being requested. The format of the
+     * resource name is defined at
+     * https://cloud.google.com/apis/design/resource_names. The resource name here
+     * may either be a "full" resource name (e.g.
+     * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+     * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+     * resource name specification.
+     * 
+ * + * string requested_resource_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestedResourceName() { + + requestedResourceName_ = getDefaultInstance().getRequestedResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource for which approval is being requested. The format of the
+     * resource name is defined at
+     * https://cloud.google.com/apis/design/resource_names. The resource name here
+     * may either be a "full" resource name (e.g.
+     * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+     * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+     * resource name specification.
+     * 
+ * + * string requested_resource_name = 2; + * + * @param value The bytes for requestedResourceName to set. + * @return This builder for chaining. + */ + public Builder setRequestedResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestedResourceName_ = value; + onChanged(); + return this; + } + + private com.google.cloud.accessapproval.v1.ResourceProperties requestedResourceProperties_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ResourceProperties, + com.google.cloud.accessapproval.v1.ResourceProperties.Builder, + com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder> + requestedResourcePropertiesBuilder_; + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return Whether the requestedResourceProperties field is set. + */ + public boolean hasRequestedResourceProperties() { + return requestedResourcePropertiesBuilder_ != null || requestedResourceProperties_ != null; + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return The requestedResourceProperties. + */ + public com.google.cloud.accessapproval.v1.ResourceProperties getRequestedResourceProperties() { + if (requestedResourcePropertiesBuilder_ == null) { + return requestedResourceProperties_ == null + ? com.google.cloud.accessapproval.v1.ResourceProperties.getDefaultInstance() + : requestedResourceProperties_; + } else { + return requestedResourcePropertiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public Builder setRequestedResourceProperties( + com.google.cloud.accessapproval.v1.ResourceProperties value) { + if (requestedResourcePropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedResourceProperties_ = value; + onChanged(); + } else { + requestedResourcePropertiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public Builder setRequestedResourceProperties( + com.google.cloud.accessapproval.v1.ResourceProperties.Builder builderForValue) { + if (requestedResourcePropertiesBuilder_ == null) { + requestedResourceProperties_ = builderForValue.build(); + onChanged(); + } else { + requestedResourcePropertiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public Builder mergeRequestedResourceProperties( + com.google.cloud.accessapproval.v1.ResourceProperties value) { + if (requestedResourcePropertiesBuilder_ == null) { + if (requestedResourceProperties_ != null) { + requestedResourceProperties_ = + com.google.cloud.accessapproval.v1.ResourceProperties.newBuilder( + requestedResourceProperties_) + .mergeFrom(value) + .buildPartial(); + } else { + requestedResourceProperties_ = value; + } + onChanged(); + } else { + requestedResourcePropertiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public Builder clearRequestedResourceProperties() { + if (requestedResourcePropertiesBuilder_ == null) { + requestedResourceProperties_ = null; + onChanged(); + } else { + requestedResourceProperties_ = null; + requestedResourcePropertiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public com.google.cloud.accessapproval.v1.ResourceProperties.Builder + getRequestedResourcePropertiesBuilder() { + + onChanged(); + return getRequestedResourcePropertiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + public com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder + getRequestedResourcePropertiesOrBuilder() { + if (requestedResourcePropertiesBuilder_ != null) { + return requestedResourcePropertiesBuilder_.getMessageOrBuilder(); + } else { + return requestedResourceProperties_ == null + ? com.google.cloud.accessapproval.v1.ResourceProperties.getDefaultInstance() + : requestedResourceProperties_; + } + } + /** + * + * + *
+     * Properties related to the resource represented by requested_resource_name.
+     * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ResourceProperties, + com.google.cloud.accessapproval.v1.ResourceProperties.Builder, + com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder> + getRequestedResourcePropertiesFieldBuilder() { + if (requestedResourcePropertiesBuilder_ == null) { + requestedResourcePropertiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ResourceProperties, + com.google.cloud.accessapproval.v1.ResourceProperties.Builder, + com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder>( + getRequestedResourceProperties(), getParentForChildren(), isClean()); + requestedResourceProperties_ = null; + } + return requestedResourcePropertiesBuilder_; + } + + private com.google.cloud.accessapproval.v1.AccessReason requestedReason_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessReason, + com.google.cloud.accessapproval.v1.AccessReason.Builder, + com.google.cloud.accessapproval.v1.AccessReasonOrBuilder> + requestedReasonBuilder_; + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + public boolean hasRequestedReason() { + return requestedReasonBuilder_ != null || requestedReason_ != null; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + public com.google.cloud.accessapproval.v1.AccessReason getRequestedReason() { + if (requestedReasonBuilder_ == null) { + return requestedReason_ == null + ? com.google.cloud.accessapproval.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } else { + return requestedReasonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason(com.google.cloud.accessapproval.v1.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedReason_ = value; + onChanged(); + } else { + requestedReasonBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason( + com.google.cloud.accessapproval.v1.AccessReason.Builder builderForValue) { + if (requestedReasonBuilder_ == null) { + requestedReason_ = builderForValue.build(); + onChanged(); + } else { + requestedReasonBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public Builder mergeRequestedReason(com.google.cloud.accessapproval.v1.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (requestedReason_ != null) { + requestedReason_ = + com.google.cloud.accessapproval.v1.AccessReason.newBuilder(requestedReason_) + .mergeFrom(value) + .buildPartial(); + } else { + requestedReason_ = value; + } + onChanged(); + } else { + requestedReasonBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public Builder clearRequestedReason() { + if (requestedReasonBuilder_ == null) { + requestedReason_ = null; + onChanged(); + } else { + requestedReason_ = null; + requestedReasonBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public com.google.cloud.accessapproval.v1.AccessReason.Builder getRequestedReasonBuilder() { + + onChanged(); + return getRequestedReasonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + public com.google.cloud.accessapproval.v1.AccessReasonOrBuilder getRequestedReasonOrBuilder() { + if (requestedReasonBuilder_ != null) { + return requestedReasonBuilder_.getMessageOrBuilder(); + } else { + return requestedReason_ == null + ? com.google.cloud.accessapproval.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessReason, + com.google.cloud.accessapproval.v1.AccessReason.Builder, + com.google.cloud.accessapproval.v1.AccessReasonOrBuilder> + getRequestedReasonFieldBuilder() { + if (requestedReasonBuilder_ == null) { + requestedReasonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessReason, + com.google.cloud.accessapproval.v1.AccessReason.Builder, + com.google.cloud.accessapproval.v1.AccessReasonOrBuilder>( + getRequestedReason(), getParentForChildren(), isClean()); + requestedReason_ = null; + } + return requestedReasonBuilder_; + } + + private com.google.cloud.accessapproval.v1.AccessLocations requestedLocations_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessLocations, + com.google.cloud.accessapproval.v1.AccessLocations.Builder, + com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder> + requestedLocationsBuilder_; + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return Whether the requestedLocations field is set. + */ + public boolean hasRequestedLocations() { + return requestedLocationsBuilder_ != null || requestedLocations_ != null; + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return The requestedLocations. + */ + public com.google.cloud.accessapproval.v1.AccessLocations getRequestedLocations() { + if (requestedLocationsBuilder_ == null) { + return requestedLocations_ == null + ? com.google.cloud.accessapproval.v1.AccessLocations.getDefaultInstance() + : requestedLocations_; + } else { + return requestedLocationsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public Builder setRequestedLocations(com.google.cloud.accessapproval.v1.AccessLocations value) { + if (requestedLocationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedLocations_ = value; + onChanged(); + } else { + requestedLocationsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public Builder setRequestedLocations( + com.google.cloud.accessapproval.v1.AccessLocations.Builder builderForValue) { + if (requestedLocationsBuilder_ == null) { + requestedLocations_ = builderForValue.build(); + onChanged(); + } else { + requestedLocationsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public Builder mergeRequestedLocations( + com.google.cloud.accessapproval.v1.AccessLocations value) { + if (requestedLocationsBuilder_ == null) { + if (requestedLocations_ != null) { + requestedLocations_ = + com.google.cloud.accessapproval.v1.AccessLocations.newBuilder(requestedLocations_) + .mergeFrom(value) + .buildPartial(); + } else { + requestedLocations_ = value; + } + onChanged(); + } else { + requestedLocationsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public Builder clearRequestedLocations() { + if (requestedLocationsBuilder_ == null) { + requestedLocations_ = null; + onChanged(); + } else { + requestedLocations_ = null; + requestedLocationsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public com.google.cloud.accessapproval.v1.AccessLocations.Builder + getRequestedLocationsBuilder() { + + onChanged(); + return getRequestedLocationsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + public com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder + getRequestedLocationsOrBuilder() { + if (requestedLocationsBuilder_ != null) { + return requestedLocationsBuilder_.getMessageOrBuilder(); + } else { + return requestedLocations_ == null + ? com.google.cloud.accessapproval.v1.AccessLocations.getDefaultInstance() + : requestedLocations_; + } + } + /** + * + * + *
+     * The locations for which approval is being requested.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessLocations, + com.google.cloud.accessapproval.v1.AccessLocations.Builder, + com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder> + getRequestedLocationsFieldBuilder() { + if (requestedLocationsBuilder_ == null) { + requestedLocationsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessLocations, + com.google.cloud.accessapproval.v1.AccessLocations.Builder, + com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder>( + getRequestedLocations(), getParentForChildren(), isClean()); + requestedLocations_ = null; + } + return requestedLocationsBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return requestTimeBuilder_ != null || requestTime_ != null; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + onChanged(); + } else { + requestTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + onChanged(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (requestTime_ != null) { + requestTime_ = + com.google.protobuf.Timestamp.newBuilder(requestTime_) + .mergeFrom(value) + .buildPartial(); + } else { + requestTime_ = value; + } + onChanged(); + } else { + requestTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public Builder clearRequestTime() { + if (requestTimeBuilder_ == null) { + requestTime_ = null; + onChanged(); + } else { + requestTime_ = null; + requestTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + + onChanged(); + return getRequestTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp requestedExpiration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestedExpirationBuilder_; + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return Whether the requestedExpiration field is set. + */ + public boolean hasRequestedExpiration() { + return requestedExpirationBuilder_ != null || requestedExpiration_ != null; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return The requestedExpiration. + */ + public com.google.protobuf.Timestamp getRequestedExpiration() { + if (requestedExpirationBuilder_ == null) { + return requestedExpiration_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpiration_; + } else { + return requestedExpirationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public Builder setRequestedExpiration(com.google.protobuf.Timestamp value) { + if (requestedExpirationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedExpiration_ = value; + onChanged(); + } else { + requestedExpirationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public Builder setRequestedExpiration(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestedExpirationBuilder_ == null) { + requestedExpiration_ = builderForValue.build(); + onChanged(); + } else { + requestedExpirationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public Builder mergeRequestedExpiration(com.google.protobuf.Timestamp value) { + if (requestedExpirationBuilder_ == null) { + if (requestedExpiration_ != null) { + requestedExpiration_ = + com.google.protobuf.Timestamp.newBuilder(requestedExpiration_) + .mergeFrom(value) + .buildPartial(); + } else { + requestedExpiration_ = value; + } + onChanged(); + } else { + requestedExpirationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public Builder clearRequestedExpiration() { + if (requestedExpirationBuilder_ == null) { + requestedExpiration_ = null; + onChanged(); + } else { + requestedExpiration_ = null; + requestedExpirationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public com.google.protobuf.Timestamp.Builder getRequestedExpirationBuilder() { + + onChanged(); + return getRequestedExpirationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationOrBuilder() { + if (requestedExpirationBuilder_ != null) { + return requestedExpirationBuilder_.getMessageOrBuilder(); + } else { + return requestedExpiration_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpiration_; + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestedExpirationFieldBuilder() { + if (requestedExpirationBuilder_ == null) { + requestedExpirationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestedExpiration(), getParentForChildren(), isClean()); + requestedExpiration_ = null; + } + return requestedExpirationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApproveDecision, + com.google.cloud.accessapproval.v1.ApproveDecision.Builder, + com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder> + approveBuilder_; + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return Whether the approve field is set. + */ + public boolean hasApprove() { + return decisionCase_ == 7; + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return The approve. + */ + public com.google.cloud.accessapproval.v1.ApproveDecision getApprove() { + if (approveBuilder_ == null) { + if (decisionCase_ == 7) { + return (com.google.cloud.accessapproval.v1.ApproveDecision) decision_; + } + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } else { + if (decisionCase_ == 7) { + return approveBuilder_.getMessage(); + } + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public Builder setApprove(com.google.cloud.accessapproval.v1.ApproveDecision value) { + if (approveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + decision_ = value; + onChanged(); + } else { + approveBuilder_.setMessage(value); + } + decisionCase_ = 7; + return this; + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public Builder setApprove( + com.google.cloud.accessapproval.v1.ApproveDecision.Builder builderForValue) { + if (approveBuilder_ == null) { + decision_ = builderForValue.build(); + onChanged(); + } else { + approveBuilder_.setMessage(builderForValue.build()); + } + decisionCase_ = 7; + return this; + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public Builder mergeApprove(com.google.cloud.accessapproval.v1.ApproveDecision value) { + if (approveBuilder_ == null) { + if (decisionCase_ == 7 + && decision_ + != com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance()) { + decision_ = + com.google.cloud.accessapproval.v1.ApproveDecision.newBuilder( + (com.google.cloud.accessapproval.v1.ApproveDecision) decision_) + .mergeFrom(value) + .buildPartial(); + } else { + decision_ = value; + } + onChanged(); + } else { + if (decisionCase_ == 7) { + approveBuilder_.mergeFrom(value); + } + approveBuilder_.setMessage(value); + } + decisionCase_ = 7; + return this; + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public Builder clearApprove() { + if (approveBuilder_ == null) { + if (decisionCase_ == 7) { + decisionCase_ = 0; + decision_ = null; + onChanged(); + } + } else { + if (decisionCase_ == 7) { + decisionCase_ = 0; + decision_ = null; + } + approveBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public com.google.cloud.accessapproval.v1.ApproveDecision.Builder getApproveBuilder() { + return getApproveFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + public com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder getApproveOrBuilder() { + if ((decisionCase_ == 7) && (approveBuilder_ != null)) { + return approveBuilder_.getMessageOrBuilder(); + } else { + if (decisionCase_ == 7) { + return (com.google.cloud.accessapproval.v1.ApproveDecision) decision_; + } + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + } + /** + * + * + *
+     * Access was approved.
+     * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApproveDecision, + com.google.cloud.accessapproval.v1.ApproveDecision.Builder, + com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder> + getApproveFieldBuilder() { + if (approveBuilder_ == null) { + if (!(decisionCase_ == 7)) { + decision_ = com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + approveBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApproveDecision, + com.google.cloud.accessapproval.v1.ApproveDecision.Builder, + com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder>( + (com.google.cloud.accessapproval.v1.ApproveDecision) decision_, + getParentForChildren(), + isClean()); + decision_ = null; + } + decisionCase_ = 7; + onChanged(); + ; + return approveBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.DismissDecision, + com.google.cloud.accessapproval.v1.DismissDecision.Builder, + com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder> + dismissBuilder_; + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return Whether the dismiss field is set. + */ + public boolean hasDismiss() { + return decisionCase_ == 8; + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return The dismiss. + */ + public com.google.cloud.accessapproval.v1.DismissDecision getDismiss() { + if (dismissBuilder_ == null) { + if (decisionCase_ == 8) { + return (com.google.cloud.accessapproval.v1.DismissDecision) decision_; + } + return com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } else { + if (decisionCase_ == 8) { + return dismissBuilder_.getMessage(); + } + return com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public Builder setDismiss(com.google.cloud.accessapproval.v1.DismissDecision value) { + if (dismissBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + decision_ = value; + onChanged(); + } else { + dismissBuilder_.setMessage(value); + } + decisionCase_ = 8; + return this; + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public Builder setDismiss( + com.google.cloud.accessapproval.v1.DismissDecision.Builder builderForValue) { + if (dismissBuilder_ == null) { + decision_ = builderForValue.build(); + onChanged(); + } else { + dismissBuilder_.setMessage(builderForValue.build()); + } + decisionCase_ = 8; + return this; + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public Builder mergeDismiss(com.google.cloud.accessapproval.v1.DismissDecision value) { + if (dismissBuilder_ == null) { + if (decisionCase_ == 8 + && decision_ + != com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance()) { + decision_ = + com.google.cloud.accessapproval.v1.DismissDecision.newBuilder( + (com.google.cloud.accessapproval.v1.DismissDecision) decision_) + .mergeFrom(value) + .buildPartial(); + } else { + decision_ = value; + } + onChanged(); + } else { + if (decisionCase_ == 8) { + dismissBuilder_.mergeFrom(value); + } + dismissBuilder_.setMessage(value); + } + decisionCase_ = 8; + return this; + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public Builder clearDismiss() { + if (dismissBuilder_ == null) { + if (decisionCase_ == 8) { + decisionCase_ = 0; + decision_ = null; + onChanged(); + } + } else { + if (decisionCase_ == 8) { + decisionCase_ = 0; + decision_ = null; + } + dismissBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public com.google.cloud.accessapproval.v1.DismissDecision.Builder getDismissBuilder() { + return getDismissFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + public com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder getDismissOrBuilder() { + if ((decisionCase_ == 8) && (dismissBuilder_ != null)) { + return dismissBuilder_.getMessageOrBuilder(); + } else { + if (decisionCase_ == 8) { + return (com.google.cloud.accessapproval.v1.DismissDecision) decision_; + } + return com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } + } + /** + * + * + *
+     * The request was dismissed.
+     * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.DismissDecision, + com.google.cloud.accessapproval.v1.DismissDecision.Builder, + com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder> + getDismissFieldBuilder() { + if (dismissBuilder_ == null) { + if (!(decisionCase_ == 8)) { + decision_ = com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } + dismissBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.DismissDecision, + com.google.cloud.accessapproval.v1.DismissDecision.Builder, + com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder>( + (com.google.cloud.accessapproval.v1.DismissDecision) decision_, + getParentForChildren(), + isClean()); + decision_ = null; + } + decisionCase_ = 8; + onChanged(); + ; + return dismissBuilder_; + } + + @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.accessapproval.v1.ApprovalRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ApprovalRequest) + private static final com.google.cloud.accessapproval.v1.ApprovalRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ApprovalRequest(); + } + + public static com.google.cloud.accessapproval.v1.ApprovalRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApprovalRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApprovalRequest(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.accessapproval.v1.ApprovalRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequestOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequestOrBuilder.java new file mode 100644 index 00000000..74b1f3bd --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApprovalRequestOrBuilder.java @@ -0,0 +1,343 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ApprovalRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ApprovalRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the request. Format is
+   * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the request. Format is
+   * "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The resource for which approval is being requested. The format of the
+   * resource name is defined at
+   * https://cloud.google.com/apis/design/resource_names. The resource name here
+   * may either be a "full" resource name (e.g.
+   * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+   * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+   * resource name specification.
+   * 
+ * + * string requested_resource_name = 2; + * + * @return The requestedResourceName. + */ + java.lang.String getRequestedResourceName(); + /** + * + * + *
+   * The resource for which approval is being requested. The format of the
+   * resource name is defined at
+   * https://cloud.google.com/apis/design/resource_names. The resource name here
+   * may either be a "full" resource name (e.g.
+   * "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
+   * resource name (e.g. "shelves/shelf1/books/book2") as described in the
+   * resource name specification.
+   * 
+ * + * string requested_resource_name = 2; + * + * @return The bytes for requestedResourceName. + */ + com.google.protobuf.ByteString getRequestedResourceNameBytes(); + + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return Whether the requestedResourceProperties field is set. + */ + boolean hasRequestedResourceProperties(); + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + * + * @return The requestedResourceProperties. + */ + com.google.cloud.accessapproval.v1.ResourceProperties getRequestedResourceProperties(); + /** + * + * + *
+   * Properties related to the resource represented by requested_resource_name.
+   * 
+ * + * .google.cloud.accessapproval.v1.ResourceProperties requested_resource_properties = 9; + * + */ + com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder + getRequestedResourcePropertiesOrBuilder(); + + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + boolean hasRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + com.google.cloud.accessapproval.v1.AccessReason getRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessReason requested_reason = 3; + */ + com.google.cloud.accessapproval.v1.AccessReasonOrBuilder getRequestedReasonOrBuilder(); + + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return Whether the requestedLocations field is set. + */ + boolean hasRequestedLocations(); + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + * + * @return The requestedLocations. + */ + com.google.cloud.accessapproval.v1.AccessLocations getRequestedLocations(); + /** + * + * + *
+   * The locations for which approval is being requested.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessLocations requested_locations = 4; + */ + com.google.cloud.accessapproval.v1.AccessLocationsOrBuilder getRequestedLocationsOrBuilder(); + + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return Whether the requestedExpiration field is set. + */ + boolean hasRequestedExpiration(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + * + * @return The requestedExpiration. + */ + com.google.protobuf.Timestamp getRequestedExpiration(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration = 6; + */ + com.google.protobuf.TimestampOrBuilder getRequestedExpirationOrBuilder(); + + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return Whether the approve field is set. + */ + boolean hasApprove(); + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + * + * @return The approve. + */ + com.google.cloud.accessapproval.v1.ApproveDecision getApprove(); + /** + * + * + *
+   * Access was approved.
+   * 
+ * + * .google.cloud.accessapproval.v1.ApproveDecision approve = 7; + */ + com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder getApproveOrBuilder(); + + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return Whether the dismiss field is set. + */ + boolean hasDismiss(); + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + * + * @return The dismiss. + */ + com.google.cloud.accessapproval.v1.DismissDecision getDismiss(); + /** + * + * + *
+   * The request was dismissed.
+   * 
+ * + * .google.cloud.accessapproval.v1.DismissDecision dismiss = 8; + */ + com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder getDismissOrBuilder(); + + public com.google.cloud.accessapproval.v1.ApprovalRequest.DecisionCase getDecisionCase(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessage.java new file mode 100644 index 00000000..7ef58aa1 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessage.java @@ -0,0 +1,911 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to approve an ApprovalRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApproveApprovalRequestMessage} + */ +public final class ApproveApprovalRequestMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) + ApproveApprovalRequestMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApproveApprovalRequestMessage.newBuilder() to construct. + private ApproveApprovalRequestMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApproveApprovalRequestMessage() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApproveApprovalRequestMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ApproveApprovalRequestMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the approval request to approve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the approval request to approve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + 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 (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + 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 (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + 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.accessapproval.v1.ApproveApprovalRequestMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage other = + (com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage 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.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage 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.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage 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.accessapproval.v1.ApproveApprovalRequestMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage 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.accessapproval.v1.ApproveApprovalRequestMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage 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.accessapproval.v1.ApproveApprovalRequestMessage 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 to approve an ApprovalRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApproveApprovalRequestMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveApprovalRequestMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage build() { + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage buildPartial() { + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage result = + new com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage(this); + result.name_ = name_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.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.accessapproval.v1.ApproveApprovalRequestMessage) { + return mergeFrom((com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage other) { + if (other + == com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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.accessapproval.v1.ApproveApprovalRequestMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the approval request to approve.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the approval request to approve.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the approval request to approve.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the approval request to approve.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the approval request to approve.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * The expiration time of this approval.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @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.accessapproval.v1.ApproveApprovalRequestMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) + private static final com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage(); + } + + public static com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApproveApprovalRequestMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApproveApprovalRequestMessage(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.accessapproval.v1.ApproveApprovalRequestMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessageOrBuilder.java new file mode 100644 index 00000000..a3c5c2dc --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveApprovalRequestMessageOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ApproveApprovalRequestMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ApproveApprovalRequestMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the approval request to approve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the approval request to approve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The expiration time of this approval.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecision.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecision.java new file mode 100644 index 00000000..47335723 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecision.java @@ -0,0 +1,996 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * A decision that has been made to approve access to a resource.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApproveDecision} + */ +public final class ApproveDecision extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ApproveDecision) + ApproveDecisionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApproveDecision.newBuilder() to construct. + private ApproveDecision(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApproveDecision() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApproveDecision(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ApproveDecision( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (approveTime_ != null) { + subBuilder = approveTime_.toBuilder(); + } + approveTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(approveTime_); + approveTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveDecision_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApproveDecision.class, + com.google.cloud.accessapproval.v1.ApproveDecision.Builder.class); + } + + public static final int APPROVE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp approveTime_; + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return Whether the approveTime field is set. + */ + public boolean hasApproveTime() { + return approveTime_ != null; + } + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return The approveTime. + */ + public com.google.protobuf.Timestamp getApproveTime() { + return approveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : approveTime_; + } + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getApproveTimeOrBuilder() { + return getApproveTime(); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + 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 (approveTime_ != null) { + output.writeMessage(1, getApproveTime()); + } + if (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (approveTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getApproveTime()); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + 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.accessapproval.v1.ApproveDecision)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ApproveDecision other = + (com.google.cloud.accessapproval.v1.ApproveDecision) obj; + + if (hasApproveTime() != other.hasApproveTime()) return false; + if (hasApproveTime()) { + if (!getApproveTime().equals(other.getApproveTime())) return false; + } + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) 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 (hasApproveTime()) { + hash = (37 * hash) + APPROVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getApproveTime().hashCode(); + } + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision 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.accessapproval.v1.ApproveDecision parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision 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.accessapproval.v1.ApproveDecision parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision 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.accessapproval.v1.ApproveDecision parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision 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.accessapproval.v1.ApproveDecision parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision 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.accessapproval.v1.ApproveDecision 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 decision that has been made to approve access to a resource.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ApproveDecision} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ApproveDecision) + com.google.cloud.accessapproval.v1.ApproveDecisionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveDecision_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ApproveDecision.class, + com.google.cloud.accessapproval.v1.ApproveDecision.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ApproveDecision.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 (approveTimeBuilder_ == null) { + approveTime_ = null; + } else { + approveTime_ = null; + approveTimeBuilder_ = null; + } + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ApproveDecision_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveDecision getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveDecision build() { + com.google.cloud.accessapproval.v1.ApproveDecision result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ApproveDecision buildPartial() { + com.google.cloud.accessapproval.v1.ApproveDecision result = + new com.google.cloud.accessapproval.v1.ApproveDecision(this); + if (approveTimeBuilder_ == null) { + result.approveTime_ = approveTime_; + } else { + result.approveTime_ = approveTimeBuilder_.build(); + } + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.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.accessapproval.v1.ApproveDecision) { + return mergeFrom((com.google.cloud.accessapproval.v1.ApproveDecision) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.ApproveDecision other) { + if (other == com.google.cloud.accessapproval.v1.ApproveDecision.getDefaultInstance()) + return this; + if (other.hasApproveTime()) { + mergeApproveTime(other.getApproveTime()); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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.accessapproval.v1.ApproveDecision parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ApproveDecision) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp approveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + approveTimeBuilder_; + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return Whether the approveTime field is set. + */ + public boolean hasApproveTime() { + return approveTimeBuilder_ != null || approveTime_ != null; + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return The approveTime. + */ + public com.google.protobuf.Timestamp getApproveTime() { + if (approveTimeBuilder_ == null) { + return approveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : approveTime_; + } else { + return approveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public Builder setApproveTime(com.google.protobuf.Timestamp value) { + if (approveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + approveTime_ = value; + onChanged(); + } else { + approveTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public Builder setApproveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (approveTimeBuilder_ == null) { + approveTime_ = builderForValue.build(); + onChanged(); + } else { + approveTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public Builder mergeApproveTime(com.google.protobuf.Timestamp value) { + if (approveTimeBuilder_ == null) { + if (approveTime_ != null) { + approveTime_ = + com.google.protobuf.Timestamp.newBuilder(approveTime_) + .mergeFrom(value) + .buildPartial(); + } else { + approveTime_ = value; + } + onChanged(); + } else { + approveTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public Builder clearApproveTime() { + if (approveTimeBuilder_ == null) { + approveTime_ = null; + onChanged(); + } else { + approveTime_ = null; + approveTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getApproveTimeBuilder() { + + onChanged(); + return getApproveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getApproveTimeOrBuilder() { + if (approveTimeBuilder_ != null) { + return approveTimeBuilder_.getMessageOrBuilder(); + } else { + return approveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : approveTime_; + } + } + /** + * + * + *
+     * The time at which approval was granted.
+     * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getApproveTimeFieldBuilder() { + if (approveTimeBuilder_ == null) { + approveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getApproveTime(), getParentForChildren(), isClean()); + approveTime_ = null; + } + return approveTimeBuilder_; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * The time at which the approval expires.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @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.accessapproval.v1.ApproveDecision) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ApproveDecision) + private static final com.google.cloud.accessapproval.v1.ApproveDecision DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ApproveDecision(); + } + + public static com.google.cloud.accessapproval.v1.ApproveDecision getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApproveDecision parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApproveDecision(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.accessapproval.v1.ApproveDecision getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecisionOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecisionOrBuilder.java new file mode 100644 index 00000000..ec56e1a4 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ApproveDecisionOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ApproveDecisionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ApproveDecision) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return Whether the approveTime field is set. + */ + boolean hasApproveTime(); + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + * + * @return The approveTime. + */ + com.google.protobuf.Timestamp getApproveTime(); + /** + * + * + *
+   * The time at which approval was granted.
+   * 
+ * + * .google.protobuf.Timestamp approve_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getApproveTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The time at which the approval expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessage.java new file mode 100644 index 00000000..ba453500 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessage.java @@ -0,0 +1,649 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to delete access approval settings.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage} + */ +public final class DeleteAccessApprovalSettingsMessage + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + DeleteAccessApprovalSettingsMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAccessApprovalSettingsMessage.newBuilder() to construct. + private DeleteAccessApprovalSettingsMessage( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAccessApprovalSettingsMessage() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAccessApprovalSettingsMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAccessApprovalSettingsMessage( + 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the AccessApprovalSettings to delete.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the AccessApprovalSettings to delete.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage other = + (com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage 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.accessapproval.v1.DeleteAccessApprovalSettingsMessage 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 to delete access approval settings.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.Builder.class); + } + + // Construct using + // com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage.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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DeleteAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage build() { + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage buildPartial() { + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage result = + new com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage(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.accessapproval.v1.DeleteAccessApprovalSettingsMessage) { + return mergeFrom( + (com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage other) { + if (other + == com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + .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.accessapproval.v1.DeleteAccessApprovalSettingsMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the AccessApprovalSettings to delete.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to delete.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to delete.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to delete.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to delete.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @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.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + private static final com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage(); + } + + public static com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAccessApprovalSettingsMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAccessApprovalSettingsMessage(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.accessapproval.v1.DeleteAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessageOrBuilder.java new file mode 100644 index 00000000..046b86f7 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessageOrBuilder.java @@ -0,0 +1,50 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface DeleteAccessApprovalSettingsMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the AccessApprovalSettings to delete.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the AccessApprovalSettings to delete.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessage.java new file mode 100644 index 00000000..b24b2499 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessage.java @@ -0,0 +1,642 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to dismiss an approval request.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DismissApprovalRequestMessage} + */ +public final class DismissApprovalRequestMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.DismissApprovalRequestMessage) + DismissApprovalRequestMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use DismissApprovalRequestMessage.newBuilder() to construct. + private DismissApprovalRequestMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DismissApprovalRequestMessage() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DismissApprovalRequestMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DismissApprovalRequestMessage( + 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the ApprovalRequest to dismiss.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the ApprovalRequest to dismiss.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.accessapproval.v1.DismissApprovalRequestMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage other = + (com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage) 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.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage 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.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage 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.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage 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.accessapproval.v1.DismissApprovalRequestMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage 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.accessapproval.v1.DismissApprovalRequestMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage 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.accessapproval.v1.DismissApprovalRequestMessage 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 to dismiss an approval request.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DismissApprovalRequestMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.DismissApprovalRequestMessage) + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissApprovalRequestMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage build() { + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage buildPartial() { + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage result = + new com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage(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.accessapproval.v1.DismissApprovalRequestMessage) { + return mergeFrom((com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage other) { + if (other + == com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage.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.accessapproval.v1.DismissApprovalRequestMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the ApprovalRequest to dismiss.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the ApprovalRequest to dismiss.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the ApprovalRequest to dismiss.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the ApprovalRequest to dismiss.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the ApprovalRequest to dismiss.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @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.accessapproval.v1.DismissApprovalRequestMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.DismissApprovalRequestMessage) + private static final com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage(); + } + + public static com.google.cloud.accessapproval.v1.DismissApprovalRequestMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DismissApprovalRequestMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DismissApprovalRequestMessage(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.accessapproval.v1.DismissApprovalRequestMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessageOrBuilder.java new file mode 100644 index 00000000..2cde88a6 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissApprovalRequestMessageOrBuilder.java @@ -0,0 +1,50 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface DismissApprovalRequestMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.DismissApprovalRequestMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the ApprovalRequest to dismiss.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the ApprovalRequest to dismiss.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecision.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecision.java new file mode 100644 index 00000000..ea193758 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecision.java @@ -0,0 +1,727 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * A decision that has been made to dismiss an approval request.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DismissDecision} + */ +public final class DismissDecision extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.DismissDecision) + DismissDecisionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DismissDecision.newBuilder() to construct. + private DismissDecision(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DismissDecision() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DismissDecision(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DismissDecision( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (dismissTime_ != null) { + subBuilder = dismissTime_.toBuilder(); + } + dismissTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dismissTime_); + dismissTime_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissDecision_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DismissDecision.class, + com.google.cloud.accessapproval.v1.DismissDecision.Builder.class); + } + + public static final int DISMISS_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp dismissTime_; + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return Whether the dismissTime field is set. + */ + public boolean hasDismissTime() { + return dismissTime_ != null; + } + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return The dismissTime. + */ + public com.google.protobuf.Timestamp getDismissTime() { + return dismissTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : dismissTime_; + } + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getDismissTimeOrBuilder() { + return getDismissTime(); + } + + 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 (dismissTime_ != null) { + output.writeMessage(1, getDismissTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dismissTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDismissTime()); + } + 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.accessapproval.v1.DismissDecision)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.DismissDecision other = + (com.google.cloud.accessapproval.v1.DismissDecision) obj; + + if (hasDismissTime() != other.hasDismissTime()) return false; + if (hasDismissTime()) { + if (!getDismissTime().equals(other.getDismissTime())) 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 (hasDismissTime()) { + hash = (37 * hash) + DISMISS_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDismissTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.DismissDecision parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision 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.accessapproval.v1.DismissDecision parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision 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.accessapproval.v1.DismissDecision parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision 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.accessapproval.v1.DismissDecision parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision 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.accessapproval.v1.DismissDecision parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision 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.accessapproval.v1.DismissDecision 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 decision that has been made to dismiss an approval request.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.DismissDecision} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.DismissDecision) + com.google.cloud.accessapproval.v1.DismissDecisionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissDecision_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.DismissDecision.class, + com.google.cloud.accessapproval.v1.DismissDecision.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.DismissDecision.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 (dismissTimeBuilder_ == null) { + dismissTime_ = null; + } else { + dismissTime_ = null; + dismissTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_DismissDecision_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissDecision getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissDecision build() { + com.google.cloud.accessapproval.v1.DismissDecision result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.DismissDecision buildPartial() { + com.google.cloud.accessapproval.v1.DismissDecision result = + new com.google.cloud.accessapproval.v1.DismissDecision(this); + if (dismissTimeBuilder_ == null) { + result.dismissTime_ = dismissTime_; + } else { + result.dismissTime_ = dismissTimeBuilder_.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.accessapproval.v1.DismissDecision) { + return mergeFrom((com.google.cloud.accessapproval.v1.DismissDecision) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.DismissDecision other) { + if (other == com.google.cloud.accessapproval.v1.DismissDecision.getDefaultInstance()) + return this; + if (other.hasDismissTime()) { + mergeDismissTime(other.getDismissTime()); + } + 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.accessapproval.v1.DismissDecision parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.DismissDecision) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp dismissTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + dismissTimeBuilder_; + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return Whether the dismissTime field is set. + */ + public boolean hasDismissTime() { + return dismissTimeBuilder_ != null || dismissTime_ != null; + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return The dismissTime. + */ + public com.google.protobuf.Timestamp getDismissTime() { + if (dismissTimeBuilder_ == null) { + return dismissTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : dismissTime_; + } else { + return dismissTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public Builder setDismissTime(com.google.protobuf.Timestamp value) { + if (dismissTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dismissTime_ = value; + onChanged(); + } else { + dismissTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public Builder setDismissTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (dismissTimeBuilder_ == null) { + dismissTime_ = builderForValue.build(); + onChanged(); + } else { + dismissTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public Builder mergeDismissTime(com.google.protobuf.Timestamp value) { + if (dismissTimeBuilder_ == null) { + if (dismissTime_ != null) { + dismissTime_ = + com.google.protobuf.Timestamp.newBuilder(dismissTime_) + .mergeFrom(value) + .buildPartial(); + } else { + dismissTime_ = value; + } + onChanged(); + } else { + dismissTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public Builder clearDismissTime() { + if (dismissTimeBuilder_ == null) { + dismissTime_ = null; + onChanged(); + } else { + dismissTime_ = null; + dismissTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getDismissTimeBuilder() { + + onChanged(); + return getDismissTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getDismissTimeOrBuilder() { + if (dismissTimeBuilder_ != null) { + return dismissTimeBuilder_.getMessageOrBuilder(); + } else { + return dismissTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : dismissTime_; + } + } + /** + * + * + *
+     * The time at which the approval request was dismissed.
+     * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDismissTimeFieldBuilder() { + if (dismissTimeBuilder_ == null) { + dismissTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDismissTime(), getParentForChildren(), isClean()); + dismissTime_ = null; + } + return dismissTimeBuilder_; + } + + @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.accessapproval.v1.DismissDecision) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.DismissDecision) + private static final com.google.cloud.accessapproval.v1.DismissDecision DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.DismissDecision(); + } + + public static com.google.cloud.accessapproval.v1.DismissDecision getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DismissDecision parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DismissDecision(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.accessapproval.v1.DismissDecision getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecisionOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecisionOrBuilder.java new file mode 100644 index 00000000..4d86c5ba --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DismissDecisionOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface DismissDecisionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.DismissDecision) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return Whether the dismissTime field is set. + */ + boolean hasDismissTime(); + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + * + * @return The dismissTime. + */ + com.google.protobuf.Timestamp getDismissTime(); + /** + * + * + *
+   * The time at which the approval request was dismissed.
+   * 
+ * + * .google.protobuf.Timestamp dismiss_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getDismissTimeOrBuilder(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledService.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledService.java new file mode 100644 index 00000000..425abaaf --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledService.java @@ -0,0 +1,878 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Represents the enrollment of a cloud resource into a specific service.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.EnrolledService} + */ +public final class EnrolledService extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.EnrolledService) + EnrolledServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnrolledService.newBuilder() to construct. + private EnrolledService(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnrolledService() { + cloudProduct_ = ""; + enrollmentLevel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnrolledService(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnrolledService( + 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(); + + cloudProduct_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + enrollmentLevel_ = 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_EnrolledService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.EnrolledService.class, + com.google.cloud.accessapproval.v1.EnrolledService.Builder.class); + } + + public static final int CLOUD_PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object cloudProduct_; + /** + * + * + *
+   * The product for which Access Approval will be enrolled. Allowed values are
+   * listed below (case-sensitive):
+   * <ol>
+   *   <li>all</li>
+   *   <li>appengine.googleapis.com</li>
+   *   <li>bigquery.googleapis.com</li>
+   *   <li>bigtable.googleapis.com</li>
+   *   <li>cloudkms.googleapis.com</li>
+   *   <li>compute.googleapis.com</li>
+   *   <li>dataflow.googleapis.com</li>
+   *   <li>iam.googleapis.com</li>
+   *   <li>pubsub.googleapis.com</li>
+   *   <li>storage.googleapis.com</li>
+   * <ol>
+   * 
+ * + * string cloud_product = 1; + * + * @return The cloudProduct. + */ + public java.lang.String getCloudProduct() { + java.lang.Object ref = cloudProduct_; + 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(); + cloudProduct_ = s; + return s; + } + } + /** + * + * + *
+   * The product for which Access Approval will be enrolled. Allowed values are
+   * listed below (case-sensitive):
+   * <ol>
+   *   <li>all</li>
+   *   <li>appengine.googleapis.com</li>
+   *   <li>bigquery.googleapis.com</li>
+   *   <li>bigtable.googleapis.com</li>
+   *   <li>cloudkms.googleapis.com</li>
+   *   <li>compute.googleapis.com</li>
+   *   <li>dataflow.googleapis.com</li>
+   *   <li>iam.googleapis.com</li>
+   *   <li>pubsub.googleapis.com</li>
+   *   <li>storage.googleapis.com</li>
+   * <ol>
+   * 
+ * + * string cloud_product = 1; + * + * @return The bytes for cloudProduct. + */ + public com.google.protobuf.ByteString getCloudProductBytes() { + java.lang.Object ref = cloudProduct_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cloudProduct_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENROLLMENT_LEVEL_FIELD_NUMBER = 2; + private int enrollmentLevel_; + /** + * + * + *
+   * The enrollment level of the service.
+   * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enum numeric value on the wire for enrollmentLevel. + */ + public int getEnrollmentLevelValue() { + return enrollmentLevel_; + } + /** + * + * + *
+   * The enrollment level of the service.
+   * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enrollmentLevel. + */ + public com.google.cloud.accessapproval.v1.EnrollmentLevel getEnrollmentLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.accessapproval.v1.EnrollmentLevel result = + com.google.cloud.accessapproval.v1.EnrollmentLevel.valueOf(enrollmentLevel_); + return result == null + ? com.google.cloud.accessapproval.v1.EnrollmentLevel.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 (!getCloudProductBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cloudProduct_); + } + if (enrollmentLevel_ + != com.google.cloud.accessapproval.v1.EnrollmentLevel.ENROLLMENT_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, enrollmentLevel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCloudProductBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cloudProduct_); + } + if (enrollmentLevel_ + != com.google.cloud.accessapproval.v1.EnrollmentLevel.ENROLLMENT_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, enrollmentLevel_); + } + 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.accessapproval.v1.EnrolledService)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.EnrolledService other = + (com.google.cloud.accessapproval.v1.EnrolledService) obj; + + if (!getCloudProduct().equals(other.getCloudProduct())) return false; + if (enrollmentLevel_ != other.enrollmentLevel_) 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) + CLOUD_PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getCloudProduct().hashCode(); + hash = (37 * hash) + ENROLLMENT_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + enrollmentLevel_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.EnrolledService parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService 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.accessapproval.v1.EnrolledService parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService 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.accessapproval.v1.EnrolledService parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService 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.accessapproval.v1.EnrolledService parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService 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.accessapproval.v1.EnrolledService parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService 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.accessapproval.v1.EnrolledService 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 the enrollment of a cloud resource into a specific service.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.EnrolledService} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.EnrolledService) + com.google.cloud.accessapproval.v1.EnrolledServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_EnrolledService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.EnrolledService.class, + com.google.cloud.accessapproval.v1.EnrolledService.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.EnrolledService.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(); + cloudProduct_ = ""; + + enrollmentLevel_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_EnrolledService_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.EnrolledService getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.EnrolledService.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.EnrolledService build() { + com.google.cloud.accessapproval.v1.EnrolledService result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.EnrolledService buildPartial() { + com.google.cloud.accessapproval.v1.EnrolledService result = + new com.google.cloud.accessapproval.v1.EnrolledService(this); + result.cloudProduct_ = cloudProduct_; + result.enrollmentLevel_ = enrollmentLevel_; + 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.accessapproval.v1.EnrolledService) { + return mergeFrom((com.google.cloud.accessapproval.v1.EnrolledService) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.EnrolledService other) { + if (other == com.google.cloud.accessapproval.v1.EnrolledService.getDefaultInstance()) + return this; + if (!other.getCloudProduct().isEmpty()) { + cloudProduct_ = other.cloudProduct_; + onChanged(); + } + if (other.enrollmentLevel_ != 0) { + setEnrollmentLevelValue(other.getEnrollmentLevelValue()); + } + 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.accessapproval.v1.EnrolledService parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.EnrolledService) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cloudProduct_ = ""; + /** + * + * + *
+     * The product for which Access Approval will be enrolled. Allowed values are
+     * listed below (case-sensitive):
+     * <ol>
+     *   <li>all</li>
+     *   <li>appengine.googleapis.com</li>
+     *   <li>bigquery.googleapis.com</li>
+     *   <li>bigtable.googleapis.com</li>
+     *   <li>cloudkms.googleapis.com</li>
+     *   <li>compute.googleapis.com</li>
+     *   <li>dataflow.googleapis.com</li>
+     *   <li>iam.googleapis.com</li>
+     *   <li>pubsub.googleapis.com</li>
+     *   <li>storage.googleapis.com</li>
+     * <ol>
+     * 
+ * + * string cloud_product = 1; + * + * @return The cloudProduct. + */ + public java.lang.String getCloudProduct() { + java.lang.Object ref = cloudProduct_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cloudProduct_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The product for which Access Approval will be enrolled. Allowed values are
+     * listed below (case-sensitive):
+     * <ol>
+     *   <li>all</li>
+     *   <li>appengine.googleapis.com</li>
+     *   <li>bigquery.googleapis.com</li>
+     *   <li>bigtable.googleapis.com</li>
+     *   <li>cloudkms.googleapis.com</li>
+     *   <li>compute.googleapis.com</li>
+     *   <li>dataflow.googleapis.com</li>
+     *   <li>iam.googleapis.com</li>
+     *   <li>pubsub.googleapis.com</li>
+     *   <li>storage.googleapis.com</li>
+     * <ol>
+     * 
+ * + * string cloud_product = 1; + * + * @return The bytes for cloudProduct. + */ + public com.google.protobuf.ByteString getCloudProductBytes() { + java.lang.Object ref = cloudProduct_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cloudProduct_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The product for which Access Approval will be enrolled. Allowed values are
+     * listed below (case-sensitive):
+     * <ol>
+     *   <li>all</li>
+     *   <li>appengine.googleapis.com</li>
+     *   <li>bigquery.googleapis.com</li>
+     *   <li>bigtable.googleapis.com</li>
+     *   <li>cloudkms.googleapis.com</li>
+     *   <li>compute.googleapis.com</li>
+     *   <li>dataflow.googleapis.com</li>
+     *   <li>iam.googleapis.com</li>
+     *   <li>pubsub.googleapis.com</li>
+     *   <li>storage.googleapis.com</li>
+     * <ol>
+     * 
+ * + * string cloud_product = 1; + * + * @param value The cloudProduct to set. + * @return This builder for chaining. + */ + public Builder setCloudProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cloudProduct_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The product for which Access Approval will be enrolled. Allowed values are
+     * listed below (case-sensitive):
+     * <ol>
+     *   <li>all</li>
+     *   <li>appengine.googleapis.com</li>
+     *   <li>bigquery.googleapis.com</li>
+     *   <li>bigtable.googleapis.com</li>
+     *   <li>cloudkms.googleapis.com</li>
+     *   <li>compute.googleapis.com</li>
+     *   <li>dataflow.googleapis.com</li>
+     *   <li>iam.googleapis.com</li>
+     *   <li>pubsub.googleapis.com</li>
+     *   <li>storage.googleapis.com</li>
+     * <ol>
+     * 
+ * + * string cloud_product = 1; + * + * @return This builder for chaining. + */ + public Builder clearCloudProduct() { + + cloudProduct_ = getDefaultInstance().getCloudProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * The product for which Access Approval will be enrolled. Allowed values are
+     * listed below (case-sensitive):
+     * <ol>
+     *   <li>all</li>
+     *   <li>appengine.googleapis.com</li>
+     *   <li>bigquery.googleapis.com</li>
+     *   <li>bigtable.googleapis.com</li>
+     *   <li>cloudkms.googleapis.com</li>
+     *   <li>compute.googleapis.com</li>
+     *   <li>dataflow.googleapis.com</li>
+     *   <li>iam.googleapis.com</li>
+     *   <li>pubsub.googleapis.com</li>
+     *   <li>storage.googleapis.com</li>
+     * <ol>
+     * 
+ * + * string cloud_product = 1; + * + * @param value The bytes for cloudProduct to set. + * @return This builder for chaining. + */ + public Builder setCloudProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cloudProduct_ = value; + onChanged(); + return this; + } + + private int enrollmentLevel_ = 0; + /** + * + * + *
+     * The enrollment level of the service.
+     * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enum numeric value on the wire for enrollmentLevel. + */ + public int getEnrollmentLevelValue() { + return enrollmentLevel_; + } + /** + * + * + *
+     * The enrollment level of the service.
+     * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @param value The enum numeric value on the wire for enrollmentLevel to set. + * @return This builder for chaining. + */ + public Builder setEnrollmentLevelValue(int value) { + enrollmentLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The enrollment level of the service.
+     * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enrollmentLevel. + */ + public com.google.cloud.accessapproval.v1.EnrollmentLevel getEnrollmentLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.accessapproval.v1.EnrollmentLevel result = + com.google.cloud.accessapproval.v1.EnrollmentLevel.valueOf(enrollmentLevel_); + return result == null + ? com.google.cloud.accessapproval.v1.EnrollmentLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The enrollment level of the service.
+     * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @param value The enrollmentLevel to set. + * @return This builder for chaining. + */ + public Builder setEnrollmentLevel(com.google.cloud.accessapproval.v1.EnrollmentLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + enrollmentLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The enrollment level of the service.
+     * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnrollmentLevel() { + + enrollmentLevel_ = 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.accessapproval.v1.EnrolledService) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.EnrolledService) + private static final com.google.cloud.accessapproval.v1.EnrolledService DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.EnrolledService(); + } + + public static com.google.cloud.accessapproval.v1.EnrolledService getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnrolledService parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnrolledService(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.accessapproval.v1.EnrolledService getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledServiceOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledServiceOrBuilder.java new file mode 100644 index 00000000..22453228 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrolledServiceOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface EnrolledServiceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.EnrolledService) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The product for which Access Approval will be enrolled. Allowed values are
+   * listed below (case-sensitive):
+   * <ol>
+   *   <li>all</li>
+   *   <li>appengine.googleapis.com</li>
+   *   <li>bigquery.googleapis.com</li>
+   *   <li>bigtable.googleapis.com</li>
+   *   <li>cloudkms.googleapis.com</li>
+   *   <li>compute.googleapis.com</li>
+   *   <li>dataflow.googleapis.com</li>
+   *   <li>iam.googleapis.com</li>
+   *   <li>pubsub.googleapis.com</li>
+   *   <li>storage.googleapis.com</li>
+   * <ol>
+   * 
+ * + * string cloud_product = 1; + * + * @return The cloudProduct. + */ + java.lang.String getCloudProduct(); + /** + * + * + *
+   * The product for which Access Approval will be enrolled. Allowed values are
+   * listed below (case-sensitive):
+   * <ol>
+   *   <li>all</li>
+   *   <li>appengine.googleapis.com</li>
+   *   <li>bigquery.googleapis.com</li>
+   *   <li>bigtable.googleapis.com</li>
+   *   <li>cloudkms.googleapis.com</li>
+   *   <li>compute.googleapis.com</li>
+   *   <li>dataflow.googleapis.com</li>
+   *   <li>iam.googleapis.com</li>
+   *   <li>pubsub.googleapis.com</li>
+   *   <li>storage.googleapis.com</li>
+   * <ol>
+   * 
+ * + * string cloud_product = 1; + * + * @return The bytes for cloudProduct. + */ + com.google.protobuf.ByteString getCloudProductBytes(); + + /** + * + * + *
+   * The enrollment level of the service.
+   * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enum numeric value on the wire for enrollmentLevel. + */ + int getEnrollmentLevelValue(); + /** + * + * + *
+   * The enrollment level of the service.
+   * 
+ * + * .google.cloud.accessapproval.v1.EnrollmentLevel enrollment_level = 2; + * + * @return The enrollmentLevel. + */ + com.google.cloud.accessapproval.v1.EnrollmentLevel getEnrollmentLevel(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrollmentLevel.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrollmentLevel.java new file mode 100644 index 00000000..39120d66 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/EnrollmentLevel.java @@ -0,0 +1,152 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Represents the type of enrollment for a given service to Access Approval.
+ * 
+ * + * Protobuf enum {@code google.cloud.accessapproval.v1.EnrollmentLevel} + */ +public enum EnrollmentLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default value for proto, shouldn't be used.
+   * 
+ * + * ENROLLMENT_LEVEL_UNSPECIFIED = 0; + */ + ENROLLMENT_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * Service is enrolled in Access Approval for all requests
+   * 
+ * + * BLOCK_ALL = 1; + */ + BLOCK_ALL(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Default value for proto, shouldn't be used.
+   * 
+ * + * ENROLLMENT_LEVEL_UNSPECIFIED = 0; + */ + public static final int ENROLLMENT_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Service is enrolled in Access Approval for all requests
+   * 
+ * + * BLOCK_ALL = 1; + */ + public static final int BLOCK_ALL_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 EnrollmentLevel 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 EnrollmentLevel forNumber(int value) { + switch (value) { + case 0: + return ENROLLMENT_LEVEL_UNSPECIFIED; + case 1: + return BLOCK_ALL; + 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 EnrollmentLevel findValueByNumber(int number) { + return EnrollmentLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EnrollmentLevel[] VALUES = values(); + + public static EnrollmentLevel 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 EnrollmentLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.accessapproval.v1.EnrollmentLevel) +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessage.java new file mode 100644 index 00000000..1d740178 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessage.java @@ -0,0 +1,647 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to get access approval settings.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage} + */ +public final class GetAccessApprovalSettingsMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) + GetAccessApprovalSettingsMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAccessApprovalSettingsMessage.newBuilder() to construct. + private GetAccessApprovalSettingsMessage( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAccessApprovalSettingsMessage() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAccessApprovalSettingsMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAccessApprovalSettingsMessage( + 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the AccessApprovalSettings to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the AccessApprovalSettings to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.accessapproval.v1.GetAccessApprovalSettingsMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage other = + (com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) 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.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage 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.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage 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.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage 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.accessapproval.v1.GetAccessApprovalSettingsMessage + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + 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.accessapproval.v1.GetAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage 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.accessapproval.v1.GetAccessApprovalSettingsMessage 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 to get access approval settings.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.Builder.class); + } + + // Construct using + // com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage.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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage build() { + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage buildPartial() { + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage result = + new com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage(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.accessapproval.v1.GetAccessApprovalSettingsMessage) { + return mergeFrom( + (com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage other) { + if (other + == com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + .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.accessapproval.v1.GetAccessApprovalSettingsMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the AccessApprovalSettings to retrieve.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to retrieve.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to retrieve.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to retrieve.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the AccessApprovalSettings to retrieve.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @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.accessapproval.v1.GetAccessApprovalSettingsMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) + private static final com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage(); + } + + public static com.google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAccessApprovalSettingsMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAccessApprovalSettingsMessage(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.accessapproval.v1.GetAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessageOrBuilder.java new file mode 100644 index 00000000..e1a064ed --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetAccessApprovalSettingsMessageOrBuilder.java @@ -0,0 +1,50 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface GetAccessApprovalSettingsMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.GetAccessApprovalSettingsMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the AccessApprovalSettings to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the AccessApprovalSettings to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessage.java new file mode 100644 index 00000000..f85479c5 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessage.java @@ -0,0 +1,638 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to get an approval request.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.GetApprovalRequestMessage} + */ +public final class GetApprovalRequestMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.GetApprovalRequestMessage) + GetApprovalRequestMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetApprovalRequestMessage.newBuilder() to construct. + private GetApprovalRequestMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetApprovalRequestMessage() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetApprovalRequestMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetApprovalRequestMessage( + 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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the approval request to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the approval request to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.accessapproval.v1.GetApprovalRequestMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage other = + (com.google.cloud.accessapproval.v1.GetApprovalRequestMessage) 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.accessapproval.v1.GetApprovalRequestMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage 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.accessapproval.v1.GetApprovalRequestMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage 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.accessapproval.v1.GetApprovalRequestMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage 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.accessapproval.v1.GetApprovalRequestMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage 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.accessapproval.v1.GetApprovalRequestMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage 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.accessapproval.v1.GetApprovalRequestMessage 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 to get an approval request.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.GetApprovalRequestMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.GetApprovalRequestMessage) + com.google.cloud.accessapproval.v1.GetApprovalRequestMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.class, + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.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.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_GetApprovalRequestMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetApprovalRequestMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetApprovalRequestMessage build() { + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.GetApprovalRequestMessage buildPartial() { + com.google.cloud.accessapproval.v1.GetApprovalRequestMessage result = + new com.google.cloud.accessapproval.v1.GetApprovalRequestMessage(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.accessapproval.v1.GetApprovalRequestMessage) { + return mergeFrom((com.google.cloud.accessapproval.v1.GetApprovalRequestMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.GetApprovalRequestMessage other) { + if (other + == com.google.cloud.accessapproval.v1.GetApprovalRequestMessage.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.accessapproval.v1.GetApprovalRequestMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.GetApprovalRequestMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the approval request to retrieve.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the approval request to retrieve.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the approval request to retrieve.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the approval request to retrieve.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the approval request to retrieve.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @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.accessapproval.v1.GetApprovalRequestMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.GetApprovalRequestMessage) + private static final com.google.cloud.accessapproval.v1.GetApprovalRequestMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.GetApprovalRequestMessage(); + } + + public static com.google.cloud.accessapproval.v1.GetApprovalRequestMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetApprovalRequestMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetApprovalRequestMessage(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.accessapproval.v1.GetApprovalRequestMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessageOrBuilder.java new file mode 100644 index 00000000..33e7979b --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/GetApprovalRequestMessageOrBuilder.java @@ -0,0 +1,50 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface GetApprovalRequestMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.GetApprovalRequestMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the approval request to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the approval request to retrieve.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessage.java new file mode 100644 index 00000000..847bb5fc --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessage.java @@ -0,0 +1,1146 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to list approval requests.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ListApprovalRequestsMessage} + */ +public final class ListApprovalRequestsMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + ListApprovalRequestsMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApprovalRequestsMessage.newBuilder() to construct. + private ListApprovalRequestsMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApprovalRequestsMessage() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApprovalRequestsMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListApprovalRequestsMessage( + 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(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.class, + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent resource. This may be "projects/{project_id}",
+   * "folders/{folder_id}", or "organizations/{organization_id}".
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The parent resource. This may be "projects/{project_id}",
+   * "folders/{folder_id}", or "organizations/{organization_id}".
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter on the type of approval requests to retrieve. Must be one of the
+   * following values:
+   * <ol>
+   *   <li>[not set]: Requests that are pending or have active approvals.</li>
+   *   <li>ALL: All requests.</li>
+   *   <li>PENDING: Only pending requests.</li>
+   *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+   *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+   * </ol>
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter on the type of approval requests to retrieve. Must be one of the
+   * following values:
+   * <ol>
+   *   <li>[not set]: Requests that are pending or have active approvals.</li>
+   *   <li>ALL: All requests.</li>
+   *   <li>PENDING: Only pending requests.</li>
+   *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+   *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+   * </ol>
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying the page of results to return.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying the page of results to return.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage other = + (com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage 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.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage 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.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage 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.accessapproval.v1.ListApprovalRequestsMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage 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.accessapproval.v1.ListApprovalRequestsMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage 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.accessapproval.v1.ListApprovalRequestsMessage 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 to list approval requests.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ListApprovalRequestsMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.class, + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.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_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage build() { + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage buildPartial() { + com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage result = + new com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage(this); + result.parent_ = parent_; + result.filter_ = filter_; + 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.accessapproval.v1.ListApprovalRequestsMessage) { + return mergeFrom((com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage other) { + if (other + == com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.accessapproval.v1.ListApprovalRequestsMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent resource. This may be "projects/{project_id}",
+     * "folders/{folder_id}", or "organizations/{organization_id}".
+     * 
+ * + * string parent = 1; + * + * @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; + } + } + /** + * + * + *
+     * The parent resource. This may be "projects/{project_id}",
+     * "folders/{folder_id}", or "organizations/{organization_id}".
+     * 
+ * + * string parent = 1; + * + * @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; + } + } + /** + * + * + *
+     * The parent resource. This may be "projects/{project_id}",
+     * "folders/{folder_id}", or "organizations/{organization_id}".
+     * 
+ * + * string parent = 1; + * + * @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; + } + /** + * + * + *
+     * The parent resource. This may be "projects/{project_id}",
+     * "folders/{folder_id}", or "organizations/{organization_id}".
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource. This may be "projects/{project_id}",
+     * "folders/{folder_id}", or "organizations/{organization_id}".
+     * 
+ * + * string parent = 1; + * + * @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 filter_ = ""; + /** + * + * + *
+     * A filter on the type of approval requests to retrieve. Must be one of the
+     * following values:
+     * <ol>
+     *   <li>[not set]: Requests that are pending or have active approvals.</li>
+     *   <li>ALL: All requests.</li>
+     *   <li>PENDING: Only pending requests.</li>
+     *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+     *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+     * </ol>
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter on the type of approval requests to retrieve. Must be one of the
+     * following values:
+     * <ol>
+     *   <li>[not set]: Requests that are pending or have active approvals.</li>
+     *   <li>ALL: All requests.</li>
+     *   <li>PENDING: Only pending requests.</li>
+     *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+     *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+     * </ol>
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter on the type of approval requests to retrieve. Must be one of the
+     * following values:
+     * <ol>
+     *   <li>[not set]: Requests that are pending or have active approvals.</li>
+     *   <li>ALL: All requests.</li>
+     *   <li>PENDING: Only pending requests.</li>
+     *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+     *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+     * </ol>
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter on the type of approval requests to retrieve. Must be one of the
+     * following values:
+     * <ol>
+     *   <li>[not set]: Requests that are pending or have active approvals.</li>
+     *   <li>ALL: All requests.</li>
+     *   <li>PENDING: Only pending requests.</li>
+     *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+     *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+     * </ol>
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter on the type of approval requests to retrieve. Must be one of the
+     * following values:
+     * <ol>
+     *   <li>[not set]: Requests that are pending or have active approvals.</li>
+     *   <li>ALL: All requests.</li>
+     *   <li>PENDING: Only pending requests.</li>
+     *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+     *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+     * </ol>
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying the page of results to return.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying the page of results to return.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying the page of results to return.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying the page of results to return.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying the page of results to return.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + private static final com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage(); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApprovalRequestsMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListApprovalRequestsMessage(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.accessapproval.v1.ListApprovalRequestsMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessageOrBuilder.java new file mode 100644 index 00000000..72bcef80 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsMessageOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ListApprovalRequestsMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ListApprovalRequestsMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent resource. This may be "projects/{project_id}",
+   * "folders/{folder_id}", or "organizations/{organization_id}".
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent resource. This may be "projects/{project_id}",
+   * "folders/{folder_id}", or "organizations/{organization_id}".
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A filter on the type of approval requests to retrieve. Must be one of the
+   * following values:
+   * <ol>
+   *   <li>[not set]: Requests that are pending or have active approvals.</li>
+   *   <li>ALL: All requests.</li>
+   *   <li>PENDING: Only pending requests.</li>
+   *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+   *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+   * </ol>
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter on the type of approval requests to retrieve. Must be one of the
+   * following values:
+   * <ol>
+   *   <li>[not set]: Requests that are pending or have active approvals.</li>
+   *   <li>ALL: All requests.</li>
+   *   <li>PENDING: Only pending requests.</li>
+   *   <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
+   *   <li>DISMISSED: Only dismissed (including expired) requests.</li>
+   * </ol>
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Requested page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying the page of results to return.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying the page of results to return.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponse.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponse.java new file mode 100644 index 00000000..7c999bd3 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponse.java @@ -0,0 +1,1146 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Response to listing of ApprovalRequest objects.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ListApprovalRequestsResponse} + */ +public final class ListApprovalRequestsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ListApprovalRequestsResponse) + ListApprovalRequestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApprovalRequestsResponse.newBuilder() to construct. + private ListApprovalRequestsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApprovalRequestsResponse() { + approvalRequests_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApprovalRequestsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListApprovalRequestsResponse( + 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)) { + approvalRequests_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + approvalRequests_.add( + input.readMessage( + com.google.cloud.accessapproval.v1.ApprovalRequest.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)) { + approvalRequests_ = java.util.Collections.unmodifiableList(approvalRequests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.class, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.Builder.class); + } + + public static final int APPROVAL_REQUESTS_FIELD_NUMBER = 1; + private java.util.List approvalRequests_; + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public java.util.List + getApprovalRequestsList() { + return approvalRequests_; + } + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public java.util.List + getApprovalRequestsOrBuilderList() { + return approvalRequests_; + } + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public int getApprovalRequestsCount() { + return approvalRequests_.size(); + } + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequest getApprovalRequests(int index) { + return approvalRequests_.get(index); + } + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder getApprovalRequestsOrBuilder( + int index) { + return approvalRequests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < approvalRequests_.size(); i++) { + output.writeMessage(1, approvalRequests_.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 < approvalRequests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, approvalRequests_.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.accessapproval.v1.ListApprovalRequestsResponse)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse other = + (com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse) obj; + + if (!getApprovalRequestsList().equals(other.getApprovalRequestsList())) 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 (getApprovalRequestsCount() > 0) { + hash = (37 * hash) + APPROVAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getApprovalRequestsList().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.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse 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.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse 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.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse 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.accessapproval.v1.ListApprovalRequestsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse 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.accessapproval.v1.ListApprovalRequestsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse 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.accessapproval.v1.ListApprovalRequestsResponse 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 to listing of ApprovalRequest objects.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ListApprovalRequestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ListApprovalRequestsResponse) + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.class, + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getApprovalRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (approvalRequestsBuilder_ == null) { + approvalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + approvalRequestsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ListApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse build() { + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse buildPartial() { + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse result = + new com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse(this); + int from_bitField0_ = bitField0_; + if (approvalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + approvalRequests_ = java.util.Collections.unmodifiableList(approvalRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.approvalRequests_ = approvalRequests_; + } else { + result.approvalRequests_ = approvalRequestsBuilder_.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.accessapproval.v1.ListApprovalRequestsResponse) { + return mergeFrom((com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse other) { + if (other + == com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse.getDefaultInstance()) + return this; + if (approvalRequestsBuilder_ == null) { + if (!other.approvalRequests_.isEmpty()) { + if (approvalRequests_.isEmpty()) { + approvalRequests_ = other.approvalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureApprovalRequestsIsMutable(); + approvalRequests_.addAll(other.approvalRequests_); + } + onChanged(); + } + } else { + if (!other.approvalRequests_.isEmpty()) { + if (approvalRequestsBuilder_.isEmpty()) { + approvalRequestsBuilder_.dispose(); + approvalRequestsBuilder_ = null; + approvalRequests_ = other.approvalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + approvalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getApprovalRequestsFieldBuilder() + : null; + } else { + approvalRequestsBuilder_.addAllMessages(other.approvalRequests_); + } + } + } + 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.accessapproval.v1.ListApprovalRequestsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List approvalRequests_ = + java.util.Collections.emptyList(); + + private void ensureApprovalRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + approvalRequests_ = + new java.util.ArrayList( + approvalRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApprovalRequest, + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder, + com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder> + approvalRequestsBuilder_; + + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public java.util.List + getApprovalRequestsList() { + if (approvalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(approvalRequests_); + } else { + return approvalRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public int getApprovalRequestsCount() { + if (approvalRequestsBuilder_ == null) { + return approvalRequests_.size(); + } else { + return approvalRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequest getApprovalRequests(int index) { + if (approvalRequestsBuilder_ == null) { + return approvalRequests_.get(index); + } else { + return approvalRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder setApprovalRequests( + int index, com.google.cloud.accessapproval.v1.ApprovalRequest value) { + if (approvalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApprovalRequestsIsMutable(); + approvalRequests_.set(index, value); + onChanged(); + } else { + approvalRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder setApprovalRequests( + int index, com.google.cloud.accessapproval.v1.ApprovalRequest.Builder builderForValue) { + if (approvalRequestsBuilder_ == null) { + ensureApprovalRequestsIsMutable(); + approvalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + approvalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder addApprovalRequests(com.google.cloud.accessapproval.v1.ApprovalRequest value) { + if (approvalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApprovalRequestsIsMutable(); + approvalRequests_.add(value); + onChanged(); + } else { + approvalRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder addApprovalRequests( + int index, com.google.cloud.accessapproval.v1.ApprovalRequest value) { + if (approvalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApprovalRequestsIsMutable(); + approvalRequests_.add(index, value); + onChanged(); + } else { + approvalRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder addApprovalRequests( + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder builderForValue) { + if (approvalRequestsBuilder_ == null) { + ensureApprovalRequestsIsMutable(); + approvalRequests_.add(builderForValue.build()); + onChanged(); + } else { + approvalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder addApprovalRequests( + int index, com.google.cloud.accessapproval.v1.ApprovalRequest.Builder builderForValue) { + if (approvalRequestsBuilder_ == null) { + ensureApprovalRequestsIsMutable(); + approvalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + approvalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder addAllApprovalRequests( + java.lang.Iterable values) { + if (approvalRequestsBuilder_ == null) { + ensureApprovalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, approvalRequests_); + onChanged(); + } else { + approvalRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder clearApprovalRequests() { + if (approvalRequestsBuilder_ == null) { + approvalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + approvalRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public Builder removeApprovalRequests(int index) { + if (approvalRequestsBuilder_ == null) { + ensureApprovalRequestsIsMutable(); + approvalRequests_.remove(index); + onChanged(); + } else { + approvalRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequest.Builder getApprovalRequestsBuilder( + int index) { + return getApprovalRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder getApprovalRequestsOrBuilder( + int index) { + if (approvalRequestsBuilder_ == null) { + return approvalRequests_.get(index); + } else { + return approvalRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public java.util.List + getApprovalRequestsOrBuilderList() { + if (approvalRequestsBuilder_ != null) { + return approvalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(approvalRequests_); + } + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequest.Builder addApprovalRequestsBuilder() { + return getApprovalRequestsFieldBuilder() + .addBuilder(com.google.cloud.accessapproval.v1.ApprovalRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public com.google.cloud.accessapproval.v1.ApprovalRequest.Builder addApprovalRequestsBuilder( + int index) { + return getApprovalRequestsFieldBuilder() + .addBuilder( + index, com.google.cloud.accessapproval.v1.ApprovalRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Approval request details.
+     * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + public java.util.List + getApprovalRequestsBuilderList() { + return getApprovalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApprovalRequest, + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder, + com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder> + getApprovalRequestsFieldBuilder() { + if (approvalRequestsBuilder_ == null) { + approvalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.accessapproval.v1.ApprovalRequest, + com.google.cloud.accessapproval.v1.ApprovalRequest.Builder, + com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder>( + approvalRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + approvalRequests_ = null; + } + return approvalRequestsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more.
+     * 
+ * + * 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.accessapproval.v1.ListApprovalRequestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ListApprovalRequestsResponse) + private static final com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse(); + } + + public static com.google.cloud.accessapproval.v1.ListApprovalRequestsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApprovalRequestsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListApprovalRequestsResponse(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.accessapproval.v1.ListApprovalRequestsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponseOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponseOrBuilder.java new file mode 100644 index 00000000..cbeb164a --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ListApprovalRequestsResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ListApprovalRequestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ListApprovalRequestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + java.util.List getApprovalRequestsList(); + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + com.google.cloud.accessapproval.v1.ApprovalRequest getApprovalRequests(int index); + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + int getApprovalRequestsCount(); + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + java.util.List + getApprovalRequestsOrBuilderList(); + /** + * + * + *
+   * Approval request details.
+   * 
+ * + * repeated .google.cloud.accessapproval.v1.ApprovalRequest approval_requests = 1; + */ + com.google.cloud.accessapproval.v1.ApprovalRequestOrBuilder getApprovalRequestsOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourceProperties.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourceProperties.java new file mode 100644 index 00000000..44d44db3 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourceProperties.java @@ -0,0 +1,549 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * The properties associated with the resource of the request.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ResourceProperties} + */ +public final class ResourceProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.ResourceProperties) + ResourcePropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceProperties.newBuilder() to construct. + private ResourceProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceProperties() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceProperties(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResourceProperties( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + excludesDescendants_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ResourceProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ResourceProperties.class, + com.google.cloud.accessapproval.v1.ResourceProperties.Builder.class); + } + + public static final int EXCLUDES_DESCENDANTS_FIELD_NUMBER = 1; + private boolean excludesDescendants_; + /** + * + * + *
+   * Whether an approval will exclude the descendants of the resource being
+   * requested.
+   * 
+ * + * bool excludes_descendants = 1; + * + * @return The excludesDescendants. + */ + public boolean getExcludesDescendants() { + return excludesDescendants_; + } + + 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 (excludesDescendants_ != false) { + output.writeBool(1, excludesDescendants_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (excludesDescendants_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, excludesDescendants_); + } + 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.accessapproval.v1.ResourceProperties)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.ResourceProperties other = + (com.google.cloud.accessapproval.v1.ResourceProperties) obj; + + if (getExcludesDescendants() != other.getExcludesDescendants()) 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) + EXCLUDES_DESCENDANTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExcludesDescendants()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties 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.accessapproval.v1.ResourceProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties 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.accessapproval.v1.ResourceProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties 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.accessapproval.v1.ResourceProperties parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties 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.accessapproval.v1.ResourceProperties parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties 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.accessapproval.v1.ResourceProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The properties associated with the resource of the request.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.ResourceProperties} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.ResourceProperties) + com.google.cloud.accessapproval.v1.ResourcePropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ResourceProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.ResourceProperties.class, + com.google.cloud.accessapproval.v1.ResourceProperties.Builder.class); + } + + // Construct using com.google.cloud.accessapproval.v1.ResourceProperties.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(); + excludesDescendants_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_ResourceProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ResourceProperties getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.ResourceProperties.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ResourceProperties build() { + com.google.cloud.accessapproval.v1.ResourceProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.ResourceProperties buildPartial() { + com.google.cloud.accessapproval.v1.ResourceProperties result = + new com.google.cloud.accessapproval.v1.ResourceProperties(this); + result.excludesDescendants_ = excludesDescendants_; + 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.accessapproval.v1.ResourceProperties) { + return mergeFrom((com.google.cloud.accessapproval.v1.ResourceProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.accessapproval.v1.ResourceProperties other) { + if (other == com.google.cloud.accessapproval.v1.ResourceProperties.getDefaultInstance()) + return this; + if (other.getExcludesDescendants() != false) { + setExcludesDescendants(other.getExcludesDescendants()); + } + 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.accessapproval.v1.ResourceProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.ResourceProperties) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean excludesDescendants_; + /** + * + * + *
+     * Whether an approval will exclude the descendants of the resource being
+     * requested.
+     * 
+ * + * bool excludes_descendants = 1; + * + * @return The excludesDescendants. + */ + public boolean getExcludesDescendants() { + return excludesDescendants_; + } + /** + * + * + *
+     * Whether an approval will exclude the descendants of the resource being
+     * requested.
+     * 
+ * + * bool excludes_descendants = 1; + * + * @param value The excludesDescendants to set. + * @return This builder for chaining. + */ + public Builder setExcludesDescendants(boolean value) { + + excludesDescendants_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether an approval will exclude the descendants of the resource being
+     * requested.
+     * 
+ * + * bool excludes_descendants = 1; + * + * @return This builder for chaining. + */ + public Builder clearExcludesDescendants() { + + excludesDescendants_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.accessapproval.v1.ResourceProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.ResourceProperties) + private static final com.google.cloud.accessapproval.v1.ResourceProperties DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.ResourceProperties(); + } + + public static com.google.cloud.accessapproval.v1.ResourceProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResourceProperties(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.accessapproval.v1.ResourceProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourcePropertiesOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourcePropertiesOrBuilder.java new file mode 100644 index 00000000..18ec6266 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/ResourcePropertiesOrBuilder.java @@ -0,0 +1,39 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface ResourcePropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.ResourceProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether an approval will exclude the descendants of the resource being
+   * requested.
+   * 
+ * + * bool excludes_descendants = 1; + * + * @return The excludesDescendants. + */ + boolean getExcludesDescendants(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessage.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessage.java new file mode 100644 index 00000000..c87f3bba --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessage.java @@ -0,0 +1,1113 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +/** + * + * + *
+ * Request to update access approval settings.
+ * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage} + */ +public final class UpdateAccessApprovalSettingsMessage + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + UpdateAccessApprovalSettingsMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAccessApprovalSettingsMessage.newBuilder() to construct. + private UpdateAccessApprovalSettingsMessage( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAccessApprovalSettingsMessage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAccessApprovalSettingsMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAccessApprovalSettingsMessage( + 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.accessapproval.v1.AccessApprovalSettings.Builder subBuilder = null; + if (settings_ != null) { + subBuilder = settings_.toBuilder(); + } + settings_ = + input.readMessage( + com.google.cloud.accessapproval.v1.AccessApprovalSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(settings_); + settings_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.Builder.class); + } + + public static final int SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.accessapproval.v1.AccessApprovalSettings settings_; + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return settings_ != null; + } + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return The settings. + */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettings getSettings() { + return settings_ == null + ? com.google.cloud.accessapproval.v1.AccessApprovalSettings.getDefaultInstance() + : settings_; + } + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder getSettingsOrBuilder() { + return getSettings(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (settings_ != null) { + output.writeMessage(1, getSettings()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (settings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSettings()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage)) { + return super.equals(obj); + } + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage other = + (com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) obj; + + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings().equals(other.getSettings())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage 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.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage 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.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage 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.accessapproval.v1.UpdateAccessApprovalSettingsMessage + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + 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.accessapproval.v1.UpdateAccessApprovalSettingsMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage 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.accessapproval.v1.UpdateAccessApprovalSettingsMessage 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 to update access approval settings.
+   * 
+ * + * Protobuf type {@code google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.class, + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.Builder.class); + } + + // Construct using + // com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage.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 (settingsBuilder_ == null) { + settings_ = null; + } else { + settings_ = null; + settingsBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.accessapproval.v1.AccessApprovalProto + .internal_static_google_cloud_accessapproval_v1_UpdateAccessApprovalSettingsMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage build() { + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage buildPartial() { + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage result = + new com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage(this); + if (settingsBuilder_ == null) { + result.settings_ = settings_; + } else { + result.settings_ = settingsBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) { + return mergeFrom( + (com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage other) { + if (other + == com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + .getDefaultInstance()) return this; + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.accessapproval.v1.AccessApprovalSettings settings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessApprovalSettings, + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder, + com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder> + settingsBuilder_; + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return settingsBuilder_ != null || settings_ != null; + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return The settings. + */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null + ? com.google.cloud.accessapproval.v1.AccessApprovalSettings.getDefaultInstance() + : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public Builder setSettings(com.google.cloud.accessapproval.v1.AccessApprovalSettings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + onChanged(); + } else { + settingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public Builder setSettings( + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + onChanged(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public Builder mergeSettings(com.google.cloud.accessapproval.v1.AccessApprovalSettings value) { + if (settingsBuilder_ == null) { + if (settings_ != null) { + settings_ = + com.google.cloud.accessapproval.v1.AccessApprovalSettings.newBuilder(settings_) + .mergeFrom(value) + .buildPartial(); + } else { + settings_ = value; + } + onChanged(); + } else { + settingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public Builder clearSettings() { + if (settingsBuilder_ == null) { + settings_ = null; + onChanged(); + } else { + settings_ = null; + settingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder getSettingsBuilder() { + + onChanged(); + return getSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + public com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder + getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null + ? com.google.cloud.accessapproval.v1.AccessApprovalSettings.getDefaultInstance() + : settings_; + } + } + /** + * + * + *
+     * The new AccessApprovalSettings.
+     * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessApprovalSettings, + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder, + com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder> + getSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.accessapproval.v1.AccessApprovalSettings, + com.google.cloud.accessapproval.v1.AccessApprovalSettings.Builder, + com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder>( + getSettings(), getParentForChildren(), isClean()); + settings_ = null; + } + return settingsBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The update mask applies to the settings. Only the top level fields of
+     * AccessApprovalSettings (notification_emails & enrolled_services) are
+     * supported. For each field, if it is included, the currently stored value
+     * will be entirely overwritten with the value of the field passed in this
+     * request.
+     * For the `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * If this field is left unset, only the notification_emails field will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + private static final com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage(); + } + + public static com.google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAccessApprovalSettingsMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAccessApprovalSettingsMessage(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.accessapproval.v1.UpdateAccessApprovalSettingsMessage + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessageOrBuilder.java b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessageOrBuilder.java new file mode 100644 index 00000000..a3b023ce --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/UpdateAccessApprovalSettingsMessageOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/accessapproval/v1/accessapproval.proto + +package com.google.cloud.accessapproval.v1; + +public interface UpdateAccessApprovalSettingsMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.accessapproval.v1.UpdateAccessApprovalSettingsMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return Whether the settings field is set. + */ + boolean hasSettings(); + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + * + * @return The settings. + */ + com.google.cloud.accessapproval.v1.AccessApprovalSettings getSettings(); + /** + * + * + *
+   * The new AccessApprovalSettings.
+   * 
+ * + * .google.cloud.accessapproval.v1.AccessApprovalSettings settings = 1; + */ + com.google.cloud.accessapproval.v1.AccessApprovalSettingsOrBuilder getSettingsOrBuilder(); + + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The update mask applies to the settings. Only the top level fields of
+   * AccessApprovalSettings (notification_emails & enrolled_services) are
+   * supported. For each field, if it is included, the currently stored value
+   * will be entirely overwritten with the value of the field passed in this
+   * request.
+   * For the `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * If this field is left unset, only the notification_emails field will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-accessapproval-v1/src/main/proto/google/cloud/accessapproval/v1/accessapproval.proto b/proto-google-cloud-accessapproval-v1/src/main/proto/google/cloud/accessapproval/v1/accessapproval.proto new file mode 100644 index 00000000..475a6a75 --- /dev/null +++ b/proto-google-cloud-accessapproval-v1/src/main/proto/google/cloud/accessapproval/v1/accessapproval.proto @@ -0,0 +1,477 @@ +// 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.accessapproval.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/accessapproval/v1;accessapproval"; +option java_multiple_files = true; +option java_outer_classname = "AccessApprovalProto"; +option java_package = "com.google.cloud.accessapproval.v1"; + +// This API allows a customer to manage accesses to cloud resources by +// Google personnel. It defines the following resource model: +// +// - The API has a collection of +// [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest] +// resources, named `approvalRequests/{approval_request_id}` +// - The API has top-level settings per Project/Folder/Organization, named +// `accessApprovalSettings` +// +// The service also periodically emails a list of recipients, defined at the +// Project/Folder/Organization level in the accessApprovalSettings, when there +// is a pending ApprovalRequest for them to act on. The ApprovalRequests can +// also optionally be published to a Cloud Pub/Sub topic owned by the customer +// (for Beta, the Pub/Sub setup is managed manually). +// +// ApprovalRequests can be approved or dismissed. Google personel can only +// access the indicated resource or resources if the request is approved +// (subject to some exclusions: +// https://cloud.google.com/access-approval/docs/overview#exclusions). +// +// Note: Using Access Approval functionality will mean that Google may not be +// able to meet the SLAs for your chosen products, as any support response times +// may be dramatically increased. As such the SLAs do not apply to any service +// disruption to the extent impacted by Customer's use of Access Approval. Do +// not enable Access Approval for projects where you may require high service +// availability and rapid response by Google Cloud Support. +// +// After a request is approved or dismissed, no further action may be taken on +// it. Requests with the requested_expiration in the past or with no activity +// for 14 days are considered dismissed. When an approval expires, the request +// is considered dismissed. +// +// If a request is not approved or dismissed, we call it pending. +// LINT.IfChange +service AccessApproval { + option (google.api.default_host) = "accessapproval.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists approval requests associated with a project, folder, or organization. + // Approval requests can be filtered by state (pending, active, dismissed). + // The order is reverse chronological. + rpc ListApprovalRequests(ListApprovalRequestsMessage) returns (ListApprovalRequestsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/approvalRequests" + additional_bindings { + get: "/v1/{parent=folders/*}/approvalRequests" + } + additional_bindings { + get: "/v1/{parent=organizations/*}/approvalRequests" + } + }; + } + + // Gets an approval request. Returns NOT_FOUND if the request does not exist. + rpc GetApprovalRequest(GetApprovalRequestMessage) returns (ApprovalRequest) { + option (google.api.http) = { + get: "/v1/{name=projects/*/approvalRequests/*}" + additional_bindings { + get: "/v1/{name=folders/*/approvalRequests/*}" + } + additional_bindings { + get: "/v1/{name=organizations/*/approvalRequests/*}" + } + }; + } + + // Approves a request and returns the updated ApprovalRequest. + // + // Returns NOT_FOUND if the request does not exist. Returns + // FAILED_PRECONDITION if the request exists but is not in a pending state. + rpc ApproveApprovalRequest(ApproveApprovalRequestMessage) returns (ApprovalRequest) { + option (google.api.http) = { + post: "/v1/{name=projects/*/approvalRequests/*}:approve" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/approvalRequests/*}:approve" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/approvalRequests/*}:approve" + body: "*" + } + }; + } + + // Dismisses a request. Returns the updated ApprovalRequest. + // + // NOTE: This does not deny access to the resource if another request has been + // made and approved. It is equivalent in effect to ignoring the request + // altogether. + // + // Returns NOT_FOUND if the request does not exist. + // + // Returns FAILED_PRECONDITION if the request exists but is not in a pending + // state. + rpc DismissApprovalRequest(DismissApprovalRequestMessage) returns (ApprovalRequest) { + option (google.api.http) = { + post: "/v1/{name=projects/*/approvalRequests/*}:dismiss" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/approvalRequests/*}:dismiss" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/approvalRequests/*}:dismiss" + body: "*" + } + }; + } + + // Gets the settings associated with a project, folder, or organization. + rpc GetAccessApprovalSettings(GetAccessApprovalSettingsMessage) returns (AccessApprovalSettings) { + option (google.api.http) = { + get: "/v1/{name=projects/*/accessApprovalSettings}" + additional_bindings { + get: "/v1/{name=folders/*/accessApprovalSettings}" + } + additional_bindings { + get: "/v1/{name=organizations/*/accessApprovalSettings}" + } + }; + } + + // Updates the settings associated with a project, folder, or organization. + // Settings to update are determined by the value of field_mask. + rpc UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage) returns (AccessApprovalSettings) { + option (google.api.http) = { + patch: "/v1/{settings.name=projects/*/accessApprovalSettings}" + body: "settings" + additional_bindings { + patch: "/v1/{settings.name=folders/*/accessApprovalSettings}" + body: "settings" + } + additional_bindings { + patch: "/v1/{settings.name=organizations/*/accessApprovalSettings}" + body: "settings" + } + }; + } + + // Deletes the settings associated with a project, folder, or organization. + // This will have the effect of disabling Access Approval for the project, + // folder, or organization, but only if all ancestors also have Access + // Approval disabled. If Access Approval is enabled at a higher level of the + // hierarchy, then Access Approval will still be enabled at this level as + // the settings are inherited. + rpc DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/accessApprovalSettings}" + additional_bindings { + delete: "/v1/{name=folders/*/accessApprovalSettings}" + } + additional_bindings { + delete: "/v1/{name=organizations/*/accessApprovalSettings}" + } + }; + } +} + +// Home office and physical location of the principal. +message AccessLocations { + // The "home office" location of the principal. A two-letter country code + // (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some + // limited situations Google systems may refer refer to a region code instead + // of a country code. + // Possible Region Codes: + //
    + //
  1. ASI: Asia
  2. + //
  3. EUR: Europe
  4. + //
  5. OCE: Oceania
  6. + //
  7. AFR: Africa
  8. + //
  9. NAM: North America
  10. + //
  11. SAM: South America
  12. + //
  13. ANT: Antarctica
  14. + //
  15. ANY: Any location
  16. + //
+ string principal_office_country = 1; + + // Physical location of the principal at the time of the access. A + // two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or + // a region code. In some limited situations Google systems may refer refer to + // a region code instead of a country code. + // Possible Region Codes: + //
    + //
  1. ASI: Asia
  2. + //
  3. EUR: Europe
  4. + //
  5. OCE: Oceania
  6. + //
  7. AFR: Africa
  8. + //
  9. NAM: North America
  10. + //
  11. SAM: South America
  12. + //
  13. ANT: Antarctica
  14. + //
  15. ANY: Any location
  16. + //
+ string principal_physical_location_country = 2; +} + +message AccessReason { + // Type of access justification. + enum Type { + // Default value for proto, shouldn't be used. + TYPE_UNSPECIFIED = 0; + + // Customer made a request or raised an issue that required the principal to + // access customer data. `detail` is of the form ("#####" is the issue ID): + //
    + //
  1. "Feedback Report: #####"
  2. + //
  3. "Case Number: #####"
  4. + //
  5. "Case ID: #####"
  6. + //
  7. "E-PIN Reference: #####"
  8. + //
  9. "Google-#####"
  10. + //
  11. "T-#####"
  12. + //
+ CUSTOMER_INITIATED_SUPPORT = 1; + + // The principal accessed customer data in order to diagnose or resolve a + // suspected issue in services or a known outage. Often this access is used + // to confirm that customers are not affected by a suspected service issue + // or to remediate a reversible system issue. + GOOGLE_INITIATED_SERVICE = 2; + + // Google initiated service for security, fraud, abuse, or compliance + // purposes. + GOOGLE_INITIATED_REVIEW = 3; + } + + // Type of access justification. + Type type = 1; + + // More detail about certain reason types. See comments for each type above. + string detail = 2; +} + +// A decision that has been made to approve access to a resource. +message ApproveDecision { + // The time at which approval was granted. + google.protobuf.Timestamp approve_time = 1; + + // The time at which the approval expires. + google.protobuf.Timestamp expire_time = 2; +} + +// A decision that has been made to dismiss an approval request. +message DismissDecision { + // The time at which the approval request was dismissed. + google.protobuf.Timestamp dismiss_time = 1; +} + +// The properties associated with the resource of the request. +message ResourceProperties { + // Whether an approval will exclude the descendants of the resource being + // requested. + bool excludes_descendants = 1; +} + +// A request for the customer to approve access to a resource. +message ApprovalRequest { + // The resource name of the request. Format is + // "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}". + string name = 1; + + // The resource for which approval is being requested. The format of the + // resource name is defined at + // https://cloud.google.com/apis/design/resource_names. The resource name here + // may either be a "full" resource name (e.g. + // "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative" + // resource name (e.g. "shelves/shelf1/books/book2") as described in the + // resource name specification. + string requested_resource_name = 2; + + // Properties related to the resource represented by requested_resource_name. + ResourceProperties requested_resource_properties = 9; + + // The justification for which approval is being requested. + AccessReason requested_reason = 3; + + // The locations for which approval is being requested. + AccessLocations requested_locations = 4; + + // The time at which approval was requested. + google.protobuf.Timestamp request_time = 5; + + // The requested expiration for the approval. If the request is approved, + // access will be granted from the time of approval until the expiration time. + google.protobuf.Timestamp requested_expiration = 6; + + // The current decision on the approval request. + oneof decision { + // Access was approved. + ApproveDecision approve = 7; + + // The request was dismissed. + DismissDecision dismiss = 8; + } +} + +// Represents the enrollment of a cloud resource into a specific service. +message EnrolledService { + // The product for which Access Approval will be enrolled. Allowed values are + // listed below (case-sensitive): + //
    + //
  1. all
  2. + //
  3. appengine.googleapis.com
  4. + //
  5. bigquery.googleapis.com
  6. + //
  7. bigtable.googleapis.com
  8. + //
  9. cloudkms.googleapis.com
  10. + //
  11. compute.googleapis.com
  12. + //
  13. dataflow.googleapis.com
  14. + //
  15. iam.googleapis.com
  16. + //
  17. pubsub.googleapis.com
  18. + //
  19. storage.googleapis.com
  20. + //
      + string cloud_product = 1; + + // The enrollment level of the service. + EnrollmentLevel enrollment_level = 2; +} + +// Represents the type of enrollment for a given service to Access Approval. +enum EnrollmentLevel { + // Default value for proto, shouldn't be used. + ENROLLMENT_LEVEL_UNSPECIFIED = 0; + + // Service is enrolled in Access Approval for all requests + BLOCK_ALL = 1; +} + +// Settings on a Project/Folder/Organization related to Access Approval. +message AccessApprovalSettings { + // The resource name of the settings. Format is one of: + //
        + //
      1. "projects/{project_id}/accessApprovalSettings"
      2. + //
      3. "folders/{folder_id}/accessApprovalSettings"
      4. + //
      5. "organizations/{organization_id}/accessApprovalSettings"
      6. + //
          + string name = 1; + + // A list of email addresses to which notifications relating to approval + // requests should be sent. Notifications relating to a resource will be sent + // to all emails in the settings of ancestor resources of that resource. A + // maximum of 50 email addresses are allowed. + repeated string notification_emails = 2; + + // A list of Google Cloud Services for which the given resource has Access + // Approval enrolled. Access requests for the resource given by name against + // any of these services contained here will be required to have explicit + // approval. If name refers to an organization, enrollment can be done for + // individual services. If name refers to a folder or project, enrollment can + // only be done on an all or nothing basis. + // + // If a cloud_product is repeated in this list, the first entry will be + // honored and all following entries will be discarded. A maximum of 10 + // enrolled services will be enforced, to be expanded as the set of supported + // services is expanded. + repeated EnrolledService enrolled_services = 3; + + // Output only. This field is read only (not settable via + // UpdateAccessAccessApprovalSettings method). If the field is true, that + // indicates that at least one service is enrolled for Access Approval in one + // or more ancestors of the Project or Folder (this field will always be + // unset for the organization since organizations do not have ancestors). + bool enrolled_ancestor = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request to list approval requests. +message ListApprovalRequestsMessage { + // The parent resource. This may be "projects/{project_id}", + // "folders/{folder_id}", or "organizations/{organization_id}". + string parent = 1; + + // A filter on the type of approval requests to retrieve. Must be one of the + // following values: + //
            + //
          1. [not set]: Requests that are pending or have active approvals.
          2. + //
          3. ALL: All requests.
          4. + //
          5. PENDING: Only pending requests.
          6. + //
          7. ACTIVE: Only active (i.e. currently approved) requests.
          8. + //
          9. DISMISSED: Only dismissed (including expired) requests.
          10. + //
          + string filter = 2; + + // Requested page size. + int32 page_size = 3; + + // A token identifying the page of results to return. + string page_token = 4; +} + +// Response to listing of ApprovalRequest objects. +message ListApprovalRequestsResponse { + // Approval request details. + repeated ApprovalRequest approval_requests = 1; + + // Token to retrieve the next page of results, or empty if there are no more. + string next_page_token = 2; +} + +// Request to get an approval request. +message GetApprovalRequestMessage { + // Name of the approval request to retrieve. + string name = 1; +} + +// Request to approve an ApprovalRequest. +message ApproveApprovalRequestMessage { + // Name of the approval request to approve. + string name = 1; + + // The expiration time of this approval. + google.protobuf.Timestamp expire_time = 2; +} + +// Request to dismiss an approval request. +message DismissApprovalRequestMessage { + // Name of the ApprovalRequest to dismiss. + string name = 1; +} + +// Request to get access approval settings. +message GetAccessApprovalSettingsMessage { + // Name of the AccessApprovalSettings to retrieve. + string name = 1; +} + +// Request to update access approval settings. +message UpdateAccessApprovalSettingsMessage { + // The new AccessApprovalSettings. + AccessApprovalSettings settings = 1; + + // The update mask applies to the settings. Only the top level fields of + // AccessApprovalSettings (notification_emails & enrolled_services) are + // supported. For each field, if it is included, the currently stored value + // will be entirely overwritten with the value of the field passed in this + // request. + // + // For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // If this field is left unset, only the notification_emails field will be + // updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete access approval settings. +message DeleteAccessApprovalSettingsMessage { + // Name of the AccessApprovalSettings to delete. + string name = 1; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..268a4669 --- /dev/null +++ b/renovate.json @@ -0,0 +1,71 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true +} diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..16715e6f --- /dev/null +++ b/synth.metadata @@ -0,0 +1,31 @@ +{ + "updateTime": "2020-02-05T21:34:49.133430Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e2faab04f4cb7f9755072330866689b1943a16e9", + "internalRef": "293424055" + } + }, + { + "template": { + "name": "java_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "accessapproval", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..01d95d51 --- /dev/null +++ b/synth.py @@ -0,0 +1,33 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +service = 'accessapproval' +versions = ['v1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + package_pattern='com.google.cloud.{service}.{version}', + proto_path=f'google/cloud/{service}/{version}', + bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', + ) + +java.common_templates() diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..949ed346 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +proto-google-cloud-accessapproval-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-accessapproval-v1:0.0.0:0.0.1-SNAPSHOT +google-cloud-accessapproval:0.0.0:0.0.1-SNAPSHOT