diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b2d0ed5 --- /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-accesscontextmanager/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. accesscontextmanager 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 0000000..754e30c --- /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 0000000..9958690 --- /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 0000000..1c97d5e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-accesscontextmanager/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 0000000..dce2c84 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 0000000..f247d5c --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fadd6af --- /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 0000000..e3ea7fd --- /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-accesscontextmanager/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 0000000..292f5e7 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-accesscontextmanager +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 0000000..5cf7ba4 --- /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 0000000..6cded8d --- /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-accesscontextmanager/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accesscontextmanager/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 0000000..a3bbc5f --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# set -eo pipefail + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + echo "${command}" + ${command} + exit_code=$? + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 0000000..099b0d6 --- /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-accesscontextmanager/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accesscontextmanager/.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 0000000..dde68ca --- /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-accesscontextmanager/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 0000000..3b017fc --- /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 0000000..709f2b4 --- /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 0000000..cb24f44 --- /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 0000000..f1ae14b --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 0000000..ae1a716 --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 0000000..495cc7b --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 0000000..6d323c8 --- /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 0000000..2e8bd1a --- /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-accesscontextmanager/.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-accesscontextmanager/.kokoro/continuous/propose_release.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 0000000..fa7b493 --- /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 0000000..0aade87 --- /dev/null +++ b/.kokoro/dependencies.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 + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 0000000..759ab4e --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +# Display commands being run. +set -x + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 0000000..099b0d6 --- /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-accesscontextmanager/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accesscontextmanager/.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 0000000..dde68ca --- /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-accesscontextmanager/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 0000000..8bf59c0 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,21 @@ +# 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: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 0000000..709f2b4 --- /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 0000000..cb24f44 --- /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 0000000..f1ae14b --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 0000000..ae1a716 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 0000000..495cc7b --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 0000000..6d323c8 --- /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 0000000..b4b051c --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,36 @@ +# 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" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 0000000..ec57244 --- /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 0000000..2885ede --- /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-accesscontextmanager/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-accesscontextmanager/.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 0000000..dde68ca --- /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-accesscontextmanager/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 0000000..141f90c --- /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 0000000..709f2b4 --- /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 0000000..cb24f44 --- /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 0000000..f1ae14b --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 0000000..ae1a716 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-accesscontextmanager/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 0000000..495cc7b --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 0000000..319c9ff --- /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-accesscontextmanager/.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 0000000..6d323c8 --- /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 0000000..fa7b493 --- /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 0000000..7167943 --- /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-accesscontextmanager/.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-accesscontextmanager/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 0000000..75ee87d --- /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-accesscontextmanager/.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 0000000..6e3f659 --- /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 0000000..209b72f --- /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-accesscontextmanager/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 0000000..5c4551e --- /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 0000000..5a23f30 --- /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-accesscontextmanager/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 0000000..1fa95fa --- /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 0000000..10ac0ab --- /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-accesscontextmanager/.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 0000000..45dde10 --- /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=proto-google-identity-accesscontextmanager-v1 +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 0000000..050a7fc --- /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-accesscontextmanager/.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 0000000..098168a --- /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 0000000..32c7468 --- /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-accesscontextmanager/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-accesscontextmanager/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-accesscontextmanager" + } +} + +# 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 0000000..3c482cb --- /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 0000000..ba17ce0 --- /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 0000000..23f5577 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "name": "accesscontextmanager", + "name_pretty": "Identity Access Context Manager", + "product_documentation": "n/a", + "api_description": "n/a", + "client_documentation": "https://googleapis.dev/java/proto-google-identity-accesscontextmanager-v1/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "requires_billing": true, + "language": "java", + "repo": "googleapis/java-accesscontextmanager", + "repo_short": "java-accesscontextmanager", + "distribution_name": "com.google.api.grpc:proto-google-identity-accesscontextmanager-v1" +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6b2238b --- /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 0000000..085021d --- /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 0000000..d645695 --- /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 0000000..62b2ddf --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# Google Identity Access Context Manager Client for Java + +Java protobuf classes for [Identity Access Context Manager][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. + +## 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]: TODO +[javadocs]: https://googleapis.dev/java/google-cloud-accesscontextmanager/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-accesscontextmanager/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-accesscontextmanager.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-accesscontextmanager&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-accesscontextmanager/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-accesscontextmanager/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-accesscontextmanager/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing + +[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 0000000..5724ea9 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/java.header b/java.header new file mode 100644 index 0000000..3a9b503 --- /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 0000000..6597fce --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d3e87b5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,167 @@ + + + 4.0.0 + com.google.cloud + google-identity-accesscontextmanager-parent + pom + 0.0.1-SNAPSHOT + Google Identity Access Context Manager Parent + https://github.com/googleapis/java-accesscontextmanager + + 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-accesscontextmanager.git + scm:git:git@github.com:googleapis/java-accesscontextmanager.git + https://github.com/googleapis/java-accesscontextmanager + HEAD + + + https://github.com/googleapis/java-accesscontextmanager/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-identity-accesscontextmanager-parent + 1.17.0 + 3.11.4 + 4.13 + + + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.api.grpc + proto-google-common-protos + ${google.common-protos.version} + + + + junit + junit + ${junit.version} + test + + + + + + proto-google-identity-accesscontextmanager-type + proto-google-identity-accesscontextmanager-v1 + + + + + + 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.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + diff --git a/proto-google-identity-accesscontextmanager-type/pom.xml b/proto-google-identity-accesscontextmanager-type/pom.xml new file mode 100644 index 0000000..f2dbdd9 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + com.google.api.grpc + proto-google-identity-accesscontextmanager-type + 0.0.1-SNAPSHOT + proto-google-identity-accesscontextmanager-type + PROTO library for proto-google-identity-accesscontextmanager-type + + com.google.cloud + google-identity-accesscontextmanager-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + \ No newline at end of file diff --git a/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceEncryptionStatus.java b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceEncryptionStatus.java new file mode 100644 index 0000000..ed72197 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceEncryptionStatus.java @@ -0,0 +1,199 @@ +/* + * 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/identity/accesscontextmanager/type/device_resources.proto + +package com.google.identity.accesscontextmanager.type; + +/** + * + * + *
+ * The encryption state of the device.
+ * 
+ * + * Protobuf enum {@code google.identity.accesscontextmanager.type.DeviceEncryptionStatus} + */ +public enum DeviceEncryptionStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The encryption status of the device is not specified or not known.
+   * 
+ * + * ENCRYPTION_UNSPECIFIED = 0; + */ + ENCRYPTION_UNSPECIFIED(0), + /** + * + * + *
+   * The device does not support encryption.
+   * 
+ * + * ENCRYPTION_UNSUPPORTED = 1; + */ + ENCRYPTION_UNSUPPORTED(1), + /** + * + * + *
+   * The device supports encryption, but is currently unencrypted.
+   * 
+ * + * UNENCRYPTED = 2; + */ + UNENCRYPTED(2), + /** + * + * + *
+   * The device is encrypted.
+   * 
+ * + * ENCRYPTED = 3; + */ + ENCRYPTED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The encryption status of the device is not specified or not known.
+   * 
+ * + * ENCRYPTION_UNSPECIFIED = 0; + */ + public static final int ENCRYPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The device does not support encryption.
+   * 
+ * + * ENCRYPTION_UNSUPPORTED = 1; + */ + public static final int ENCRYPTION_UNSUPPORTED_VALUE = 1; + /** + * + * + *
+   * The device supports encryption, but is currently unencrypted.
+   * 
+ * + * UNENCRYPTED = 2; + */ + public static final int UNENCRYPTED_VALUE = 2; + /** + * + * + *
+   * The device is encrypted.
+   * 
+ * + * ENCRYPTED = 3; + */ + public static final int ENCRYPTED_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 DeviceEncryptionStatus 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 DeviceEncryptionStatus forNumber(int value) { + switch (value) { + case 0: + return ENCRYPTION_UNSPECIFIED; + case 1: + return ENCRYPTION_UNSUPPORTED; + case 2: + return UNENCRYPTED; + case 3: + return ENCRYPTED; + 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 DeviceEncryptionStatus findValueByNumber(int number) { + return DeviceEncryptionStatus.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.identity.accesscontextmanager.type.TypeProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DeviceEncryptionStatus[] VALUES = values(); + + public static DeviceEncryptionStatus 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 DeviceEncryptionStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.type.DeviceEncryptionStatus) +} diff --git a/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceManagementLevel.java b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceManagementLevel.java new file mode 100644 index 0000000..2f5eb99 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceManagementLevel.java @@ -0,0 +1,205 @@ +/* + * 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/identity/accesscontextmanager/type/device_resources.proto + +package com.google.identity.accesscontextmanager.type; + +/** + * + * + *
+ * The degree to which the device is managed by the Cloud organization.
+ * 
+ * + * Protobuf enum {@code google.identity.accesscontextmanager.type.DeviceManagementLevel} + */ +public enum DeviceManagementLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The device's management level is not specified or not known.
+   * 
+ * + * MANAGEMENT_UNSPECIFIED = 0; + */ + MANAGEMENT_UNSPECIFIED(0), + /** + * + * + *
+   * The device is not managed.
+   * 
+ * + * NONE = 1; + */ + NONE(1), + /** + * + * + *
+   * Basic management is enabled, which is generally limited to monitoring and
+   * wiping the corporate account.
+   * 
+ * + * BASIC = 2; + */ + BASIC(2), + /** + * + * + *
+   * Complete device management. This includes more thorough monitoring and the
+   * ability to directly manage the device (such as remote wiping). This can be
+   * enabled through the Android Enterprise Platform.
+   * 
+ * + * COMPLETE = 3; + */ + COMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The device's management level is not specified or not known.
+   * 
+ * + * MANAGEMENT_UNSPECIFIED = 0; + */ + public static final int MANAGEMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The device is not managed.
+   * 
+ * + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * + * + *
+   * Basic management is enabled, which is generally limited to monitoring and
+   * wiping the corporate account.
+   * 
+ * + * BASIC = 2; + */ + public static final int BASIC_VALUE = 2; + /** + * + * + *
+   * Complete device management. This includes more thorough monitoring and the
+   * ability to directly manage the device (such as remote wiping). This can be
+   * enabled through the Android Enterprise Platform.
+   * 
+ * + * COMPLETE = 3; + */ + public static final int COMPLETE_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 DeviceManagementLevel 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 DeviceManagementLevel forNumber(int value) { + switch (value) { + case 0: + return MANAGEMENT_UNSPECIFIED; + case 1: + return NONE; + case 2: + return BASIC; + case 3: + return COMPLETE; + 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 DeviceManagementLevel findValueByNumber(int number) { + return DeviceManagementLevel.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.identity.accesscontextmanager.type.TypeProto.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final DeviceManagementLevel[] VALUES = values(); + + public static DeviceManagementLevel 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 DeviceManagementLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.type.DeviceManagementLevel) +} diff --git a/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/OsType.java b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/OsType.java new file mode 100644 index 0000000..14a3c2b --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/OsType.java @@ -0,0 +1,263 @@ +/* + * 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/identity/accesscontextmanager/type/device_resources.proto + +package com.google.identity.accesscontextmanager.type; + +/** + * + * + *
+ * The operating system type of the device.
+ * Next id: 7
+ * 
+ * + * Protobuf enum {@code google.identity.accesscontextmanager.type.OsType} + */ +public enum OsType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The operating system of the device is not specified or not known.
+   * 
+ * + * OS_UNSPECIFIED = 0; + */ + OS_UNSPECIFIED(0), + /** + * + * + *
+   * A desktop Mac operating system.
+   * 
+ * + * DESKTOP_MAC = 1; + */ + DESKTOP_MAC(1), + /** + * + * + *
+   * A desktop Windows operating system.
+   * 
+ * + * DESKTOP_WINDOWS = 2; + */ + DESKTOP_WINDOWS(2), + /** + * + * + *
+   * A desktop Linux operating system.
+   * 
+ * + * DESKTOP_LINUX = 3; + */ + DESKTOP_LINUX(3), + /** + * + * + *
+   * A desktop ChromeOS operating system.
+   * 
+ * + * DESKTOP_CHROME_OS = 6; + */ + DESKTOP_CHROME_OS(6), + /** + * + * + *
+   * An Android operating system.
+   * 
+ * + * ANDROID = 4; + */ + ANDROID(4), + /** + * + * + *
+   * An iOS operating system.
+   * 
+ * + * IOS = 5; + */ + IOS(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The operating system of the device is not specified or not known.
+   * 
+ * + * OS_UNSPECIFIED = 0; + */ + public static final int OS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * A desktop Mac operating system.
+   * 
+ * + * DESKTOP_MAC = 1; + */ + public static final int DESKTOP_MAC_VALUE = 1; + /** + * + * + *
+   * A desktop Windows operating system.
+   * 
+ * + * DESKTOP_WINDOWS = 2; + */ + public static final int DESKTOP_WINDOWS_VALUE = 2; + /** + * + * + *
+   * A desktop Linux operating system.
+   * 
+ * + * DESKTOP_LINUX = 3; + */ + public static final int DESKTOP_LINUX_VALUE = 3; + /** + * + * + *
+   * A desktop ChromeOS operating system.
+   * 
+ * + * DESKTOP_CHROME_OS = 6; + */ + public static final int DESKTOP_CHROME_OS_VALUE = 6; + /** + * + * + *
+   * An Android operating system.
+   * 
+ * + * ANDROID = 4; + */ + public static final int ANDROID_VALUE = 4; + /** + * + * + *
+   * An iOS operating system.
+   * 
+ * + * IOS = 5; + */ + public static final int IOS_VALUE = 5; + + 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 OsType 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 OsType forNumber(int value) { + switch (value) { + case 0: + return OS_UNSPECIFIED; + case 1: + return DESKTOP_MAC; + case 2: + return DESKTOP_WINDOWS; + case 3: + return DESKTOP_LINUX; + case 6: + return DESKTOP_CHROME_OS; + case 4: + return ANDROID; + case 5: + return IOS; + 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 OsType findValueByNumber(int number) { + return OsType.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.identity.accesscontextmanager.type.TypeProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final OsType[] VALUES = values(); + + public static OsType 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 OsType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.type.OsType) +} diff --git a/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/TypeProto.java b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/TypeProto.java new file mode 100644 index 0000000..aa3ff42 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/TypeProto.java @@ -0,0 +1,68 @@ +/* + * 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/identity/accesscontextmanager/type/device_resources.proto + +package com.google.identity.accesscontextmanager.type; + +public final class TypeProto { + private TypeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n@google/identity/accesscontextmanager/t" + + "ype/device_resources.proto\022)google.ident" + + "ity.accesscontextmanager.type\032\034google/ap" + + "i/annotations.proto*p\n\026DeviceEncryptionS" + + "tatus\022\032\n\026ENCRYPTION_UNSPECIFIED\020\000\022\032\n\026ENC" + + "RYPTION_UNSUPPORTED\020\001\022\017\n\013UNENCRYPTED\020\002\022\r" + + "\n\tENCRYPTED\020\003*\202\001\n\006OsType\022\022\n\016OS_UNSPECIFI" + + "ED\020\000\022\017\n\013DESKTOP_MAC\020\001\022\023\n\017DESKTOP_WINDOWS" + + "\020\002\022\021\n\rDESKTOP_LINUX\020\003\022\025\n\021DESKTOP_CHROME_" + + "OS\020\006\022\013\n\007ANDROID\020\004\022\007\n\003IOS\020\005*V\n\025DeviceMana" + + "gementLevel\022\032\n\026MANAGEMENT_UNSPECIFIED\020\000\022" + + "\010\n\004NONE\020\001\022\t\n\005BASIC\020\002\022\014\n\010COMPLETE\020\003B\222\002\n-c" + + "om.google.identity.accesscontextmanager." + + "typeB\tTypeProtoP\001ZMgoogle.golang.org/gen" + + "proto/googleapis/identity/accesscontextm" + + "anager/type;type\252\002)Google.Identity.Acces" + + "sContextManager.Type\312\002)Google\\Identity\\A" + + "ccessContextManager\\Type\352\002,Google::Ident" + + "ity::AccessContextManager::Typeb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-identity-accesscontextmanager-type/src/main/proto/google/identity/accesscontextmanager/type/device_resources.proto b/proto-google-identity-accesscontextmanager-type/src/main/proto/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 0000000..f057910 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-type/src/main/proto/google/identity/accesscontextmanager/type/device_resources.proto @@ -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 +// +// 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.identity.accesscontextmanager.type; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type;type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/proto-google-identity-accesscontextmanager-v1/pom.xml b/proto-google-identity-accesscontextmanager-v1/pom.xml new file mode 100644 index 0000000..2345ea2 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + com.google.api.grpc + proto-google-identity-accesscontextmanager-v1 + 0.0.1-SNAPSHOT + proto-google-identity-accesscontextmanager-v1 + PROTO library for proto-google-identity-accesscontextmanager-v1 + + com.google.cloud + google-identity-accesscontextmanager-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-identity-accesscontextmanager-type + 0.0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevel.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevel.java new file mode 100644 index 0000000..598d632 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevel.java @@ -0,0 +1,2233 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * An `AccessLevel` is a label that can be applied to requests to Google Cloud
+ * services, along with a list of requirements necessary for the label to be
+ * applied.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.AccessLevel} + */ +public final class AccessLevel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.AccessLevel) + AccessLevelOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessLevel.newBuilder() to construct. + private AccessLevel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessLevel() { + name_ = ""; + title_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessLevel(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessLevel( + 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(); + + title_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder subBuilder = null; + if (levelCase_ == 4) { + subBuilder = + ((com.google.identity.accesscontextmanager.v1.BasicLevel) level_).toBuilder(); + } + level_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.BasicLevel.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.identity.accesscontextmanager.v1.BasicLevel) level_); + level_ = subBuilder.buildPartial(); + } + levelCase_ = 4; + break; + } + case 42: + { + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder subBuilder = null; + if (levelCase_ == 5) { + subBuilder = + ((com.google.identity.accesscontextmanager.v1.CustomLevel) level_).toBuilder(); + } + level_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.CustomLevel.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.identity.accesscontextmanager.v1.CustomLevel) level_); + level_ = subBuilder.buildPartial(); + } + levelCase_ = 5; + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + 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.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_AccessLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_AccessLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.AccessLevel.class, + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder.class); + } + + private int levelCase_ = 0; + private java.lang.Object level_; + + public enum LevelCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BASIC(4), + CUSTOM(5), + LEVEL_NOT_SET(0); + private final int value; + + private LevelCase(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 LevelCase valueOf(int value) { + return forNumber(value); + } + + public static LevelCase forNumber(int value) { + switch (value) { + case 4: + return BASIC; + case 5: + return CUSTOM; + case 0: + return LEVEL_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LevelCase getLevelCase() { + return LevelCase.forNumber(levelCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name for the Access Level. The `short_name` component
+   * must begin with a letter and only include alphanumeric and '_'. Format:
+   * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+   * of the `short_name` component is 50 characters.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Required. Resource name for the Access Level. The `short_name` component
+   * must begin with a letter and only include alphanumeric and '_'. Format:
+   * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+   * of the `short_name` component is 50 characters.
+   * 
+ * + * 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 TITLE_FIELD_NUMBER = 2; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of the `AccessLevel` and its use. Does not affect behavior.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of the `AccessLevel` and its use. Does not affect behavior.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BASIC_FIELD_NUMBER = 4; + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return Whether the basic field is set. + */ + public boolean hasBasic() { + return levelCase_ == 4; + } + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return The basic. + */ + public com.google.identity.accesscontextmanager.v1.BasicLevel getBasic() { + if (levelCase_ == 4) { + return (com.google.identity.accesscontextmanager.v1.BasicLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder getBasicOrBuilder() { + if (levelCase_ == 4) { + return (com.google.identity.accesscontextmanager.v1.BasicLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + + public static final int CUSTOM_FIELD_NUMBER = 5; + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return Whether the custom field is set. + */ + public boolean hasCustom() { + return levelCase_ == 5; + } + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return The custom. + */ + public com.google.identity.accesscontextmanager.v1.CustomLevel getCustom() { + if (levelCase_ == 5) { + return (com.google.identity.accesscontextmanager.v1.CustomLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder getCustomOrBuilder() { + if (levelCase_ == 5) { + return (com.google.identity.accesscontextmanager.v1.CustomLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (levelCase_ == 4) { + output.writeMessage(4, (com.google.identity.accesscontextmanager.v1.BasicLevel) level_); + } + if (levelCase_ == 5) { + output.writeMessage(5, (com.google.identity.accesscontextmanager.v1.CustomLevel) level_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + 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 (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (levelCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.identity.accesscontextmanager.v1.BasicLevel) level_); + } + if (levelCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.identity.accesscontextmanager.v1.CustomLevel) level_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + 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.identity.accesscontextmanager.v1.AccessLevel)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.AccessLevel other = + (com.google.identity.accesscontextmanager.v1.AccessLevel) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getLevelCase().equals(other.getLevelCase())) return false; + switch (levelCase_) { + case 4: + if (!getBasic().equals(other.getBasic())) return false; + break; + case 5: + if (!getCustom().equals(other.getCustom())) 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) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (levelCase_) { + case 4: + hash = (37 * hash) + BASIC_FIELD_NUMBER; + hash = (53 * hash) + getBasic().hashCode(); + break; + case 5: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel 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.identity.accesscontextmanager.v1.AccessLevel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel 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.identity.accesscontextmanager.v1.AccessLevel parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel 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.identity.accesscontextmanager.v1.AccessLevel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel 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.identity.accesscontextmanager.v1.AccessLevel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An `AccessLevel` is a label that can be applied to requests to Google Cloud
+   * services, along with a list of requirements necessary for the label to be
+   * applied.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.AccessLevel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.AccessLevel) + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_AccessLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_AccessLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.AccessLevel.class, + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.AccessLevel.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_ = ""; + + title_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + levelCase_ = 0; + level_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_AccessLevel_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevel getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevel build() { + com.google.identity.accesscontextmanager.v1.AccessLevel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevel buildPartial() { + com.google.identity.accesscontextmanager.v1.AccessLevel result = + new com.google.identity.accesscontextmanager.v1.AccessLevel(this); + result.name_ = name_; + result.title_ = title_; + result.description_ = description_; + if (levelCase_ == 4) { + if (basicBuilder_ == null) { + result.level_ = level_; + } else { + result.level_ = basicBuilder_.build(); + } + } + if (levelCase_ == 5) { + if (customBuilder_ == null) { + result.level_ = level_; + } else { + result.level_ = customBuilder_.build(); + } + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.levelCase_ = levelCase_; + 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.identity.accesscontextmanager.v1.AccessLevel) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.AccessLevel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.AccessLevel other) { + if (other == com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getLevelCase()) { + case BASIC: + { + mergeBasic(other.getBasic()); + break; + } + case CUSTOM: + { + mergeCustom(other.getCustom()); + break; + } + case LEVEL_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.identity.accesscontextmanager.v1.AccessLevel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.AccessLevel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int levelCase_ = 0; + private java.lang.Object level_; + + public LevelCase getLevelCase() { + return LevelCase.forNumber(levelCase_); + } + + public Builder clearLevel() { + levelCase_ = 0; + level_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name for the Access Level. The `short_name` component
+     * must begin with a letter and only include alphanumeric and '_'. Format:
+     * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+     * of the `short_name` component is 50 characters.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Required. Resource name for the Access Level. The `short_name` component
+     * must begin with a letter and only include alphanumeric and '_'. Format:
+     * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+     * of the `short_name` component is 50 characters.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Required. Resource name for the Access Level. The `short_name` component
+     * must begin with a letter and only include alphanumeric and '_'. Format:
+     * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+     * of the `short_name` component is 50 characters.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Required. Resource name for the Access Level. The `short_name` component
+     * must begin with a letter and only include alphanumeric and '_'. Format:
+     * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+     * of the `short_name` component is 50 characters.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for the Access Level. The `short_name` component
+     * must begin with a letter and only include alphanumeric and '_'. Format:
+     * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+     * of the `short_name` component is 50 characters.
+     * 
+ * + * 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 title_ = ""; + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the `AccessLevel` and its use. Does not affect behavior.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of the `AccessLevel` and its use. Does not affect behavior.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of the `AccessLevel` and its use. Does not affect behavior.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the `AccessLevel` and its use. Does not affect behavior.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the `AccessLevel` and its use. Does not affect behavior.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.BasicLevel, + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder, + com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder> + basicBuilder_; + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return Whether the basic field is set. + */ + public boolean hasBasic() { + return levelCase_ == 4; + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return The basic. + */ + public com.google.identity.accesscontextmanager.v1.BasicLevel getBasic() { + if (basicBuilder_ == null) { + if (levelCase_ == 4) { + return (com.google.identity.accesscontextmanager.v1.BasicLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } else { + if (levelCase_ == 4) { + return basicBuilder_.getMessage(); + } + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public Builder setBasic(com.google.identity.accesscontextmanager.v1.BasicLevel value) { + if (basicBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + level_ = value; + onChanged(); + } else { + basicBuilder_.setMessage(value); + } + levelCase_ = 4; + return this; + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public Builder setBasic( + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder builderForValue) { + if (basicBuilder_ == null) { + level_ = builderForValue.build(); + onChanged(); + } else { + basicBuilder_.setMessage(builderForValue.build()); + } + levelCase_ = 4; + return this; + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public Builder mergeBasic(com.google.identity.accesscontextmanager.v1.BasicLevel value) { + if (basicBuilder_ == null) { + if (levelCase_ == 4 + && level_ + != com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance()) { + level_ = + com.google.identity.accesscontextmanager.v1.BasicLevel.newBuilder( + (com.google.identity.accesscontextmanager.v1.BasicLevel) level_) + .mergeFrom(value) + .buildPartial(); + } else { + level_ = value; + } + onChanged(); + } else { + if (levelCase_ == 4) { + basicBuilder_.mergeFrom(value); + } + basicBuilder_.setMessage(value); + } + levelCase_ = 4; + return this; + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public Builder clearBasic() { + if (basicBuilder_ == null) { + if (levelCase_ == 4) { + levelCase_ = 0; + level_ = null; + onChanged(); + } + } else { + if (levelCase_ == 4) { + levelCase_ = 0; + level_ = null; + } + basicBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public com.google.identity.accesscontextmanager.v1.BasicLevel.Builder getBasicBuilder() { + return getBasicFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + public com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder getBasicOrBuilder() { + if ((levelCase_ == 4) && (basicBuilder_ != null)) { + return basicBuilder_.getMessageOrBuilder(); + } else { + if (levelCase_ == 4) { + return (com.google.identity.accesscontextmanager.v1.BasicLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * A `BasicLevel` composed of `Conditions`.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.BasicLevel, + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder, + com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder> + getBasicFieldBuilder() { + if (basicBuilder_ == null) { + if (!(levelCase_ == 4)) { + level_ = com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + basicBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.BasicLevel, + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder, + com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder>( + (com.google.identity.accesscontextmanager.v1.BasicLevel) level_, + getParentForChildren(), + isClean()); + level_ = null; + } + levelCase_ = 4; + onChanged(); + ; + return basicBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.CustomLevel, + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder, + com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder> + customBuilder_; + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return Whether the custom field is set. + */ + public boolean hasCustom() { + return levelCase_ == 5; + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return The custom. + */ + public com.google.identity.accesscontextmanager.v1.CustomLevel getCustom() { + if (customBuilder_ == null) { + if (levelCase_ == 5) { + return (com.google.identity.accesscontextmanager.v1.CustomLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } else { + if (levelCase_ == 5) { + return customBuilder_.getMessage(); + } + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public Builder setCustom(com.google.identity.accesscontextmanager.v1.CustomLevel value) { + if (customBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + level_ = value; + onChanged(); + } else { + customBuilder_.setMessage(value); + } + levelCase_ = 5; + return this; + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public Builder setCustom( + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder builderForValue) { + if (customBuilder_ == null) { + level_ = builderForValue.build(); + onChanged(); + } else { + customBuilder_.setMessage(builderForValue.build()); + } + levelCase_ = 5; + return this; + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public Builder mergeCustom(com.google.identity.accesscontextmanager.v1.CustomLevel value) { + if (customBuilder_ == null) { + if (levelCase_ == 5 + && level_ + != com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance()) { + level_ = + com.google.identity.accesscontextmanager.v1.CustomLevel.newBuilder( + (com.google.identity.accesscontextmanager.v1.CustomLevel) level_) + .mergeFrom(value) + .buildPartial(); + } else { + level_ = value; + } + onChanged(); + } else { + if (levelCase_ == 5) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); + } + levelCase_ = 5; + return this; + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public Builder clearCustom() { + if (customBuilder_ == null) { + if (levelCase_ == 5) { + levelCase_ = 0; + level_ = null; + onChanged(); + } + } else { + if (levelCase_ == 5) { + levelCase_ = 0; + level_ = null; + } + customBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public com.google.identity.accesscontextmanager.v1.CustomLevel.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + public com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder getCustomOrBuilder() { + if ((levelCase_ == 5) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); + } else { + if (levelCase_ == 5) { + return (com.google.identity.accesscontextmanager.v1.CustomLevel) level_; + } + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * A `CustomLevel` written in the Common Expression Language.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.CustomLevel, + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder, + com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(levelCase_ == 5)) { + level_ = com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + customBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.CustomLevel, + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder, + com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder>( + (com.google.identity.accesscontextmanager.v1.CustomLevel) level_, + getParentForChildren(), + isClean()); + level_ = null; + } + levelCase_ = 5; + onChanged(); + ; + return customBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time the `AccessLevel` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.identity.accesscontextmanager.v1.AccessLevel) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.AccessLevel) + private static final com.google.identity.accesscontextmanager.v1.AccessLevel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.AccessLevel(); + } + + public static com.google.identity.accesscontextmanager.v1.AccessLevel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessLevel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessLevel(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.identity.accesscontextmanager.v1.AccessLevel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelOrBuilder.java new file mode 100644 index 0000000..54287d5 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelOrBuilder.java @@ -0,0 +1,248 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface AccessLevelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.AccessLevel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name for the Access Level. The `short_name` component
+   * must begin with a letter and only include alphanumeric and '_'. Format:
+   * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+   * of the `short_name` component is 50 characters.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name for the Access Level. The `short_name` component
+   * must begin with a letter and only include alphanumeric and '_'. Format:
+   * `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length
+   * of the `short_name` component is 50 characters.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Description of the `AccessLevel` and its use. Does not affect behavior.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the `AccessLevel` and its use. Does not affect behavior.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return Whether the basic field is set. + */ + boolean hasBasic(); + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + * + * @return The basic. + */ + com.google.identity.accesscontextmanager.v1.BasicLevel getBasic(); + /** + * + * + *
+   * A `BasicLevel` composed of `Conditions`.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.BasicLevel basic = 4; + */ + com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder getBasicOrBuilder(); + + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return Whether the custom field is set. + */ + boolean hasCustom(); + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + * + * @return The custom. + */ + com.google.identity.accesscontextmanager.v1.CustomLevel getCustom(); + /** + * + * + *
+   * A `CustomLevel` written in the Common Expression Language.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.CustomLevel custom = 5; + */ + com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder getCustomOrBuilder(); + + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the `AccessLevel` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time the `AccessLevel` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + public com.google.identity.accesscontextmanager.v1.AccessLevel.LevelCase getLevelCase(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelProto.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelProto.java new file mode 100644 index 0000000..585c365 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessLevelProto.java @@ -0,0 +1,193 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public final class AccessLevelProto { + private AccessLevelProto() {} + + 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_identity_accesscontextmanager_v1_AccessLevel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_AccessLevel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_BasicLevel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_Condition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_CustomLevel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_OsConstraint_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n:google/identity/accesscontextmanager/v" + + "1/access_level.proto\022\'google.identity.ac" + + "cesscontextmanager.v1\032@google/identity/a" + + "ccesscontextmanager/type/device_resource" + + "s.proto\032\037google/protobuf/timestamp.proto" + + "\032\026google/type/expr.proto\032\034google/api/ann" + + "otations.proto\"\270\002\n\013AccessLevel\022\014\n\004name\030\001" + + " \001(\t\022\r\n\005title\030\002 \001(\t\022\023\n\013description\030\003 \001(\t" + + "\022D\n\005basic\030\004 \001(\01323.google.identity.access" + + "contextmanager.v1.BasicLevelH\000\022F\n\006custom" + + "\030\005 \001(\01324.google.identity.accesscontextma" + + "nager.v1.CustomLevelH\000\022/\n\013create_time\030\006 " + + "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat" + + "e_time\030\007 \001(\0132\032.google.protobuf.Timestamp" + + "B\007\n\005level\"\357\001\n\nBasicLevel\022F\n\nconditions\030\001" + + " \003(\01322.google.identity.accesscontextmana" + + "ger.v1.Condition\022j\n\022combining_function\030\002" + + " \001(\0162N.google.identity.accesscontextmana" + + "ger.v1.BasicLevel.ConditionCombiningFunc" + + "tion\"-\n\032ConditionCombiningFunction\022\007\n\003AN" + + "D\020\000\022\006\n\002OR\020\001\"\303\001\n\tCondition\022\026\n\016ip_subnetwo" + + "rks\030\001 \003(\t\022L\n\rdevice_policy\030\002 \001(\01325.googl" + + "e.identity.accesscontextmanager.v1.Devic" + + "ePolicy\022\036\n\026required_access_levels\030\003 \003(\t\022" + + "\016\n\006negate\030\005 \001(\010\022\017\n\007members\030\006 \003(\t\022\017\n\007regi" + + "ons\030\007 \003(\t\".\n\013CustomLevel\022\037\n\004expr\030\001 \001(\0132\021" + + ".google.type.Expr\"\211\003\n\014DevicePolicy\022\032\n\022re" + + "quire_screenlock\030\001 \001(\010\022f\n\033allowed_encryp" + + "tion_statuses\030\002 \003(\0162A.google.identity.ac" + + "cesscontextmanager.type.DeviceEncryption" + + "Status\022M\n\016os_constraints\030\003 \003(\01325.google." + + "identity.accesscontextmanager.v1.OsConst" + + "raint\022j\n allowed_device_management_level" + + "s\030\006 \003(\0162@.google.identity.accesscontextm" + + "anager.type.DeviceManagementLevel\022\036\n\026req" + + "uire_admin_approval\030\007 \001(\010\022\032\n\022require_cor" + + "p_owned\030\010 \001(\010\"\217\001\n\014OsConstraint\022B\n\007os_typ" + + "e\030\001 \001(\01621.google.identity.accesscontextm" + + "anager.type.OsType\022\027\n\017minimum_version\030\002 " + + "\001(\t\022\"\n\032require_verified_chrome_os\030\003 \001(\010B" + + "\246\002\n+com.google.identity.accesscontextman" + + "ager.v1B\020AccessLevelProtoP\001Z[google.gola" + + "ng.org/genproto/googleapis/identity/acce" + + "sscontextmanager/v1;accesscontextmanager" + + "\242\002\004GACM\252\002\'Google.Identity.AccessContextM" + + "anager.V1\312\002\'Google\\Identity\\AccessContex" + + "tManager\\V1\352\002*Google::Identity::AccessCo" + + "ntextManager::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.identity.accesscontextmanager.type.TypeProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.ExprProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_identity_accesscontextmanager_v1_AccessLevel_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_identity_accesscontextmanager_v1_AccessLevel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_AccessLevel_descriptor, + new java.lang.String[] { + "Name", + "Title", + "Description", + "Basic", + "Custom", + "CreateTime", + "UpdateTime", + "Level", + }); + internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_identity_accesscontextmanager_v1_BasicLevel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor, + new java.lang.String[] { + "Conditions", "CombiningFunction", + }); + internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_identity_accesscontextmanager_v1_Condition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor, + new java.lang.String[] { + "IpSubnetworks", + "DevicePolicy", + "RequiredAccessLevels", + "Negate", + "Members", + "Regions", + }); + internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_identity_accesscontextmanager_v1_CustomLevel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor, + new java.lang.String[] { + "Expr", + }); + internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor, + new java.lang.String[] { + "RequireScreenlock", + "AllowedEncryptionStatuses", + "OsConstraints", + "AllowedDeviceManagementLevels", + "RequireAdminApproval", + "RequireCorpOwned", + }); + internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_identity_accesscontextmanager_v1_OsConstraint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor, + new java.lang.String[] { + "OsType", "MinimumVersion", "RequireVerifiedChromeOs", + }); + com.google.identity.accesscontextmanager.type.TypeProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.ExprProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicy.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicy.java new file mode 100644 index 0000000..9529b0a --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicy.java @@ -0,0 +1,1754 @@ +/* + * 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/identity/accesscontextmanager/v1/access_policy.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `AccessPolicy` is a container for `AccessLevels` (which define the necessary
+ * attributes to use Google Cloud services) and `ServicePerimeters` (which
+ * define regions of services able to freely pass data within a perimeter). An
+ * access policy is globally visible within an organization, and the
+ * restrictions it specifies apply to all projects within an organization.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.AccessPolicy} + */ +public final class AccessPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.AccessPolicy) + AccessPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessPolicy.newBuilder() to construct. + private AccessPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessPolicy() { + name_ = ""; + parent_ = ""; + title_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AccessPolicy( + 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(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.PolicyProto + .internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.PolicyProto + .internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.AccessPolicy.class, + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Resource name of the `AccessPolicy`. Format:
+   * `accessPolicies/{policy_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; + } + } + /** + * + * + *
+   * Output only. Resource name of the `AccessPolicy`. Format:
+   * `accessPolicies/{policy_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 PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent of this `AccessPolicy` in the Cloud Resource
+   * Hierarchy. Currently immutable once created. Format:
+   * `organizations/{organization_id}`
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent of this `AccessPolicy` in the Cloud Resource
+   * Hierarchy. Currently immutable once created. Format:
+   * `organizations/{organization_id}`
+   * 
+ * + * string parent = 2; + * + * @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 TITLE_FIELD_NUMBER = 3; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Required. Human readable title. Does not affect behavior.
+   * 
+ * + * string title = 3; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Human readable title. Does not affect behavior.
+   * 
+ * + * string title = 3; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int ETAG_FIELD_NUMBER = 6; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Output only. An opaque identifier for the current version of the
+   * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+   * two Access Polices will be identical if and only if their etags are
+   * identical. Clients should not expect this to be in any specific format.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. An opaque identifier for the current version of the
+   * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+   * two Access Polices will be identical if and only if their etags are
+   * identical. Clients should not expect this to be in any specific format.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, title_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, title_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.identity.accesscontextmanager.v1.AccessPolicy)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.AccessPolicy other = + (com.google.identity.accesscontextmanager.v1.AccessPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy 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.identity.accesscontextmanager.v1.AccessPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy 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.identity.accesscontextmanager.v1.AccessPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy 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.identity.accesscontextmanager.v1.AccessPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy 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.identity.accesscontextmanager.v1.AccessPolicy 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; + } + /** + * + * + *
+   * `AccessPolicy` is a container for `AccessLevels` (which define the necessary
+   * attributes to use Google Cloud services) and `ServicePerimeters` (which
+   * define regions of services able to freely pass data within a perimeter). An
+   * access policy is globally visible within an organization, and the
+   * restrictions it specifies apply to all projects within an organization.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.AccessPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.AccessPolicy) + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.PolicyProto + .internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.PolicyProto + .internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.AccessPolicy.class, + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.AccessPolicy.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_ = ""; + + parent_ = ""; + + title_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.PolicyProto + .internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicy getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicy build() { + com.google.identity.accesscontextmanager.v1.AccessPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicy buildPartial() { + com.google.identity.accesscontextmanager.v1.AccessPolicy result = + new com.google.identity.accesscontextmanager.v1.AccessPolicy(this); + result.name_ = name_; + result.parent_ = parent_; + result.title_ = title_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.identity.accesscontextmanager.v1.AccessPolicy) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.AccessPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.AccessPolicy other) { + if (other == com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.identity.accesscontextmanager.v1.AccessPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.AccessPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Resource name of the `AccessPolicy`. Format:
+     * `accessPolicies/{policy_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; + } + } + /** + * + * + *
+     * Output only. Resource name of the `AccessPolicy`. Format:
+     * `accessPolicies/{policy_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; + } + } + /** + * + * + *
+     * Output only. Resource name of the `AccessPolicy`. Format:
+     * `accessPolicies/{policy_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; + } + /** + * + * + *
+     * Output only. Resource name of the `AccessPolicy`. Format:
+     * `accessPolicies/{policy_id}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the `AccessPolicy`. Format:
+     * `accessPolicies/{policy_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 parent_ = ""; + /** + * + * + *
+     * Required. The parent of this `AccessPolicy` in the Cloud Resource
+     * Hierarchy. Currently immutable once created. Format:
+     * `organizations/{organization_id}`
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent of this `AccessPolicy` in the Cloud Resource
+     * Hierarchy. Currently immutable once created. Format:
+     * `organizations/{organization_id}`
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent of this `AccessPolicy` in the Cloud Resource
+     * Hierarchy. Currently immutable once created. Format:
+     * `organizations/{organization_id}`
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent of this `AccessPolicy` in the Cloud Resource
+     * Hierarchy. Currently immutable once created. Format:
+     * `organizations/{organization_id}`
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent of this `AccessPolicy` in the Cloud Resource
+     * Hierarchy. Currently immutable once created. Format:
+     * `organizations/{organization_id}`
+     * 
+ * + * string parent = 2; + * + * @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 title_ = ""; + /** + * + * + *
+     * Required. Human readable title. Does not affect behavior.
+     * 
+ * + * string title = 3; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Human readable title. Does not affect behavior.
+     * 
+ * + * string title = 3; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Human readable title. Does not affect behavior.
+     * 
+ * + * string title = 3; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human readable title. Does not affect behavior.
+     * 
+ * + * string title = 3; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Human readable title. Does not affect behavior.
+     * 
+ * + * string title = 3; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time the `AccessPolicy` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Output only. An opaque identifier for the current version of the
+     * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+     * two Access Polices will be identical if and only if their etags are
+     * identical. Clients should not expect this to be in any specific format.
+     * 
+ * + * string etag = 6; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. An opaque identifier for the current version of the
+     * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+     * two Access Polices will be identical if and only if their etags are
+     * identical. Clients should not expect this to be in any specific format.
+     * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. An opaque identifier for the current version of the
+     * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+     * two Access Polices will be identical if and only if their etags are
+     * identical. Clients should not expect this to be in any specific format.
+     * 
+ * + * string etag = 6; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An opaque identifier for the current version of the
+     * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+     * two Access Polices will be identical if and only if their etags are
+     * identical. Clients should not expect this to be in any specific format.
+     * 
+ * + * string etag = 6; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. An opaque identifier for the current version of the
+     * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+     * two Access Polices will be identical if and only if their etags are
+     * identical. Clients should not expect this to be in any specific format.
+     * 
+ * + * string etag = 6; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.identity.accesscontextmanager.v1.AccessPolicy) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.AccessPolicy) + private static final com.google.identity.accesscontextmanager.v1.AccessPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.AccessPolicy(); + } + + public static com.google.identity.accesscontextmanager.v1.AccessPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AccessPolicy(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.identity.accesscontextmanager.v1.AccessPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicyOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicyOrBuilder.java new file mode 100644 index 0000000..3b8981e --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessPolicyOrBuilder.java @@ -0,0 +1,207 @@ +/* + * 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/identity/accesscontextmanager/v1/access_policy.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface AccessPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.AccessPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Resource name of the `AccessPolicy`. Format:
+   * `accessPolicies/{policy_id}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Resource name of the `AccessPolicy`. Format:
+   * `accessPolicies/{policy_id}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The parent of this `AccessPolicy` in the Cloud Resource
+   * Hierarchy. Currently immutable once created. Format:
+   * `organizations/{organization_id}`
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent of this `AccessPolicy` in the Cloud Resource
+   * Hierarchy. Currently immutable once created. Format:
+   * `organizations/{organization_id}`
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Human readable title. Does not affect behavior.
+   * 
+ * + * string title = 3; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Required. Human readable title. Does not affect behavior.
+   * 
+ * + * string title = 3; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time the `AccessPolicy` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. An opaque identifier for the current version of the
+   * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+   * two Access Polices will be identical if and only if their etags are
+   * identical. Clients should not expect this to be in any specific format.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Output only. An opaque identifier for the current version of the
+   * `AccessPolicy`. This will always be a strongly validated etag, meaning that
+   * two Access Polices will be identical if and only if their etags are
+   * identical. Clients should not expect this to be in any specific format.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevel.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevel.java new file mode 100644 index 0000000..a17de3d --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevel.java @@ -0,0 +1,1300 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `BasicLevel` is an `AccessLevel` using a set of recommended features.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.BasicLevel} + */ +public final class BasicLevel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.BasicLevel) + BasicLevelOrBuilder { + private static final long serialVersionUID = 0L; + // Use BasicLevel.newBuilder() to construct. + private BasicLevel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BasicLevel() { + conditions_ = java.util.Collections.emptyList(); + combiningFunction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BasicLevel(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BasicLevel( + 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)) { + conditions_ = + new java.util.ArrayList< + com.google.identity.accesscontextmanager.v1.Condition>(); + mutable_bitField0_ |= 0x00000001; + } + conditions_.add( + input.readMessage( + com.google.identity.accesscontextmanager.v1.Condition.parser(), + extensionRegistry)); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + combiningFunction_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + conditions_ = java.util.Collections.unmodifiableList(conditions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_BasicLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.BasicLevel.class, + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder.class); + } + + /** + * + * + *
+   * Options for how the `conditions` list should be combined to determine if
+   * this `AccessLevel` is applied. Default is AND.
+   * 
+ * + * Protobuf enum {@code + * google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} + */ + public enum ConditionCombiningFunction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * All `Conditions` must be true for the `BasicLevel` to be true.
+     * 
+ * + * AND = 0; + */ + AND(0), + /** + * + * + *
+     * If at least one `Condition` is true, then the `BasicLevel` is true.
+     * 
+ * + * OR = 1; + */ + OR(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * All `Conditions` must be true for the `BasicLevel` to be true.
+     * 
+ * + * AND = 0; + */ + public static final int AND_VALUE = 0; + /** + * + * + *
+     * If at least one `Condition` is true, then the `BasicLevel` is true.
+     * 
+ * + * OR = 1; + */ + public static final int OR_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 ConditionCombiningFunction 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 ConditionCombiningFunction forNumber(int value) { + switch (value) { + case 0: + return AND; + case 1: + return OR; + 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 ConditionCombiningFunction findValueByNumber(int number) { + return ConditionCombiningFunction.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.identity.accesscontextmanager.v1.BasicLevel.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ConditionCombiningFunction[] VALUES = values(); + + public static ConditionCombiningFunction 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 ConditionCombiningFunction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction) + } + + public static final int CONDITIONS_FIELD_NUMBER = 1; + private java.util.List conditions_; + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public java.util.List getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public java.util.List + getConditionsOrBuilderList() { + return conditions_; + } + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.Condition getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.ConditionOrBuilder getConditionsOrBuilder( + int index) { + return conditions_.get(index); + } + + public static final int COMBINING_FUNCTION_FIELD_NUMBER = 2; + private int combiningFunction_; + /** + * + * + *
+   * How the `conditions` list should be combined to determine if a request is
+   * granted this `AccessLevel`. If AND is used, each `Condition` in
+   * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+   * is used, at least one `Condition` in `conditions` must be satisfied for the
+   * `AccessLevel` to be applied. Default behavior is AND.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The enum numeric value on the wire for combiningFunction. + */ + public int getCombiningFunctionValue() { + return combiningFunction_; + } + /** + * + * + *
+   * How the `conditions` list should be combined to determine if a request is
+   * granted this `AccessLevel`. If AND is used, each `Condition` in
+   * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+   * is used, at least one `Condition` in `conditions` must be satisfied for the
+   * `AccessLevel` to be applied. Default behavior is AND.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The combiningFunction. + */ + public com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + getCombiningFunction() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction result = + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction.valueOf( + combiningFunction_); + return result == null + ? com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + .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 { + for (int i = 0; i < conditions_.size(); i++) { + output.writeMessage(1, conditions_.get(i)); + } + if (combiningFunction_ + != com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction.AND + .getNumber()) { + output.writeEnum(2, combiningFunction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conditions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, conditions_.get(i)); + } + if (combiningFunction_ + != com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction.AND + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, combiningFunction_); + } + 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.identity.accesscontextmanager.v1.BasicLevel)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.BasicLevel other = + (com.google.identity.accesscontextmanager.v1.BasicLevel) obj; + + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (combiningFunction_ != other.combiningFunction_) 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 (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + hash = (37 * hash) + COMBINING_FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + combiningFunction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel 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.identity.accesscontextmanager.v1.BasicLevel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel 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.identity.accesscontextmanager.v1.BasicLevel parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel 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.identity.accesscontextmanager.v1.BasicLevel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel 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.identity.accesscontextmanager.v1.BasicLevel 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; + } + /** + * + * + *
+   * `BasicLevel` is an `AccessLevel` using a set of recommended features.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.BasicLevel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.BasicLevel) + com.google.identity.accesscontextmanager.v1.BasicLevelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_BasicLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.BasicLevel.class, + com.google.identity.accesscontextmanager.v1.BasicLevel.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.BasicLevel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConditionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conditionsBuilder_.clear(); + } + combiningFunction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_BasicLevel_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.BasicLevel getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.BasicLevel build() { + com.google.identity.accesscontextmanager.v1.BasicLevel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.BasicLevel buildPartial() { + com.google.identity.accesscontextmanager.v1.BasicLevel result = + new com.google.identity.accesscontextmanager.v1.BasicLevel(this); + int from_bitField0_ = bitField0_; + if (conditionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditions_ = java.util.Collections.unmodifiableList(conditions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditions_ = conditions_; + } else { + result.conditions_ = conditionsBuilder_.build(); + } + result.combiningFunction_ = combiningFunction_; + 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.identity.accesscontextmanager.v1.BasicLevel) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.BasicLevel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.BasicLevel other) { + if (other == com.google.identity.accesscontextmanager.v1.BasicLevel.getDefaultInstance()) + return this; + if (conditionsBuilder_ == null) { + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + } else { + if (!other.conditions_.isEmpty()) { + if (conditionsBuilder_.isEmpty()) { + conditionsBuilder_.dispose(); + conditionsBuilder_ = null; + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionsFieldBuilder() + : null; + } else { + conditionsBuilder_.addAllMessages(other.conditions_); + } + } + } + if (other.combiningFunction_ != 0) { + setCombiningFunctionValue(other.getCombiningFunctionValue()); + } + 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.identity.accesscontextmanager.v1.BasicLevel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.BasicLevel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List conditions_ = + java.util.Collections.emptyList(); + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditions_ = + new java.util.ArrayList( + conditions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.Condition, + com.google.identity.accesscontextmanager.v1.Condition.Builder, + com.google.identity.accesscontextmanager.v1.ConditionOrBuilder> + conditionsBuilder_; + + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public java.util.List + getConditionsList() { + if (conditionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditions_); + } else { + return conditionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public int getConditionsCount() { + if (conditionsBuilder_ == null) { + return conditions_.size(); + } else { + return conditionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.Condition getConditions(int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder setConditions( + int index, com.google.identity.accesscontextmanager.v1.Condition value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder setConditions( + int index, com.google.identity.accesscontextmanager.v1.Condition.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder addConditions(com.google.identity.accesscontextmanager.v1.Condition value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + } else { + conditionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder addConditions( + int index, com.google.identity.accesscontextmanager.v1.Condition value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(index, value); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder addConditions( + com.google.identity.accesscontextmanager.v1.Condition.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder addConditions( + int index, com.google.identity.accesscontextmanager.v1.Condition.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder addAllConditions( + java.lang.Iterable + values) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); + } else { + conditionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder clearConditions() { + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public Builder removeConditions(int index) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.remove(index); + onChanged(); + } else { + conditionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.Condition.Builder getConditionsBuilder( + int index) { + return getConditionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.ConditionOrBuilder getConditionsOrBuilder( + int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public java.util.List + getConditionsOrBuilderList() { + if (conditionsBuilder_ != null) { + return conditionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditions_); + } + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.Condition.Builder addConditionsBuilder() { + return getConditionsFieldBuilder() + .addBuilder(com.google.identity.accesscontextmanager.v1.Condition.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public com.google.identity.accesscontextmanager.v1.Condition.Builder addConditionsBuilder( + int index) { + return getConditionsFieldBuilder() + .addBuilder( + index, com.google.identity.accesscontextmanager.v1.Condition.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of requirements for the `AccessLevel` to be granted.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + public java.util.List + getConditionsBuilderList() { + return getConditionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.Condition, + com.google.identity.accesscontextmanager.v1.Condition.Builder, + com.google.identity.accesscontextmanager.v1.ConditionOrBuilder> + getConditionsFieldBuilder() { + if (conditionsBuilder_ == null) { + conditionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.Condition, + com.google.identity.accesscontextmanager.v1.Condition.Builder, + com.google.identity.accesscontextmanager.v1.ConditionOrBuilder>( + conditions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + conditions_ = null; + } + return conditionsBuilder_; + } + + private int combiningFunction_ = 0; + /** + * + * + *
+     * How the `conditions` list should be combined to determine if a request is
+     * granted this `AccessLevel`. If AND is used, each `Condition` in
+     * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+     * is used, at least one `Condition` in `conditions` must be satisfied for the
+     * `AccessLevel` to be applied. Default behavior is AND.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The enum numeric value on the wire for combiningFunction. + */ + public int getCombiningFunctionValue() { + return combiningFunction_; + } + /** + * + * + *
+     * How the `conditions` list should be combined to determine if a request is
+     * granted this `AccessLevel`. If AND is used, each `Condition` in
+     * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+     * is used, at least one `Condition` in `conditions` must be satisfied for the
+     * `AccessLevel` to be applied. Default behavior is AND.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @param value The enum numeric value on the wire for combiningFunction to set. + * @return This builder for chaining. + */ + public Builder setCombiningFunctionValue(int value) { + combiningFunction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How the `conditions` list should be combined to determine if a request is
+     * granted this `AccessLevel`. If AND is used, each `Condition` in
+     * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+     * is used, at least one `Condition` in `conditions` must be satisfied for the
+     * `AccessLevel` to be applied. Default behavior is AND.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The combiningFunction. + */ + public com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + getCombiningFunction() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction result = + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction.valueOf( + combiningFunction_); + return result == null + ? com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * How the `conditions` list should be combined to determine if a request is
+     * granted this `AccessLevel`. If AND is used, each `Condition` in
+     * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+     * is used, at least one `Condition` in `conditions` must be satisfied for the
+     * `AccessLevel` to be applied. Default behavior is AND.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @param value The combiningFunction to set. + * @return This builder for chaining. + */ + public Builder setCombiningFunction( + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction value) { + if (value == null) { + throw new NullPointerException(); + } + + combiningFunction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * How the `conditions` list should be combined to determine if a request is
+     * granted this `AccessLevel`. If AND is used, each `Condition` in
+     * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+     * is used, at least one `Condition` in `conditions` must be satisfied for the
+     * `AccessLevel` to be applied. Default behavior is AND.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearCombiningFunction() { + + combiningFunction_ = 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.identity.accesscontextmanager.v1.BasicLevel) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.BasicLevel) + private static final com.google.identity.accesscontextmanager.v1.BasicLevel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.BasicLevel(); + } + + public static com.google.identity.accesscontextmanager.v1.BasicLevel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BasicLevel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BasicLevel(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.identity.accesscontextmanager.v1.BasicLevel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevelOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevelOrBuilder.java new file mode 100644 index 0000000..4104fb9 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/BasicLevelOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface BasicLevelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.BasicLevel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + com.google.identity.accesscontextmanager.v1.Condition getConditions(int index); + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + int getConditionsCount(); + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + java.util.List + getConditionsOrBuilderList(); + /** + * + * + *
+   * Required. A list of requirements for the `AccessLevel` to be granted.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.Condition conditions = 1; + */ + com.google.identity.accesscontextmanager.v1.ConditionOrBuilder getConditionsOrBuilder(int index); + + /** + * + * + *
+   * How the `conditions` list should be combined to determine if a request is
+   * granted this `AccessLevel`. If AND is used, each `Condition` in
+   * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+   * is used, at least one `Condition` in `conditions` must be satisfied for the
+   * `AccessLevel` to be applied. Default behavior is AND.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The enum numeric value on the wire for combiningFunction. + */ + int getCombiningFunctionValue(); + /** + * + * + *
+   * How the `conditions` list should be combined to determine if a request is
+   * granted this `AccessLevel`. If AND is used, each `Condition` in
+   * `conditions` must be satisfied for the `AccessLevel` to be applied. If OR
+   * is used, at least one `Condition` in `conditions` must be satisfied for the
+   * `AccessLevel` to be applied. Default behavior is AND.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction combining_function = 2; + * + * + * @return The combiningFunction. + */ + com.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + getCombiningFunction(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/Condition.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/Condition.java new file mode 100644 index 0000000..c33d481 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/Condition.java @@ -0,0 +1,2184 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * A condition necessary for an `AccessLevel` to be granted. The Condition is an
+ * AND over its fields. So a Condition is true if: 1) the request IP is from one
+ * of the listed subnetworks AND 2) the originating device complies with the
+ * listed device policy AND 3) all listed access levels are granted AND 4) the
+ * request was sent at a time allowed by the DateTimeRestriction.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.Condition} + */ +public final class Condition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.Condition) + ConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Condition.newBuilder() to construct. + private Condition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Condition() { + ipSubnetworks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + requiredAccessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + members_ = com.google.protobuf.LazyStringArrayList.EMPTY; + regions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Condition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Condition( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ipSubnetworks_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ipSubnetworks_.add(s); + break; + } + case 18: + { + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder subBuilder = null; + if (devicePolicy_ != null) { + subBuilder = devicePolicy_.toBuilder(); + } + devicePolicy_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.DevicePolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(devicePolicy_); + devicePolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + requiredAccessLevels_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + requiredAccessLevels_.add(s); + break; + } + case 40: + { + negate_ = input.readBool(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + members_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + members_.add(s); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + regions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + regions_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + ipSubnetworks_ = ipSubnetworks_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + requiredAccessLevels_ = requiredAccessLevels_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + members_ = members_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + regions_ = regions_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.Condition.class, + com.google.identity.accesscontextmanager.v1.Condition.Builder.class); + } + + public static final int IP_SUBNETWORKS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ipSubnetworks_; + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return A list containing the ipSubnetworks. + */ + public com.google.protobuf.ProtocolStringList getIpSubnetworksList() { + return ipSubnetworks_; + } + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return The count of ipSubnetworks. + */ + public int getIpSubnetworksCount() { + return ipSubnetworks_.size(); + } + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the element to return. + * @return The ipSubnetworks at the given index. + */ + public java.lang.String getIpSubnetworks(int index) { + return ipSubnetworks_.get(index); + } + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipSubnetworks at the given index. + */ + public com.google.protobuf.ByteString getIpSubnetworksBytes(int index) { + return ipSubnetworks_.getByteString(index); + } + + public static final int DEVICE_POLICY_FIELD_NUMBER = 2; + private com.google.identity.accesscontextmanager.v1.DevicePolicy devicePolicy_; + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return Whether the devicePolicy field is set. + */ + public boolean hasDevicePolicy() { + return devicePolicy_ != null; + } + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return The devicePolicy. + */ + public com.google.identity.accesscontextmanager.v1.DevicePolicy getDevicePolicy() { + return devicePolicy_ == null + ? com.google.identity.accesscontextmanager.v1.DevicePolicy.getDefaultInstance() + : devicePolicy_; + } + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder + getDevicePolicyOrBuilder() { + return getDevicePolicy(); + } + + public static final int REQUIRED_ACCESS_LEVELS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList requiredAccessLevels_; + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @return A list containing the requiredAccessLevels. + */ + public com.google.protobuf.ProtocolStringList getRequiredAccessLevelsList() { + return requiredAccessLevels_; + } + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @return The count of requiredAccessLevels. + */ + public int getRequiredAccessLevelsCount() { + return requiredAccessLevels_.size(); + } + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the element to return. + * @return The requiredAccessLevels at the given index. + */ + public java.lang.String getRequiredAccessLevels(int index) { + return requiredAccessLevels_.get(index); + } + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the requiredAccessLevels at the given index. + */ + public com.google.protobuf.ByteString getRequiredAccessLevelsBytes(int index) { + return requiredAccessLevels_.getByteString(index); + } + + public static final int NEGATE_FIELD_NUMBER = 5; + private boolean negate_; + /** + * + * + *
+   * Whether to negate the Condition. If true, the Condition becomes a NAND over
+   * its non-empty fields, each field must be false for the Condition overall to
+   * be satisfied. Defaults to false.
+   * 
+ * + * bool negate = 5; + * + * @return The negate. + */ + public boolean getNegate() { + return negate_; + } + + public static final int MEMBERS_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList members_; + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @return A list containing the members. + */ + public com.google.protobuf.ProtocolStringList getMembersList() { + return members_; + } + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @return The count of members. + */ + public int getMembersCount() { + return members_.size(); + } + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @param index The index of the element to return. + * @return The members at the given index. + */ + public java.lang.String getMembers(int index) { + return members_.get(index); + } + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @param index The index of the value to return. + * @return The bytes of the members at the given index. + */ + public com.google.protobuf.ByteString getMembersBytes(int index) { + return members_.getByteString(index); + } + + public static final int REGIONS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList regions_; + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @return A list containing the regions. + */ + public com.google.protobuf.ProtocolStringList getRegionsList() { + return regions_; + } + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @return The count of regions. + */ + public int getRegionsCount() { + return regions_.size(); + } + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + public java.lang.String getRegions(int index) { + return regions_.get(index); + } + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + public com.google.protobuf.ByteString getRegionsBytes(int index) { + return regions_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < ipSubnetworks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipSubnetworks_.getRaw(i)); + } + if (devicePolicy_ != null) { + output.writeMessage(2, getDevicePolicy()); + } + for (int i = 0; i < requiredAccessLevels_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, requiredAccessLevels_.getRaw(i)); + } + if (negate_ != false) { + output.writeBool(5, negate_); + } + for (int i = 0; i < members_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, members_.getRaw(i)); + } + for (int i = 0; i < regions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, regions_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < ipSubnetworks_.size(); i++) { + dataSize += computeStringSizeNoTag(ipSubnetworks_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpSubnetworksList().size(); + } + if (devicePolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDevicePolicy()); + } + { + int dataSize = 0; + for (int i = 0; i < requiredAccessLevels_.size(); i++) { + dataSize += computeStringSizeNoTag(requiredAccessLevels_.getRaw(i)); + } + size += dataSize; + size += 1 * getRequiredAccessLevelsList().size(); + } + if (negate_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, negate_); + } + { + int dataSize = 0; + for (int i = 0; i < members_.size(); i++) { + dataSize += computeStringSizeNoTag(members_.getRaw(i)); + } + size += dataSize; + size += 1 * getMembersList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < regions_.size(); i++) { + dataSize += computeStringSizeNoTag(regions_.getRaw(i)); + } + size += dataSize; + size += 1 * getRegionsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.identity.accesscontextmanager.v1.Condition)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.Condition other = + (com.google.identity.accesscontextmanager.v1.Condition) obj; + + if (!getIpSubnetworksList().equals(other.getIpSubnetworksList())) return false; + if (hasDevicePolicy() != other.hasDevicePolicy()) return false; + if (hasDevicePolicy()) { + if (!getDevicePolicy().equals(other.getDevicePolicy())) return false; + } + if (!getRequiredAccessLevelsList().equals(other.getRequiredAccessLevelsList())) return false; + if (getNegate() != other.getNegate()) return false; + if (!getMembersList().equals(other.getMembersList())) return false; + if (!getRegionsList().equals(other.getRegionsList())) 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 (getIpSubnetworksCount() > 0) { + hash = (37 * hash) + IP_SUBNETWORKS_FIELD_NUMBER; + hash = (53 * hash) + getIpSubnetworksList().hashCode(); + } + if (hasDevicePolicy()) { + hash = (37 * hash) + DEVICE_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getDevicePolicy().hashCode(); + } + if (getRequiredAccessLevelsCount() > 0) { + hash = (37 * hash) + REQUIRED_ACCESS_LEVELS_FIELD_NUMBER; + hash = (53 * hash) + getRequiredAccessLevelsList().hashCode(); + } + hash = (37 * hash) + NEGATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNegate()); + if (getMembersCount() > 0) { + hash = (37 * hash) + MEMBERS_FIELD_NUMBER; + hash = (53 * hash) + getMembersList().hashCode(); + } + if (getRegionsCount() > 0) { + hash = (37 * hash) + REGIONS_FIELD_NUMBER; + hash = (53 * hash) + getRegionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.Condition parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.Condition parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.Condition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.Condition 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.identity.accesscontextmanager.v1.Condition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.Condition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.Condition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.Condition 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.identity.accesscontextmanager.v1.Condition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.Condition 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.identity.accesscontextmanager.v1.Condition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.Condition 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.identity.accesscontextmanager.v1.Condition 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 condition necessary for an `AccessLevel` to be granted. The Condition is an
+   * AND over its fields. So a Condition is true if: 1) the request IP is from one
+   * of the listed subnetworks AND 2) the originating device complies with the
+   * listed device policy AND 3) all listed access levels are granted AND 4) the
+   * request was sent at a time allowed by the DateTimeRestriction.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.Condition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.Condition) + com.google.identity.accesscontextmanager.v1.ConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.Condition.class, + com.google.identity.accesscontextmanager.v1.Condition.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.Condition.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(); + ipSubnetworks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (devicePolicyBuilder_ == null) { + devicePolicy_ = null; + } else { + devicePolicy_ = null; + devicePolicyBuilder_ = null; + } + requiredAccessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + negate_ = false; + + members_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + regions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_Condition_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.Condition getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.Condition build() { + com.google.identity.accesscontextmanager.v1.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.Condition buildPartial() { + com.google.identity.accesscontextmanager.v1.Condition result = + new com.google.identity.accesscontextmanager.v1.Condition(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + ipSubnetworks_ = ipSubnetworks_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ipSubnetworks_ = ipSubnetworks_; + if (devicePolicyBuilder_ == null) { + result.devicePolicy_ = devicePolicy_; + } else { + result.devicePolicy_ = devicePolicyBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + requiredAccessLevels_ = requiredAccessLevels_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requiredAccessLevels_ = requiredAccessLevels_; + result.negate_ = negate_; + if (((bitField0_ & 0x00000004) != 0)) { + members_ = members_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.members_ = members_; + if (((bitField0_ & 0x00000008) != 0)) { + regions_ = regions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.regions_ = regions_; + 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.identity.accesscontextmanager.v1.Condition) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.Condition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.Condition other) { + if (other == com.google.identity.accesscontextmanager.v1.Condition.getDefaultInstance()) + return this; + if (!other.ipSubnetworks_.isEmpty()) { + if (ipSubnetworks_.isEmpty()) { + ipSubnetworks_ = other.ipSubnetworks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIpSubnetworksIsMutable(); + ipSubnetworks_.addAll(other.ipSubnetworks_); + } + onChanged(); + } + if (other.hasDevicePolicy()) { + mergeDevicePolicy(other.getDevicePolicy()); + } + if (!other.requiredAccessLevels_.isEmpty()) { + if (requiredAccessLevels_.isEmpty()) { + requiredAccessLevels_ = other.requiredAccessLevels_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequiredAccessLevelsIsMutable(); + requiredAccessLevels_.addAll(other.requiredAccessLevels_); + } + onChanged(); + } + if (other.getNegate() != false) { + setNegate(other.getNegate()); + } + if (!other.members_.isEmpty()) { + if (members_.isEmpty()) { + members_ = other.members_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMembersIsMutable(); + members_.addAll(other.members_); + } + onChanged(); + } + if (!other.regions_.isEmpty()) { + if (regions_.isEmpty()) { + regions_ = other.regions_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureRegionsIsMutable(); + regions_.addAll(other.regions_); + } + 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.identity.accesscontextmanager.v1.Condition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.Condition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList ipSubnetworks_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpSubnetworksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ipSubnetworks_ = new com.google.protobuf.LazyStringArrayList(ipSubnetworks_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return A list containing the ipSubnetworks. + */ + public com.google.protobuf.ProtocolStringList getIpSubnetworksList() { + return ipSubnetworks_.getUnmodifiableView(); + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return The count of ipSubnetworks. + */ + public int getIpSubnetworksCount() { + return ipSubnetworks_.size(); + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the element to return. + * @return The ipSubnetworks at the given index. + */ + public java.lang.String getIpSubnetworks(int index) { + return ipSubnetworks_.get(index); + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipSubnetworks at the given index. + */ + public com.google.protobuf.ByteString getIpSubnetworksBytes(int index) { + return ipSubnetworks_.getByteString(index); + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index to set the value at. + * @param value The ipSubnetworks to set. + * @return This builder for chaining. + */ + public Builder setIpSubnetworks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpSubnetworksIsMutable(); + ipSubnetworks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param value The ipSubnetworks to add. + * @return This builder for chaining. + */ + public Builder addIpSubnetworks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpSubnetworksIsMutable(); + ipSubnetworks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param values The ipSubnetworks to add. + * @return This builder for chaining. + */ + public Builder addAllIpSubnetworks(java.lang.Iterable values) { + ensureIpSubnetworksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipSubnetworks_); + onChanged(); + return this; + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return This builder for chaining. + */ + public Builder clearIpSubnetworks() { + ipSubnetworks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+     * a CIDR IP address block, the specified IP address portion must be properly
+     * truncated (i.e. all the host bits must be zero) or the input is considered
+     * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+     * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+     * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+     * the listed subnets in order for this Condition to be true. If empty, all IP
+     * addresses are allowed.
+     * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param value The bytes of the ipSubnetworks to add. + * @return This builder for chaining. + */ + public Builder addIpSubnetworksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpSubnetworksIsMutable(); + ipSubnetworks_.add(value); + onChanged(); + return this; + } + + private com.google.identity.accesscontextmanager.v1.DevicePolicy devicePolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.DevicePolicy, + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder, + com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder> + devicePolicyBuilder_; + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return Whether the devicePolicy field is set. + */ + public boolean hasDevicePolicy() { + return devicePolicyBuilder_ != null || devicePolicy_ != null; + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return The devicePolicy. + */ + public com.google.identity.accesscontextmanager.v1.DevicePolicy getDevicePolicy() { + if (devicePolicyBuilder_ == null) { + return devicePolicy_ == null + ? com.google.identity.accesscontextmanager.v1.DevicePolicy.getDefaultInstance() + : devicePolicy_; + } else { + return devicePolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public Builder setDevicePolicy(com.google.identity.accesscontextmanager.v1.DevicePolicy value) { + if (devicePolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + devicePolicy_ = value; + onChanged(); + } else { + devicePolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public Builder setDevicePolicy( + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder builderForValue) { + if (devicePolicyBuilder_ == null) { + devicePolicy_ = builderForValue.build(); + onChanged(); + } else { + devicePolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public Builder mergeDevicePolicy( + com.google.identity.accesscontextmanager.v1.DevicePolicy value) { + if (devicePolicyBuilder_ == null) { + if (devicePolicy_ != null) { + devicePolicy_ = + com.google.identity.accesscontextmanager.v1.DevicePolicy.newBuilder(devicePolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + devicePolicy_ = value; + } + onChanged(); + } else { + devicePolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public Builder clearDevicePolicy() { + if (devicePolicyBuilder_ == null) { + devicePolicy_ = null; + onChanged(); + } else { + devicePolicy_ = null; + devicePolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder + getDevicePolicyBuilder() { + + onChanged(); + return getDevicePolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + public com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder + getDevicePolicyOrBuilder() { + if (devicePolicyBuilder_ != null) { + return devicePolicyBuilder_.getMessageOrBuilder(); + } else { + return devicePolicy_ == null + ? com.google.identity.accesscontextmanager.v1.DevicePolicy.getDefaultInstance() + : devicePolicy_; + } + } + /** + * + * + *
+     * Device specific restrictions, all restrictions must hold for the
+     * Condition to be true. If not specified, all devices are allowed.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.DevicePolicy, + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder, + com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder> + getDevicePolicyFieldBuilder() { + if (devicePolicyBuilder_ == null) { + devicePolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.DevicePolicy, + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder, + com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder>( + getDevicePolicy(), getParentForChildren(), isClean()); + devicePolicy_ = null; + } + return devicePolicyBuilder_; + } + + private com.google.protobuf.LazyStringList requiredAccessLevels_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRequiredAccessLevelsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requiredAccessLevels_ = new com.google.protobuf.LazyStringArrayList(requiredAccessLevels_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @return A list containing the requiredAccessLevels. + */ + public com.google.protobuf.ProtocolStringList getRequiredAccessLevelsList() { + return requiredAccessLevels_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @return The count of requiredAccessLevels. + */ + public int getRequiredAccessLevelsCount() { + return requiredAccessLevels_.size(); + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the element to return. + * @return The requiredAccessLevels at the given index. + */ + public java.lang.String getRequiredAccessLevels(int index) { + return requiredAccessLevels_.get(index); + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the requiredAccessLevels at the given index. + */ + public com.google.protobuf.ByteString getRequiredAccessLevelsBytes(int index) { + return requiredAccessLevels_.getByteString(index); + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index to set the value at. + * @param value The requiredAccessLevels to set. + * @return This builder for chaining. + */ + public Builder setRequiredAccessLevels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredAccessLevelsIsMutable(); + requiredAccessLevels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param value The requiredAccessLevels to add. + * @return This builder for chaining. + */ + public Builder addRequiredAccessLevels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredAccessLevelsIsMutable(); + requiredAccessLevels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param values The requiredAccessLevels to add. + * @return This builder for chaining. + */ + public Builder addAllRequiredAccessLevels(java.lang.Iterable values) { + ensureRequiredAccessLevelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requiredAccessLevels_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequiredAccessLevels() { + requiredAccessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of other access levels defined in the same `Policy`, referenced by
+     * resource name. Referencing an `AccessLevel` which does not exist is an
+     * error. All access levels listed must be granted for the Condition
+     * to be true. Example:
+     * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+     * 
+ * + * repeated string required_access_levels = 3; + * + * @param value The bytes of the requiredAccessLevels to add. + * @return This builder for chaining. + */ + public Builder addRequiredAccessLevelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRequiredAccessLevelsIsMutable(); + requiredAccessLevels_.add(value); + onChanged(); + return this; + } + + private boolean negate_; + /** + * + * + *
+     * Whether to negate the Condition. If true, the Condition becomes a NAND over
+     * its non-empty fields, each field must be false for the Condition overall to
+     * be satisfied. Defaults to false.
+     * 
+ * + * bool negate = 5; + * + * @return The negate. + */ + public boolean getNegate() { + return negate_; + } + /** + * + * + *
+     * Whether to negate the Condition. If true, the Condition becomes a NAND over
+     * its non-empty fields, each field must be false for the Condition overall to
+     * be satisfied. Defaults to false.
+     * 
+ * + * bool negate = 5; + * + * @param value The negate to set. + * @return This builder for chaining. + */ + public Builder setNegate(boolean value) { + + negate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to negate the Condition. If true, the Condition becomes a NAND over
+     * its non-empty fields, each field must be false for the Condition overall to
+     * be satisfied. Defaults to false.
+     * 
+ * + * bool negate = 5; + * + * @return This builder for chaining. + */ + public Builder clearNegate() { + + negate_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList members_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMembersIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + members_ = new com.google.protobuf.LazyStringArrayList(members_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @return A list containing the members. + */ + public com.google.protobuf.ProtocolStringList getMembersList() { + return members_.getUnmodifiableView(); + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @return The count of members. + */ + public int getMembersCount() { + return members_.size(); + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param index The index of the element to return. + * @return The members at the given index. + */ + public java.lang.String getMembers(int index) { + return members_.get(index); + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param index The index of the value to return. + * @return The bytes of the members at the given index. + */ + public com.google.protobuf.ByteString getMembersBytes(int index) { + return members_.getByteString(index); + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param index The index to set the value at. + * @param value The members to set. + * @return This builder for chaining. + */ + public Builder setMembers(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMembersIsMutable(); + members_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param value The members to add. + * @return This builder for chaining. + */ + public Builder addMembers(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMembersIsMutable(); + members_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param values The members to add. + * @return This builder for chaining. + */ + public Builder addAllMembers(java.lang.Iterable values) { + ensureMembersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, members_); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @return This builder for chaining. + */ + public Builder clearMembers() { + members_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must be made by one of the provided user or service
+     * accounts. Groups are not supported.
+     * Syntax:
+     * `user:{emailid}`
+     * `serviceAccount:{emailid}`
+     * If not specified, a request may come from any user.
+     * 
+ * + * repeated string members = 6; + * + * @param value The bytes of the members to add. + * @return This builder for chaining. + */ + public Builder addMembersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMembersIsMutable(); + members_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList regions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRegionsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + regions_ = new com.google.protobuf.LazyStringArrayList(regions_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @return A list containing the regions. + */ + public com.google.protobuf.ProtocolStringList getRegionsList() { + return regions_.getUnmodifiableView(); + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @return The count of regions. + */ + public int getRegionsCount() { + return regions_.size(); + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + public java.lang.String getRegions(int index) { + return regions_.get(index); + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + public com.google.protobuf.ByteString getRegionsBytes(int index) { + return regions_.getByteString(index); + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param index The index to set the value at. + * @param value The regions to set. + * @return This builder for chaining. + */ + public Builder setRegions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param value The regions to add. + * @return This builder for chaining. + */ + public Builder addRegions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param values The regions to add. + * @return This builder for chaining. + */ + public Builder addAllRegions(java.lang.Iterable values) { + ensureRegionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, regions_); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @return This builder for chaining. + */ + public Builder clearRegions() { + regions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The request must originate from one of the provided countries/regions.
+     * Must be valid ISO 3166-1 alpha-2 codes.
+     * 
+ * + * repeated string regions = 7; + * + * @param value The bytes of the regions to add. + * @return This builder for chaining. + */ + public Builder addRegionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRegionsIsMutable(); + regions_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.identity.accesscontextmanager.v1.Condition) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.Condition) + private static final com.google.identity.accesscontextmanager.v1.Condition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.Condition(); + } + + public static com.google.identity.accesscontextmanager.v1.Condition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Condition(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.identity.accesscontextmanager.v1.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ConditionOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ConditionOrBuilder.java new file mode 100644 index 0000000..26ed0d2 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ConditionOrBuilder.java @@ -0,0 +1,350 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface ConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.Condition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return A list containing the ipSubnetworks. + */ + java.util.List getIpSubnetworksList(); + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @return The count of ipSubnetworks. + */ + int getIpSubnetworksCount(); + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the element to return. + * @return The ipSubnetworks at the given index. + */ + java.lang.String getIpSubnetworks(int index); + /** + * + * + *
+   * CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for
+   * a CIDR IP address block, the specified IP address portion must be properly
+   * truncated (i.e. all the host bits must be zero) or the input is considered
+   * malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is
+   * not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas
+   * "2001:db8::1/32" is not. The originating IP of a request must be in one of
+   * the listed subnets in order for this Condition to be true. If empty, all IP
+   * addresses are allowed.
+   * 
+ * + * repeated string ip_subnetworks = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipSubnetworks at the given index. + */ + com.google.protobuf.ByteString getIpSubnetworksBytes(int index); + + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return Whether the devicePolicy field is set. + */ + boolean hasDevicePolicy(); + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + * + * @return The devicePolicy. + */ + com.google.identity.accesscontextmanager.v1.DevicePolicy getDevicePolicy(); + /** + * + * + *
+   * Device specific restrictions, all restrictions must hold for the
+   * Condition to be true. If not specified, all devices are allowed.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.DevicePolicy device_policy = 2; + */ + com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder getDevicePolicyOrBuilder(); + + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @return A list containing the requiredAccessLevels. + */ + java.util.List getRequiredAccessLevelsList(); + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @return The count of requiredAccessLevels. + */ + int getRequiredAccessLevelsCount(); + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the element to return. + * @return The requiredAccessLevels at the given index. + */ + java.lang.String getRequiredAccessLevels(int index); + /** + * + * + *
+   * A list of other access levels defined in the same `Policy`, referenced by
+   * resource name. Referencing an `AccessLevel` which does not exist is an
+   * error. All access levels listed must be granted for the Condition
+   * to be true. Example:
+   * "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
+   * 
+ * + * repeated string required_access_levels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the requiredAccessLevels at the given index. + */ + com.google.protobuf.ByteString getRequiredAccessLevelsBytes(int index); + + /** + * + * + *
+   * Whether to negate the Condition. If true, the Condition becomes a NAND over
+   * its non-empty fields, each field must be false for the Condition overall to
+   * be satisfied. Defaults to false.
+   * 
+ * + * bool negate = 5; + * + * @return The negate. + */ + boolean getNegate(); + + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @return A list containing the members. + */ + java.util.List getMembersList(); + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @return The count of members. + */ + int getMembersCount(); + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @param index The index of the element to return. + * @return The members at the given index. + */ + java.lang.String getMembers(int index); + /** + * + * + *
+   * The request must be made by one of the provided user or service
+   * accounts. Groups are not supported.
+   * Syntax:
+   * `user:{emailid}`
+   * `serviceAccount:{emailid}`
+   * If not specified, a request may come from any user.
+   * 
+ * + * repeated string members = 6; + * + * @param index The index of the value to return. + * @return The bytes of the members at the given index. + */ + com.google.protobuf.ByteString getMembersBytes(int index); + + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @return A list containing the regions. + */ + java.util.List getRegionsList(); + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @return The count of regions. + */ + int getRegionsCount(); + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @param index The index of the element to return. + * @return The regions at the given index. + */ + java.lang.String getRegions(int index); + /** + * + * + *
+   * The request must originate from one of the provided countries/regions.
+   * Must be valid ISO 3166-1 alpha-2 codes.
+   * 
+ * + * repeated string regions = 7; + * + * @param index The index of the value to return. + * @return The bytes of the regions at the given index. + */ + com.google.protobuf.ByteString getRegionsBytes(int index); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevel.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevel.java new file mode 100644 index 0000000..8085f01 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevel.java @@ -0,0 +1,718 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language
+ * to represent the necessary conditions for the level to apply to a request.
+ * See CEL spec at: https://github.com/google/cel-spec
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.CustomLevel} + */ +public final class CustomLevel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.CustomLevel) + CustomLevelOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomLevel.newBuilder() to construct. + private CustomLevel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomLevel() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomLevel(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomLevel( + 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.type.Expr.Builder subBuilder = null; + if (expr_ != null) { + subBuilder = expr_.toBuilder(); + } + expr_ = input.readMessage(com.google.type.Expr.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expr_); + expr_ = 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.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_CustomLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.CustomLevel.class, + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder.class); + } + + public static final int EXPR_FIELD_NUMBER = 1; + private com.google.type.Expr expr_; + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + * + * @return Whether the expr field is set. + */ + public boolean hasExpr() { + return expr_ != null; + } + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + * + * @return The expr. + */ + public com.google.type.Expr getExpr() { + return expr_ == null ? com.google.type.Expr.getDefaultInstance() : expr_; + } + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + */ + public com.google.type.ExprOrBuilder getExprOrBuilder() { + return getExpr(); + } + + 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 (expr_ != null) { + output.writeMessage(1, getExpr()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expr_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getExpr()); + } + 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.identity.accesscontextmanager.v1.CustomLevel)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.CustomLevel other = + (com.google.identity.accesscontextmanager.v1.CustomLevel) obj; + + if (hasExpr() != other.hasExpr()) return false; + if (hasExpr()) { + if (!getExpr().equals(other.getExpr())) 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 (hasExpr()) { + hash = (37 * hash) + EXPR_FIELD_NUMBER; + hash = (53 * hash) + getExpr().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel 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.identity.accesscontextmanager.v1.CustomLevel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel 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.identity.accesscontextmanager.v1.CustomLevel parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel 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.identity.accesscontextmanager.v1.CustomLevel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel 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.identity.accesscontextmanager.v1.CustomLevel 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; + } + /** + * + * + *
+   * `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language
+   * to represent the necessary conditions for the level to apply to a request.
+   * See CEL spec at: https://github.com/google/cel-spec
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.CustomLevel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.CustomLevel) + com.google.identity.accesscontextmanager.v1.CustomLevelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_CustomLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.CustomLevel.class, + com.google.identity.accesscontextmanager.v1.CustomLevel.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.CustomLevel.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 (exprBuilder_ == null) { + expr_ = null; + } else { + expr_ = null; + exprBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_CustomLevel_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.CustomLevel getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.CustomLevel build() { + com.google.identity.accesscontextmanager.v1.CustomLevel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.CustomLevel buildPartial() { + com.google.identity.accesscontextmanager.v1.CustomLevel result = + new com.google.identity.accesscontextmanager.v1.CustomLevel(this); + if (exprBuilder_ == null) { + result.expr_ = expr_; + } else { + result.expr_ = exprBuilder_.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.identity.accesscontextmanager.v1.CustomLevel) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.CustomLevel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.CustomLevel other) { + if (other == com.google.identity.accesscontextmanager.v1.CustomLevel.getDefaultInstance()) + return this; + if (other.hasExpr()) { + mergeExpr(other.getExpr()); + } + 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.identity.accesscontextmanager.v1.CustomLevel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.CustomLevel) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.type.Expr expr_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + exprBuilder_; + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + * + * @return Whether the expr field is set. + */ + public boolean hasExpr() { + return exprBuilder_ != null || expr_ != null; + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + * + * @return The expr. + */ + public com.google.type.Expr getExpr() { + if (exprBuilder_ == null) { + return expr_ == null ? com.google.type.Expr.getDefaultInstance() : expr_; + } else { + return exprBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public Builder setExpr(com.google.type.Expr value) { + if (exprBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expr_ = value; + onChanged(); + } else { + exprBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public Builder setExpr(com.google.type.Expr.Builder builderForValue) { + if (exprBuilder_ == null) { + expr_ = builderForValue.build(); + onChanged(); + } else { + exprBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public Builder mergeExpr(com.google.type.Expr value) { + if (exprBuilder_ == null) { + if (expr_ != null) { + expr_ = com.google.type.Expr.newBuilder(expr_).mergeFrom(value).buildPartial(); + } else { + expr_ = value; + } + onChanged(); + } else { + exprBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public Builder clearExpr() { + if (exprBuilder_ == null) { + expr_ = null; + onChanged(); + } else { + expr_ = null; + exprBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public com.google.type.Expr.Builder getExprBuilder() { + + onChanged(); + return getExprFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + public com.google.type.ExprOrBuilder getExprOrBuilder() { + if (exprBuilder_ != null) { + return exprBuilder_.getMessageOrBuilder(); + } else { + return expr_ == null ? com.google.type.Expr.getDefaultInstance() : expr_; + } + } + /** + * + * + *
+     * Required. A Cloud CEL expression evaluating to a boolean.
+     * 
+ * + * .google.type.Expr expr = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + getExprFieldBuilder() { + if (exprBuilder_ == null) { + exprBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getExpr(), getParentForChildren(), isClean()); + expr_ = null; + } + return exprBuilder_; + } + + @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.identity.accesscontextmanager.v1.CustomLevel) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.CustomLevel) + private static final com.google.identity.accesscontextmanager.v1.CustomLevel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.CustomLevel(); + } + + public static com.google.identity.accesscontextmanager.v1.CustomLevel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomLevel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomLevel(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.identity.accesscontextmanager.v1.CustomLevel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevelOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevelOrBuilder.java new file mode 100644 index 0000000..b0793b0 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/CustomLevelOrBuilder.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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface CustomLevelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.CustomLevel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + * + * @return Whether the expr field is set. + */ + boolean hasExpr(); + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + * + * @return The expr. + */ + com.google.type.Expr getExpr(); + /** + * + * + *
+   * Required. A Cloud CEL expression evaluating to a boolean.
+   * 
+ * + * .google.type.Expr expr = 1; + */ + com.google.type.ExprOrBuilder getExprOrBuilder(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicy.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicy.java new file mode 100644 index 0000000..eadfd13 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicy.java @@ -0,0 +1,2168 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `DevicePolicy` specifies device specific restrictions necessary to acquire a
+ * given access level. A `DevicePolicy` specifies requirements for requests from
+ * devices to be granted access levels, it does not do any enforcement on the
+ * device. `DevicePolicy` acts as an AND over all specified fields, and each
+ * repeated field is an OR over its elements. Any unset fields are ignored. For
+ * example, if the proto is { os_type : DESKTOP_WINDOWS, os_type :
+ * DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be
+ * true for requests originating from encrypted Linux desktops and encrypted
+ * Windows desktops.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.DevicePolicy} + */ +public final class DevicePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.DevicePolicy) + DevicePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use DevicePolicy.newBuilder() to construct. + private DevicePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DevicePolicy() { + allowedEncryptionStatuses_ = java.util.Collections.emptyList(); + osConstraints_ = java.util.Collections.emptyList(); + allowedDeviceManagementLevels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DevicePolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DevicePolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + requireScreenlock_ = input.readBool(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedEncryptionStatuses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedEncryptionStatuses_.add(rawValue); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedEncryptionStatuses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedEncryptionStatuses_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + osConstraints_ = + new java.util.ArrayList< + com.google.identity.accesscontextmanager.v1.OsConstraint>(); + mutable_bitField0_ |= 0x00000002; + } + osConstraints_.add( + input.readMessage( + com.google.identity.accesscontextmanager.v1.OsConstraint.parser(), + extensionRegistry)); + break; + } + case 48: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + allowedDeviceManagementLevels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + allowedDeviceManagementLevels_.add(rawValue); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + allowedDeviceManagementLevels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + allowedDeviceManagementLevels_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 56: + { + requireAdminApproval_ = input.readBool(); + break; + } + case 64: + { + requireCorpOwned_ = 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)) { + allowedEncryptionStatuses_ = + java.util.Collections.unmodifiableList(allowedEncryptionStatuses_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + osConstraints_ = java.util.Collections.unmodifiableList(osConstraints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + allowedDeviceManagementLevels_ = + java.util.Collections.unmodifiableList(allowedDeviceManagementLevels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.DevicePolicy.class, + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder.class); + } + + public static final int REQUIRE_SCREENLOCK_FIELD_NUMBER = 1; + private boolean requireScreenlock_; + /** + * + * + *
+   * Whether or not screenlock is required for the DevicePolicy to be true.
+   * Defaults to `false`.
+   * 
+ * + * bool require_screenlock = 1; + * + * @return The requireScreenlock. + */ + public boolean getRequireScreenlock() { + return requireScreenlock_; + } + + public static final int ALLOWED_ENCRYPTION_STATUSES_FIELD_NUMBER = 2; + private java.util.List allowedEncryptionStatuses_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus> + allowedEncryptionStatuses_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus>() { + public com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus result = + com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus.valueOf( + from); + return result == null + ? com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus + .UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the allowedEncryptionStatuses. + */ + public java.util.List + getAllowedEncryptionStatusesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus>( + allowedEncryptionStatuses_, allowedEncryptionStatuses_converter_); + } + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return The count of allowedEncryptionStatuses. + */ + public int getAllowedEncryptionStatusesCount() { + return allowedEncryptionStatuses_.size(); + } + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the element to return. + * @return The allowedEncryptionStatuses at the given index. + */ + public com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus + getAllowedEncryptionStatuses(int index) { + return allowedEncryptionStatuses_converter_.convert(allowedEncryptionStatuses_.get(index)); + } + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the enum numeric values on the wire for allowedEncryptionStatuses. + */ + public java.util.List getAllowedEncryptionStatusesValueList() { + return allowedEncryptionStatuses_; + } + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedEncryptionStatuses at the given index. + */ + public int getAllowedEncryptionStatusesValue(int index) { + return allowedEncryptionStatuses_.get(index); + } + + private int allowedEncryptionStatusesMemoizedSerializedSize; + + public static final int OS_CONSTRAINTS_FIELD_NUMBER = 3; + private java.util.List osConstraints_; + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + public java.util.List + getOsConstraintsList() { + return osConstraints_; + } + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + public java.util.List + getOsConstraintsOrBuilderList() { + return osConstraints_; + } + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + public int getOsConstraintsCount() { + return osConstraints_.size(); + } + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + public com.google.identity.accesscontextmanager.v1.OsConstraint getOsConstraints(int index) { + return osConstraints_.get(index); + } + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + public com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder + getOsConstraintsOrBuilder(int index) { + return osConstraints_.get(index); + } + + public static final int ALLOWED_DEVICE_MANAGEMENT_LEVELS_FIELD_NUMBER = 6; + private java.util.List allowedDeviceManagementLevels_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceManagementLevel> + allowedDeviceManagementLevels_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.identity.accesscontextmanager.type.DeviceManagementLevel>() { + public com.google.identity.accesscontextmanager.type.DeviceManagementLevel convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.type.DeviceManagementLevel result = + com.google.identity.accesscontextmanager.type.DeviceManagementLevel.valueOf(from); + return result == null + ? com.google.identity.accesscontextmanager.type.DeviceManagementLevel.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the allowedDeviceManagementLevels. + */ + public java.util.List + getAllowedDeviceManagementLevelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceManagementLevel>( + allowedDeviceManagementLevels_, allowedDeviceManagementLevels_converter_); + } + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return The count of allowedDeviceManagementLevels. + */ + public int getAllowedDeviceManagementLevelsCount() { + return allowedDeviceManagementLevels_.size(); + } + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the element to return. + * @return The allowedDeviceManagementLevels at the given index. + */ + public com.google.identity.accesscontextmanager.type.DeviceManagementLevel + getAllowedDeviceManagementLevels(int index) { + return allowedDeviceManagementLevels_converter_.convert( + allowedDeviceManagementLevels_.get(index)); + } + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the enum numeric values on the wire for + * allowedDeviceManagementLevels. + */ + public java.util.List getAllowedDeviceManagementLevelsValueList() { + return allowedDeviceManagementLevels_; + } + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedDeviceManagementLevels at the given index. + */ + public int getAllowedDeviceManagementLevelsValue(int index) { + return allowedDeviceManagementLevels_.get(index); + } + + private int allowedDeviceManagementLevelsMemoizedSerializedSize; + + public static final int REQUIRE_ADMIN_APPROVAL_FIELD_NUMBER = 7; + private boolean requireAdminApproval_; + /** + * + * + *
+   * Whether the device needs to be approved by the customer admin.
+   * 
+ * + * bool require_admin_approval = 7; + * + * @return The requireAdminApproval. + */ + public boolean getRequireAdminApproval() { + return requireAdminApproval_; + } + + public static final int REQUIRE_CORP_OWNED_FIELD_NUMBER = 8; + private boolean requireCorpOwned_; + /** + * + * + *
+   * Whether the device needs to be corp owned.
+   * 
+ * + * bool require_corp_owned = 8; + * + * @return The requireCorpOwned. + */ + public boolean getRequireCorpOwned() { + return requireCorpOwned_; + } + + 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 { + getSerializedSize(); + if (requireScreenlock_ != false) { + output.writeBool(1, requireScreenlock_); + } + if (getAllowedEncryptionStatusesList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(allowedEncryptionStatusesMemoizedSerializedSize); + } + for (int i = 0; i < allowedEncryptionStatuses_.size(); i++) { + output.writeEnumNoTag(allowedEncryptionStatuses_.get(i)); + } + for (int i = 0; i < osConstraints_.size(); i++) { + output.writeMessage(3, osConstraints_.get(i)); + } + if (getAllowedDeviceManagementLevelsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(allowedDeviceManagementLevelsMemoizedSerializedSize); + } + for (int i = 0; i < allowedDeviceManagementLevels_.size(); i++) { + output.writeEnumNoTag(allowedDeviceManagementLevels_.get(i)); + } + if (requireAdminApproval_ != false) { + output.writeBool(7, requireAdminApproval_); + } + if (requireCorpOwned_ != false) { + output.writeBool(8, requireCorpOwned_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requireScreenlock_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, requireScreenlock_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedEncryptionStatuses_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + allowedEncryptionStatuses_.get(i)); + } + size += dataSize; + if (!getAllowedEncryptionStatusesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + allowedEncryptionStatusesMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < osConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, osConstraints_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < allowedDeviceManagementLevels_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + allowedDeviceManagementLevels_.get(i)); + } + size += dataSize; + if (!getAllowedDeviceManagementLevelsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + allowedDeviceManagementLevelsMemoizedSerializedSize = dataSize; + } + if (requireAdminApproval_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, requireAdminApproval_); + } + if (requireCorpOwned_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, requireCorpOwned_); + } + 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.identity.accesscontextmanager.v1.DevicePolicy)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.DevicePolicy other = + (com.google.identity.accesscontextmanager.v1.DevicePolicy) obj; + + if (getRequireScreenlock() != other.getRequireScreenlock()) return false; + if (!allowedEncryptionStatuses_.equals(other.allowedEncryptionStatuses_)) return false; + if (!getOsConstraintsList().equals(other.getOsConstraintsList())) return false; + if (!allowedDeviceManagementLevels_.equals(other.allowedDeviceManagementLevels_)) return false; + if (getRequireAdminApproval() != other.getRequireAdminApproval()) return false; + if (getRequireCorpOwned() != other.getRequireCorpOwned()) 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) + REQUIRE_SCREENLOCK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireScreenlock()); + if (getAllowedEncryptionStatusesCount() > 0) { + hash = (37 * hash) + ALLOWED_ENCRYPTION_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + allowedEncryptionStatuses_.hashCode(); + } + if (getOsConstraintsCount() > 0) { + hash = (37 * hash) + OS_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getOsConstraintsList().hashCode(); + } + if (getAllowedDeviceManagementLevelsCount() > 0) { + hash = (37 * hash) + ALLOWED_DEVICE_MANAGEMENT_LEVELS_FIELD_NUMBER; + hash = (53 * hash) + allowedDeviceManagementLevels_.hashCode(); + } + hash = (37 * hash) + REQUIRE_ADMIN_APPROVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireAdminApproval()); + hash = (37 * hash) + REQUIRE_CORP_OWNED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireCorpOwned()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy 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.identity.accesscontextmanager.v1.DevicePolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy 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.identity.accesscontextmanager.v1.DevicePolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy 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.identity.accesscontextmanager.v1.DevicePolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy 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.identity.accesscontextmanager.v1.DevicePolicy 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; + } + /** + * + * + *
+   * `DevicePolicy` specifies device specific restrictions necessary to acquire a
+   * given access level. A `DevicePolicy` specifies requirements for requests from
+   * devices to be granted access levels, it does not do any enforcement on the
+   * device. `DevicePolicy` acts as an AND over all specified fields, and each
+   * repeated field is an OR over its elements. Any unset fields are ignored. For
+   * example, if the proto is { os_type : DESKTOP_WINDOWS, os_type :
+   * DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be
+   * true for requests originating from encrypted Linux desktops and encrypted
+   * Windows desktops.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.DevicePolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.DevicePolicy) + com.google.identity.accesscontextmanager.v1.DevicePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.DevicePolicy.class, + com.google.identity.accesscontextmanager.v1.DevicePolicy.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.DevicePolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOsConstraintsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + requireScreenlock_ = false; + + allowedEncryptionStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (osConstraintsBuilder_ == null) { + osConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + osConstraintsBuilder_.clear(); + } + allowedDeviceManagementLevels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + requireAdminApproval_ = false; + + requireCorpOwned_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_DevicePolicy_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.DevicePolicy getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.DevicePolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.DevicePolicy build() { + com.google.identity.accesscontextmanager.v1.DevicePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.DevicePolicy buildPartial() { + com.google.identity.accesscontextmanager.v1.DevicePolicy result = + new com.google.identity.accesscontextmanager.v1.DevicePolicy(this); + int from_bitField0_ = bitField0_; + result.requireScreenlock_ = requireScreenlock_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedEncryptionStatuses_ = + java.util.Collections.unmodifiableList(allowedEncryptionStatuses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedEncryptionStatuses_ = allowedEncryptionStatuses_; + if (osConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + osConstraints_ = java.util.Collections.unmodifiableList(osConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.osConstraints_ = osConstraints_; + } else { + result.osConstraints_ = osConstraintsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + allowedDeviceManagementLevels_ = + java.util.Collections.unmodifiableList(allowedDeviceManagementLevels_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.allowedDeviceManagementLevels_ = allowedDeviceManagementLevels_; + result.requireAdminApproval_ = requireAdminApproval_; + result.requireCorpOwned_ = requireCorpOwned_; + 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.identity.accesscontextmanager.v1.DevicePolicy) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.DevicePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.DevicePolicy other) { + if (other == com.google.identity.accesscontextmanager.v1.DevicePolicy.getDefaultInstance()) + return this; + if (other.getRequireScreenlock() != false) { + setRequireScreenlock(other.getRequireScreenlock()); + } + if (!other.allowedEncryptionStatuses_.isEmpty()) { + if (allowedEncryptionStatuses_.isEmpty()) { + allowedEncryptionStatuses_ = other.allowedEncryptionStatuses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedEncryptionStatusesIsMutable(); + allowedEncryptionStatuses_.addAll(other.allowedEncryptionStatuses_); + } + onChanged(); + } + if (osConstraintsBuilder_ == null) { + if (!other.osConstraints_.isEmpty()) { + if (osConstraints_.isEmpty()) { + osConstraints_ = other.osConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOsConstraintsIsMutable(); + osConstraints_.addAll(other.osConstraints_); + } + onChanged(); + } + } else { + if (!other.osConstraints_.isEmpty()) { + if (osConstraintsBuilder_.isEmpty()) { + osConstraintsBuilder_.dispose(); + osConstraintsBuilder_ = null; + osConstraints_ = other.osConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + osConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOsConstraintsFieldBuilder() + : null; + } else { + osConstraintsBuilder_.addAllMessages(other.osConstraints_); + } + } + } + if (!other.allowedDeviceManagementLevels_.isEmpty()) { + if (allowedDeviceManagementLevels_.isEmpty()) { + allowedDeviceManagementLevels_ = other.allowedDeviceManagementLevels_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAllowedDeviceManagementLevelsIsMutable(); + allowedDeviceManagementLevels_.addAll(other.allowedDeviceManagementLevels_); + } + onChanged(); + } + if (other.getRequireAdminApproval() != false) { + setRequireAdminApproval(other.getRequireAdminApproval()); + } + if (other.getRequireCorpOwned() != false) { + setRequireCorpOwned(other.getRequireCorpOwned()); + } + 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.identity.accesscontextmanager.v1.DevicePolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.DevicePolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private boolean requireScreenlock_; + /** + * + * + *
+     * Whether or not screenlock is required for the DevicePolicy to be true.
+     * Defaults to `false`.
+     * 
+ * + * bool require_screenlock = 1; + * + * @return The requireScreenlock. + */ + public boolean getRequireScreenlock() { + return requireScreenlock_; + } + /** + * + * + *
+     * Whether or not screenlock is required for the DevicePolicy to be true.
+     * Defaults to `false`.
+     * 
+ * + * bool require_screenlock = 1; + * + * @param value The requireScreenlock to set. + * @return This builder for chaining. + */ + public Builder setRequireScreenlock(boolean value) { + + requireScreenlock_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether or not screenlock is required for the DevicePolicy to be true.
+     * Defaults to `false`.
+     * 
+ * + * bool require_screenlock = 1; + * + * @return This builder for chaining. + */ + public Builder clearRequireScreenlock() { + + requireScreenlock_ = false; + onChanged(); + return this; + } + + private java.util.List allowedEncryptionStatuses_ = + java.util.Collections.emptyList(); + + private void ensureAllowedEncryptionStatusesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedEncryptionStatuses_ = + new java.util.ArrayList(allowedEncryptionStatuses_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the allowedEncryptionStatuses. + */ + public java.util.List + getAllowedEncryptionStatusesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus>( + allowedEncryptionStatuses_, allowedEncryptionStatuses_converter_); + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return The count of allowedEncryptionStatuses. + */ + public int getAllowedEncryptionStatusesCount() { + return allowedEncryptionStatuses_.size(); + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the element to return. + * @return The allowedEncryptionStatuses at the given index. + */ + public com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus + getAllowedEncryptionStatuses(int index) { + return allowedEncryptionStatuses_converter_.convert(allowedEncryptionStatuses_.get(index)); + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index to set the value at. + * @param value The allowedEncryptionStatuses to set. + * @return This builder for chaining. + */ + public Builder setAllowedEncryptionStatuses( + int index, com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedEncryptionStatusesIsMutable(); + allowedEncryptionStatuses_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param value The allowedEncryptionStatuses to add. + * @return This builder for chaining. + */ + public Builder addAllowedEncryptionStatuses( + com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedEncryptionStatusesIsMutable(); + allowedEncryptionStatuses_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param values The allowedEncryptionStatuses to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedEncryptionStatuses( + java.lang.Iterable< + ? extends com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus> + values) { + ensureAllowedEncryptionStatusesIsMutable(); + for (com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus value : values) { + allowedEncryptionStatuses_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowedEncryptionStatuses() { + allowedEncryptionStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the enum numeric values on the wire for allowedEncryptionStatuses. + */ + public java.util.List getAllowedEncryptionStatusesValueList() { + return java.util.Collections.unmodifiableList(allowedEncryptionStatuses_); + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedEncryptionStatuses at the given index. + */ + public int getAllowedEncryptionStatusesValue(int index) { + return allowedEncryptionStatuses_.get(index); + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedEncryptionStatuses at the given index. + * @return This builder for chaining. + */ + public Builder setAllowedEncryptionStatusesValue(int index, int value) { + ensureAllowedEncryptionStatusesIsMutable(); + allowedEncryptionStatuses_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param value The enum numeric value on the wire for allowedEncryptionStatuses to add. + * @return This builder for chaining. + */ + public Builder addAllowedEncryptionStatusesValue(int value) { + ensureAllowedEncryptionStatusesIsMutable(); + allowedEncryptionStatuses_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed encryptions statuses, an empty list allows all statuses.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param values The enum numeric values on the wire for allowedEncryptionStatuses to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedEncryptionStatusesValue( + java.lang.Iterable values) { + ensureAllowedEncryptionStatusesIsMutable(); + for (int value : values) { + allowedEncryptionStatuses_.add(value); + } + onChanged(); + return this; + } + + private java.util.List + osConstraints_ = java.util.Collections.emptyList(); + + private void ensureOsConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + osConstraints_ = + new java.util.ArrayList( + osConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.OsConstraint, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder, + com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder> + osConstraintsBuilder_; + + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public java.util.List + getOsConstraintsList() { + if (osConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(osConstraints_); + } else { + return osConstraintsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public int getOsConstraintsCount() { + if (osConstraintsBuilder_ == null) { + return osConstraints_.size(); + } else { + return osConstraintsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public com.google.identity.accesscontextmanager.v1.OsConstraint getOsConstraints(int index) { + if (osConstraintsBuilder_ == null) { + return osConstraints_.get(index); + } else { + return osConstraintsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder setOsConstraints( + int index, com.google.identity.accesscontextmanager.v1.OsConstraint value) { + if (osConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOsConstraintsIsMutable(); + osConstraints_.set(index, value); + onChanged(); + } else { + osConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder setOsConstraints( + int index, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder builderForValue) { + if (osConstraintsBuilder_ == null) { + ensureOsConstraintsIsMutable(); + osConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + osConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder addOsConstraints( + com.google.identity.accesscontextmanager.v1.OsConstraint value) { + if (osConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOsConstraintsIsMutable(); + osConstraints_.add(value); + onChanged(); + } else { + osConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder addOsConstraints( + int index, com.google.identity.accesscontextmanager.v1.OsConstraint value) { + if (osConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOsConstraintsIsMutable(); + osConstraints_.add(index, value); + onChanged(); + } else { + osConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder addOsConstraints( + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder builderForValue) { + if (osConstraintsBuilder_ == null) { + ensureOsConstraintsIsMutable(); + osConstraints_.add(builderForValue.build()); + onChanged(); + } else { + osConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder addOsConstraints( + int index, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder builderForValue) { + if (osConstraintsBuilder_ == null) { + ensureOsConstraintsIsMutable(); + osConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + osConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder addAllOsConstraints( + java.lang.Iterable + values) { + if (osConstraintsBuilder_ == null) { + ensureOsConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, osConstraints_); + onChanged(); + } else { + osConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder clearOsConstraints() { + if (osConstraintsBuilder_ == null) { + osConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + osConstraintsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public Builder removeOsConstraints(int index) { + if (osConstraintsBuilder_ == null) { + ensureOsConstraintsIsMutable(); + osConstraints_.remove(index); + onChanged(); + } else { + osConstraintsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public com.google.identity.accesscontextmanager.v1.OsConstraint.Builder getOsConstraintsBuilder( + int index) { + return getOsConstraintsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder + getOsConstraintsOrBuilder(int index) { + if (osConstraintsBuilder_ == null) { + return osConstraints_.get(index); + } else { + return osConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public java.util.List< + ? extends com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder> + getOsConstraintsOrBuilderList() { + if (osConstraintsBuilder_ != null) { + return osConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(osConstraints_); + } + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public com.google.identity.accesscontextmanager.v1.OsConstraint.Builder + addOsConstraintsBuilder() { + return getOsConstraintsFieldBuilder() + .addBuilder( + com.google.identity.accesscontextmanager.v1.OsConstraint.getDefaultInstance()); + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public com.google.identity.accesscontextmanager.v1.OsConstraint.Builder addOsConstraintsBuilder( + int index) { + return getOsConstraintsFieldBuilder() + .addBuilder( + index, com.google.identity.accesscontextmanager.v1.OsConstraint.getDefaultInstance()); + } + /** + * + * + *
+     * Allowed OS versions, an empty list allows all types and all versions.
+     * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + * + */ + public java.util.List + getOsConstraintsBuilderList() { + return getOsConstraintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.OsConstraint, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder, + com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder> + getOsConstraintsFieldBuilder() { + if (osConstraintsBuilder_ == null) { + osConstraintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.OsConstraint, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder, + com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder>( + osConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + osConstraints_ = null; + } + return osConstraintsBuilder_; + } + + private java.util.List allowedDeviceManagementLevels_ = + java.util.Collections.emptyList(); + + private void ensureAllowedDeviceManagementLevelsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + allowedDeviceManagementLevels_ = + new java.util.ArrayList(allowedDeviceManagementLevels_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the allowedDeviceManagementLevels. + */ + public java.util.List + getAllowedDeviceManagementLevelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.identity.accesscontextmanager.type.DeviceManagementLevel>( + allowedDeviceManagementLevels_, allowedDeviceManagementLevels_converter_); + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return The count of allowedDeviceManagementLevels. + */ + public int getAllowedDeviceManagementLevelsCount() { + return allowedDeviceManagementLevels_.size(); + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the element to return. + * @return The allowedDeviceManagementLevels at the given index. + */ + public com.google.identity.accesscontextmanager.type.DeviceManagementLevel + getAllowedDeviceManagementLevels(int index) { + return allowedDeviceManagementLevels_converter_.convert( + allowedDeviceManagementLevels_.get(index)); + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index to set the value at. + * @param value The allowedDeviceManagementLevels to set. + * @return This builder for chaining. + */ + public Builder setAllowedDeviceManagementLevels( + int index, com.google.identity.accesscontextmanager.type.DeviceManagementLevel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedDeviceManagementLevelsIsMutable(); + allowedDeviceManagementLevels_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param value The allowedDeviceManagementLevels to add. + * @return This builder for chaining. + */ + public Builder addAllowedDeviceManagementLevels( + com.google.identity.accesscontextmanager.type.DeviceManagementLevel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedDeviceManagementLevelsIsMutable(); + allowedDeviceManagementLevels_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param values The allowedDeviceManagementLevels to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedDeviceManagementLevels( + java.lang.Iterable< + ? extends com.google.identity.accesscontextmanager.type.DeviceManagementLevel> + values) { + ensureAllowedDeviceManagementLevelsIsMutable(); + for (com.google.identity.accesscontextmanager.type.DeviceManagementLevel value : values) { + allowedDeviceManagementLevels_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowedDeviceManagementLevels() { + allowedDeviceManagementLevels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the enum numeric values on the wire for + * allowedDeviceManagementLevels. + */ + public java.util.List getAllowedDeviceManagementLevelsValueList() { + return java.util.Collections.unmodifiableList(allowedDeviceManagementLevels_); + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedDeviceManagementLevels at the given + * index. + */ + public int getAllowedDeviceManagementLevelsValue(int index) { + return allowedDeviceManagementLevels_.get(index); + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedDeviceManagementLevels at the given + * index. + * @return This builder for chaining. + */ + public Builder setAllowedDeviceManagementLevelsValue(int index, int value) { + ensureAllowedDeviceManagementLevelsIsMutable(); + allowedDeviceManagementLevels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param value The enum numeric value on the wire for allowedDeviceManagementLevels to add. + * @return This builder for chaining. + */ + public Builder addAllowedDeviceManagementLevelsValue(int value) { + ensureAllowedDeviceManagementLevelsIsMutable(); + allowedDeviceManagementLevels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed device management levels, an empty list allows all management
+     * levels.
+     * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param values The enum numeric values on the wire for allowedDeviceManagementLevels to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedDeviceManagementLevelsValue( + java.lang.Iterable values) { + ensureAllowedDeviceManagementLevelsIsMutable(); + for (int value : values) { + allowedDeviceManagementLevels_.add(value); + } + onChanged(); + return this; + } + + private boolean requireAdminApproval_; + /** + * + * + *
+     * Whether the device needs to be approved by the customer admin.
+     * 
+ * + * bool require_admin_approval = 7; + * + * @return The requireAdminApproval. + */ + public boolean getRequireAdminApproval() { + return requireAdminApproval_; + } + /** + * + * + *
+     * Whether the device needs to be approved by the customer admin.
+     * 
+ * + * bool require_admin_approval = 7; + * + * @param value The requireAdminApproval to set. + * @return This builder for chaining. + */ + public Builder setRequireAdminApproval(boolean value) { + + requireAdminApproval_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the device needs to be approved by the customer admin.
+     * 
+ * + * bool require_admin_approval = 7; + * + * @return This builder for chaining. + */ + public Builder clearRequireAdminApproval() { + + requireAdminApproval_ = false; + onChanged(); + return this; + } + + private boolean requireCorpOwned_; + /** + * + * + *
+     * Whether the device needs to be corp owned.
+     * 
+ * + * bool require_corp_owned = 8; + * + * @return The requireCorpOwned. + */ + public boolean getRequireCorpOwned() { + return requireCorpOwned_; + } + /** + * + * + *
+     * Whether the device needs to be corp owned.
+     * 
+ * + * bool require_corp_owned = 8; + * + * @param value The requireCorpOwned to set. + * @return This builder for chaining. + */ + public Builder setRequireCorpOwned(boolean value) { + + requireCorpOwned_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the device needs to be corp owned.
+     * 
+ * + * bool require_corp_owned = 8; + * + * @return This builder for chaining. + */ + public Builder clearRequireCorpOwned() { + + requireCorpOwned_ = 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.identity.accesscontextmanager.v1.DevicePolicy) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.DevicePolicy) + private static final com.google.identity.accesscontextmanager.v1.DevicePolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.DevicePolicy(); + } + + public static com.google.identity.accesscontextmanager.v1.DevicePolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DevicePolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DevicePolicy(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.identity.accesscontextmanager.v1.DevicePolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicyOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicyOrBuilder.java new file mode 100644 index 0000000..6fc1e9f --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/DevicePolicyOrBuilder.java @@ -0,0 +1,274 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface DevicePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.DevicePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether or not screenlock is required for the DevicePolicy to be true.
+   * Defaults to `false`.
+   * 
+ * + * bool require_screenlock = 1; + * + * @return The requireScreenlock. + */ + boolean getRequireScreenlock(); + + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the allowedEncryptionStatuses. + */ + java.util.List + getAllowedEncryptionStatusesList(); + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return The count of allowedEncryptionStatuses. + */ + int getAllowedEncryptionStatusesCount(); + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the element to return. + * @return The allowedEncryptionStatuses at the given index. + */ + com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus getAllowedEncryptionStatuses( + int index); + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @return A list containing the enum numeric values on the wire for allowedEncryptionStatuses. + */ + java.util.List getAllowedEncryptionStatusesValueList(); + /** + * + * + *
+   * Allowed encryptions statuses, an empty list allows all statuses.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedEncryptionStatuses at the given index. + */ + int getAllowedEncryptionStatusesValue(int index); + + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + java.util.List getOsConstraintsList(); + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + com.google.identity.accesscontextmanager.v1.OsConstraint getOsConstraints(int index); + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + int getOsConstraintsCount(); + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + java.util.List + getOsConstraintsOrBuilderList(); + /** + * + * + *
+   * Allowed OS versions, an empty list allows all types and all versions.
+   * 
+ * + * repeated .google.identity.accesscontextmanager.v1.OsConstraint os_constraints = 3; + */ + com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder getOsConstraintsOrBuilder( + int index); + + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the allowedDeviceManagementLevels. + */ + java.util.List + getAllowedDeviceManagementLevelsList(); + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return The count of allowedDeviceManagementLevels. + */ + int getAllowedDeviceManagementLevelsCount(); + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the element to return. + * @return The allowedDeviceManagementLevels at the given index. + */ + com.google.identity.accesscontextmanager.type.DeviceManagementLevel + getAllowedDeviceManagementLevels(int index); + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @return A list containing the enum numeric values on the wire for + * allowedDeviceManagementLevels. + */ + java.util.List getAllowedDeviceManagementLevelsValueList(); + /** + * + * + *
+   * Allowed device management levels, an empty list allows all management
+   * levels.
+   * 
+ * + * + * repeated .google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of allowedDeviceManagementLevels at the given index. + */ + int getAllowedDeviceManagementLevelsValue(int index); + + /** + * + * + *
+   * Whether the device needs to be approved by the customer admin.
+   * 
+ * + * bool require_admin_approval = 7; + * + * @return The requireAdminApproval. + */ + boolean getRequireAdminApproval(); + + /** + * + * + *
+   * Whether the device needs to be corp owned.
+   * 
+ * + * bool require_corp_owned = 8; + * + * @return The requireCorpOwned. + */ + boolean getRequireCorpOwned(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraint.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraint.java new file mode 100644 index 0000000..f520786 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraint.java @@ -0,0 +1,900 @@ +/* + * 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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * A restriction on the OS type and version of devices making requests.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.OsConstraint} + */ +public final class OsConstraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.OsConstraint) + OsConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use OsConstraint.newBuilder() to construct. + private OsConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OsConstraint() { + osType_ = 0; + minimumVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OsConstraint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OsConstraint( + 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(); + + osType_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + minimumVersion_ = s; + break; + } + case 24: + { + requireVerifiedChromeOs_ = 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.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_OsConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.OsConstraint.class, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder.class); + } + + public static final int OS_TYPE_FIELD_NUMBER = 1; + private int osType_; + /** + * + * + *
+   * Required. The allowed OS type.
+   * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The enum numeric value on the wire for osType. + */ + public int getOsTypeValue() { + return osType_; + } + /** + * + * + *
+   * Required. The allowed OS type.
+   * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The osType. + */ + public com.google.identity.accesscontextmanager.type.OsType getOsType() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.type.OsType result = + com.google.identity.accesscontextmanager.type.OsType.valueOf(osType_); + return result == null + ? com.google.identity.accesscontextmanager.type.OsType.UNRECOGNIZED + : result; + } + + public static final int MINIMUM_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object minimumVersion_; + /** + * + * + *
+   * The minimum allowed OS version. If not set, any version of this OS
+   * satisfies the constraint. Format: `"major.minor.patch"`.
+   * Examples: `"10.5.301"`, `"9.2.1"`.
+   * 
+ * + * string minimum_version = 2; + * + * @return The minimumVersion. + */ + public java.lang.String getMinimumVersion() { + java.lang.Object ref = minimumVersion_; + 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(); + minimumVersion_ = s; + return s; + } + } + /** + * + * + *
+   * The minimum allowed OS version. If not set, any version of this OS
+   * satisfies the constraint. Format: `"major.minor.patch"`.
+   * Examples: `"10.5.301"`, `"9.2.1"`.
+   * 
+ * + * string minimum_version = 2; + * + * @return The bytes for minimumVersion. + */ + public com.google.protobuf.ByteString getMinimumVersionBytes() { + java.lang.Object ref = minimumVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minimumVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRE_VERIFIED_CHROME_OS_FIELD_NUMBER = 3; + private boolean requireVerifiedChromeOs_; + /** + * + * + *
+   * Only allows requests from devices with a verified Chrome OS.
+   * Verifications includes requirements that the device is enterprise-managed,
+   * conformant to domain policies, and the caller has permission to call
+   * the API targeted by the request.
+   * 
+ * + * bool require_verified_chrome_os = 3; + * + * @return The requireVerifiedChromeOs. + */ + public boolean getRequireVerifiedChromeOs() { + return requireVerifiedChromeOs_; + } + + 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 (osType_ + != com.google.identity.accesscontextmanager.type.OsType.OS_UNSPECIFIED.getNumber()) { + output.writeEnum(1, osType_); + } + if (!getMinimumVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, minimumVersion_); + } + if (requireVerifiedChromeOs_ != false) { + output.writeBool(3, requireVerifiedChromeOs_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (osType_ + != com.google.identity.accesscontextmanager.type.OsType.OS_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, osType_); + } + if (!getMinimumVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, minimumVersion_); + } + if (requireVerifiedChromeOs_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, requireVerifiedChromeOs_); + } + 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.identity.accesscontextmanager.v1.OsConstraint)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.OsConstraint other = + (com.google.identity.accesscontextmanager.v1.OsConstraint) obj; + + if (osType_ != other.osType_) return false; + if (!getMinimumVersion().equals(other.getMinimumVersion())) return false; + if (getRequireVerifiedChromeOs() != other.getRequireVerifiedChromeOs()) 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) + OS_TYPE_FIELD_NUMBER; + hash = (53 * hash) + osType_; + hash = (37 * hash) + MINIMUM_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMinimumVersion().hashCode(); + hash = (37 * hash) + REQUIRE_VERIFIED_CHROME_OS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireVerifiedChromeOs()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint 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.identity.accesscontextmanager.v1.OsConstraint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint 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.identity.accesscontextmanager.v1.OsConstraint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint 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.identity.accesscontextmanager.v1.OsConstraint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint 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.identity.accesscontextmanager.v1.OsConstraint 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 restriction on the OS type and version of devices making requests.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.OsConstraint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.OsConstraint) + com.google.identity.accesscontextmanager.v1.OsConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_OsConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.OsConstraint.class, + com.google.identity.accesscontextmanager.v1.OsConstraint.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.OsConstraint.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(); + osType_ = 0; + + minimumVersion_ = ""; + + requireVerifiedChromeOs_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.AccessLevelProto + .internal_static_google_identity_accesscontextmanager_v1_OsConstraint_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.OsConstraint getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.OsConstraint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.OsConstraint build() { + com.google.identity.accesscontextmanager.v1.OsConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.OsConstraint buildPartial() { + com.google.identity.accesscontextmanager.v1.OsConstraint result = + new com.google.identity.accesscontextmanager.v1.OsConstraint(this); + result.osType_ = osType_; + result.minimumVersion_ = minimumVersion_; + result.requireVerifiedChromeOs_ = requireVerifiedChromeOs_; + 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.identity.accesscontextmanager.v1.OsConstraint) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.OsConstraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.OsConstraint other) { + if (other == com.google.identity.accesscontextmanager.v1.OsConstraint.getDefaultInstance()) + return this; + if (other.osType_ != 0) { + setOsTypeValue(other.getOsTypeValue()); + } + if (!other.getMinimumVersion().isEmpty()) { + minimumVersion_ = other.minimumVersion_; + onChanged(); + } + if (other.getRequireVerifiedChromeOs() != false) { + setRequireVerifiedChromeOs(other.getRequireVerifiedChromeOs()); + } + 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.identity.accesscontextmanager.v1.OsConstraint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.OsConstraint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int osType_ = 0; + /** + * + * + *
+     * Required. The allowed OS type.
+     * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The enum numeric value on the wire for osType. + */ + public int getOsTypeValue() { + return osType_; + } + /** + * + * + *
+     * Required. The allowed OS type.
+     * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @param value The enum numeric value on the wire for osType to set. + * @return This builder for chaining. + */ + public Builder setOsTypeValue(int value) { + osType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The allowed OS type.
+     * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The osType. + */ + public com.google.identity.accesscontextmanager.type.OsType getOsType() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.type.OsType result = + com.google.identity.accesscontextmanager.type.OsType.valueOf(osType_); + return result == null + ? com.google.identity.accesscontextmanager.type.OsType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The allowed OS type.
+     * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @param value The osType to set. + * @return This builder for chaining. + */ + public Builder setOsType(com.google.identity.accesscontextmanager.type.OsType value) { + if (value == null) { + throw new NullPointerException(); + } + + osType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The allowed OS type.
+     * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearOsType() { + + osType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object minimumVersion_ = ""; + /** + * + * + *
+     * The minimum allowed OS version. If not set, any version of this OS
+     * satisfies the constraint. Format: `"major.minor.patch"`.
+     * Examples: `"10.5.301"`, `"9.2.1"`.
+     * 
+ * + * string minimum_version = 2; + * + * @return The minimumVersion. + */ + public java.lang.String getMinimumVersion() { + java.lang.Object ref = minimumVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + minimumVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The minimum allowed OS version. If not set, any version of this OS
+     * satisfies the constraint. Format: `"major.minor.patch"`.
+     * Examples: `"10.5.301"`, `"9.2.1"`.
+     * 
+ * + * string minimum_version = 2; + * + * @return The bytes for minimumVersion. + */ + public com.google.protobuf.ByteString getMinimumVersionBytes() { + java.lang.Object ref = minimumVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minimumVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The minimum allowed OS version. If not set, any version of this OS
+     * satisfies the constraint. Format: `"major.minor.patch"`.
+     * Examples: `"10.5.301"`, `"9.2.1"`.
+     * 
+ * + * string minimum_version = 2; + * + * @param value The minimumVersion to set. + * @return This builder for chaining. + */ + public Builder setMinimumVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + minimumVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum allowed OS version. If not set, any version of this OS
+     * satisfies the constraint. Format: `"major.minor.patch"`.
+     * Examples: `"10.5.301"`, `"9.2.1"`.
+     * 
+ * + * string minimum_version = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinimumVersion() { + + minimumVersion_ = getDefaultInstance().getMinimumVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum allowed OS version. If not set, any version of this OS
+     * satisfies the constraint. Format: `"major.minor.patch"`.
+     * Examples: `"10.5.301"`, `"9.2.1"`.
+     * 
+ * + * string minimum_version = 2; + * + * @param value The bytes for minimumVersion to set. + * @return This builder for chaining. + */ + public Builder setMinimumVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + minimumVersion_ = value; + onChanged(); + return this; + } + + private boolean requireVerifiedChromeOs_; + /** + * + * + *
+     * Only allows requests from devices with a verified Chrome OS.
+     * Verifications includes requirements that the device is enterprise-managed,
+     * conformant to domain policies, and the caller has permission to call
+     * the API targeted by the request.
+     * 
+ * + * bool require_verified_chrome_os = 3; + * + * @return The requireVerifiedChromeOs. + */ + public boolean getRequireVerifiedChromeOs() { + return requireVerifiedChromeOs_; + } + /** + * + * + *
+     * Only allows requests from devices with a verified Chrome OS.
+     * Verifications includes requirements that the device is enterprise-managed,
+     * conformant to domain policies, and the caller has permission to call
+     * the API targeted by the request.
+     * 
+ * + * bool require_verified_chrome_os = 3; + * + * @param value The requireVerifiedChromeOs to set. + * @return This builder for chaining. + */ + public Builder setRequireVerifiedChromeOs(boolean value) { + + requireVerifiedChromeOs_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Only allows requests from devices with a verified Chrome OS.
+     * Verifications includes requirements that the device is enterprise-managed,
+     * conformant to domain policies, and the caller has permission to call
+     * the API targeted by the request.
+     * 
+ * + * bool require_verified_chrome_os = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequireVerifiedChromeOs() { + + requireVerifiedChromeOs_ = 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.identity.accesscontextmanager.v1.OsConstraint) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.OsConstraint) + private static final com.google.identity.accesscontextmanager.v1.OsConstraint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.OsConstraint(); + } + + public static com.google.identity.accesscontextmanager.v1.OsConstraint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OsConstraint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OsConstraint(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.identity.accesscontextmanager.v1.OsConstraint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraintOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraintOrBuilder.java new file mode 100644 index 0000000..ecb5082 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/OsConstraintOrBuilder.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/identity/accesscontextmanager/v1/access_level.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface OsConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.OsConstraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The allowed OS type.
+   * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The enum numeric value on the wire for osType. + */ + int getOsTypeValue(); + /** + * + * + *
+   * Required. The allowed OS type.
+   * 
+ * + * .google.identity.accesscontextmanager.type.OsType os_type = 1; + * + * @return The osType. + */ + com.google.identity.accesscontextmanager.type.OsType getOsType(); + + /** + * + * + *
+   * The minimum allowed OS version. If not set, any version of this OS
+   * satisfies the constraint. Format: `"major.minor.patch"`.
+   * Examples: `"10.5.301"`, `"9.2.1"`.
+   * 
+ * + * string minimum_version = 2; + * + * @return The minimumVersion. + */ + java.lang.String getMinimumVersion(); + /** + * + * + *
+   * The minimum allowed OS version. If not set, any version of this OS
+   * satisfies the constraint. Format: `"major.minor.patch"`.
+   * Examples: `"10.5.301"`, `"9.2.1"`.
+   * 
+ * + * string minimum_version = 2; + * + * @return The bytes for minimumVersion. + */ + com.google.protobuf.ByteString getMinimumVersionBytes(); + + /** + * + * + *
+   * Only allows requests from devices with a verified Chrome OS.
+   * Verifications includes requirements that the device is enterprise-managed,
+   * conformant to domain policies, and the caller has permission to call
+   * the API targeted by the request.
+   * 
+ * + * bool require_verified_chrome_os = 3; + * + * @return The requireVerifiedChromeOs. + */ + boolean getRequireVerifiedChromeOs(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/PolicyProto.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/PolicyProto.java new file mode 100644 index 0000000..012318d --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/PolicyProto.java @@ -0,0 +1,80 @@ +/* + * 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/identity/accesscontextmanager/v1/access_policy.proto + +package com.google.identity.accesscontextmanager.v1; + +public final class PolicyProto { + private PolicyProto() {} + + 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_identity_accesscontextmanager_v1_AccessPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n;google/identity/accesscontextmanager/v" + + "1/access_policy.proto\022\'google.identity.a" + + "ccesscontextmanager.v1\032\037google/protobuf/" + + "timestamp.proto\032\034google/api/annotations." + + "proto\"\253\001\n\014AccessPolicy\022\014\n\004name\030\001 \001(\t\022\016\n\006" + + "parent\030\002 \001(\t\022\r\n\005title\030\003 \001(\t\022/\n\013create_ti" + + "me\030\004 \001(\0132\032.google.protobuf.Timestamp\022/\n\013" + + "update_time\030\005 \001(\0132\032.google.protobuf.Time" + + "stamp\022\014\n\004etag\030\006 \001(\tB\241\002\n+com.google.ident" + + "ity.accesscontextmanager.v1B\013PolicyProto" + + "P\001Z[google.golang.org/genproto/googleapi" + + "s/identity/accesscontextmanager/v1;acces" + + "scontextmanager\242\002\004GACM\252\002\'Google.Identity" + + ".AccessContextManager.V1\312\002\'Google\\Identi" + + "ty\\AccessContextManager\\V1\352\002*Google::Ide" + + "ntity::AccessContextManager::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_AccessPolicy_descriptor, + new java.lang.String[] { + "Name", "Parent", "Title", "CreateTime", "UpdateTime", "Etag", + }); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeter.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeter.java new file mode 100644 index 0000000..feea97b --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeter.java @@ -0,0 +1,2677 @@ +/* + * 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/identity/accesscontextmanager/v1/service_perimeter.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `ServicePerimeter` describes a set of Google Cloud resources which can freely
+ * import and export data amongst themselves, but not export outside of the
+ * `ServicePerimeter`. If a request with a source within this `ServicePerimeter`
+ * has a target outside of the `ServicePerimeter`, the request will be blocked.
+ * Otherwise the request is allowed. There are two types of Service Perimeter -
+ * Regular and Bridge. Regular Service Perimeters cannot overlap, a single
+ * Google Cloud project can only belong to a single regular Service Perimeter.
+ * Service Perimeter Bridges can contain only Google Cloud projects as members,
+ * a single Google Cloud project may belong to multiple Service Perimeter
+ * Bridges.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.ServicePerimeter} + */ +public final class ServicePerimeter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.ServicePerimeter) + ServicePerimeterOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServicePerimeter.newBuilder() to construct. + private ServicePerimeter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServicePerimeter() { + name_ = ""; + title_ = ""; + description_ = ""; + perimeterType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServicePerimeter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServicePerimeter( + 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(); + + title_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + perimeterType_ = rawValue; + break; + } + case 58: + { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + subBuilder = null; + if (spec_ != null) { + subBuilder = spec_.toBuilder(); + } + spec_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spec_); + spec_ = subBuilder.buildPartial(); + } + + break; + } + case 72: + { + useExplicitDryRunSpec_ = 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.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeter.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder.class); + } + + /** + * + * + *
+   * Specifies the type of the Perimeter. There are two types: regular and
+   * bridge. Regular Service Perimeter contains resources, access levels, and
+   * restricted services. Every resource can be in at most ONE
+   * regular Service Perimeter.
+   * In addition to being in a regular service perimeter, a resource can also
+   * be in zero or more perimeter bridges.  A perimeter bridge only contains
+   * resources.  Cross project operations are permitted if all effected
+   * resources share some perimeter (whether bridge or regular). Perimeter
+   * Bridge does not contain access levels or services: those are governed
+   * entirely by the regular perimeter that resource is in.
+   * Perimeter Bridges are typically useful when building more complex toplogies
+   * with many independent perimeters that need to share some data with a common
+   * perimeter, but should not be able to share data among themselves.
+   * 
+ * + * Protobuf enum {@code google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} + */ + public enum PerimeterType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Regular Perimeter.
+     * 
+ * + * PERIMETER_TYPE_REGULAR = 0; + */ + PERIMETER_TYPE_REGULAR(0), + /** + * + * + *
+     * Perimeter Bridge.
+     * 
+ * + * PERIMETER_TYPE_BRIDGE = 1; + */ + PERIMETER_TYPE_BRIDGE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Regular Perimeter.
+     * 
+ * + * PERIMETER_TYPE_REGULAR = 0; + */ + public static final int PERIMETER_TYPE_REGULAR_VALUE = 0; + /** + * + * + *
+     * Perimeter Bridge.
+     * 
+ * + * PERIMETER_TYPE_BRIDGE = 1; + */ + public static final int PERIMETER_TYPE_BRIDGE_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 PerimeterType 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 PerimeterType forNumber(int value) { + switch (value) { + case 0: + return PERIMETER_TYPE_REGULAR; + case 1: + return PERIMETER_TYPE_BRIDGE; + 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 PerimeterType findValueByNumber(int number) { + return PerimeterType.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.identity.accesscontextmanager.v1.ServicePerimeter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final PerimeterType[] VALUES = values(); + + public static PerimeterType 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 PerimeterType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name for the ServicePerimeter.  The `short_name`
+   * component must begin with a letter and only include alphanumeric and '_'.
+   * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Required. Resource name for the ServicePerimeter.  The `short_name`
+   * component must begin with a letter and only include alphanumeric and '_'.
+   * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+   * 
+ * + * 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 TITLE_FIELD_NUMBER = 2; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of the `ServicePerimeter` and its use. Does not affect
+   * behavior.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of the `ServicePerimeter` and its use. Does not affect
+   * behavior.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int PERIMETER_TYPE_FIELD_NUMBER = 6; + private int perimeterType_; + /** + * + * + *
+   * Perimeter type indicator. A single project is
+   * allowed to be a member of single regular perimeter, but multiple service
+   * perimeter bridges. A project cannot be a included in a perimeter bridge
+   * without being included in regular perimeter. For perimeter bridges,
+   * the restricted service list as well as access level lists must be
+   * empty.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The enum numeric value on the wire for perimeterType. + */ + public int getPerimeterTypeValue() { + return perimeterType_; + } + /** + * + * + *
+   * Perimeter type indicator. A single project is
+   * allowed to be a member of single regular perimeter, but multiple service
+   * perimeter bridges. A project cannot be a included in a perimeter bridge
+   * without being included in regular perimeter. For perimeter bridges,
+   * the restricted service list as well as access level lists must be
+   * empty.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The perimeterType. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + getPerimeterType() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType result = + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType.valueOf( + perimeterType_); + return result == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType.UNRECOGNIZED + : result; + } + + public static final int STATUS_FIELD_NUMBER = 7; + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig status_; + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return The status. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getStatus() { + return status_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.getDefaultInstance() + : status_; + } + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder + getStatusOrBuilder() { + return getStatus(); + } + + public static final int SPEC_FIELD_NUMBER = 8; + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec_; + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return Whether the spec field is set. + */ + public boolean hasSpec() { + return spec_ != null; + } + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return The spec. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getSpec() { + return spec_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.getDefaultInstance() + : spec_; + } + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder + getSpecOrBuilder() { + return getSpec(); + } + + public static final int USE_EXPLICIT_DRY_RUN_SPEC_FIELD_NUMBER = 9; + private boolean useExplicitDryRunSpec_; + /** + * + * + *
+   * Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly
+   * exists  for all Service Perimeters, and that spec is identical to the
+   * status for those Service Perimeters. When this flag is set, it inhibits the
+   * generation of the implicit spec, thereby allowing the user to explicitly
+   * provide a configuration ("spec") to use in a dry-run version of the Service
+   * Perimeter. This allows the user to test changes to the enforced config
+   * ("status") without actually enforcing them. This testing is done through
+   * analyzing the differences between currently enforced and suggested
+   * restrictions. use_explicit_dry_run_spec must bet set to True if any of the
+   * fields in the spec are set to non-default values.
+   * 
+ * + * bool use_explicit_dry_run_spec = 9; + * + * @return The useExplicitDryRunSpec. + */ + public boolean getUseExplicitDryRunSpec() { + return useExplicitDryRunSpec_; + } + + 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 (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (perimeterType_ + != com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + .PERIMETER_TYPE_REGULAR + .getNumber()) { + output.writeEnum(6, perimeterType_); + } + if (status_ != null) { + output.writeMessage(7, getStatus()); + } + if (spec_ != null) { + output.writeMessage(8, getSpec()); + } + if (useExplicitDryRunSpec_ != false) { + output.writeBool(9, useExplicitDryRunSpec_); + } + 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 (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (perimeterType_ + != com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + .PERIMETER_TYPE_REGULAR + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, perimeterType_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStatus()); + } + if (spec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSpec()); + } + if (useExplicitDryRunSpec_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, useExplicitDryRunSpec_); + } + 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.identity.accesscontextmanager.v1.ServicePerimeter)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.ServicePerimeter other = + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (perimeterType_ != other.perimeterType_) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasSpec() != other.hasSpec()) return false; + if (hasSpec()) { + if (!getSpec().equals(other.getSpec())) return false; + } + if (getUseExplicitDryRunSpec() != other.getUseExplicitDryRunSpec()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + PERIMETER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + perimeterType_; + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + hash = (37 * hash) + USE_EXPLICIT_DRY_RUN_SPEC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseExplicitDryRunSpec()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter 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.identity.accesscontextmanager.v1.ServicePerimeter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter 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.identity.accesscontextmanager.v1.ServicePerimeter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter 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.identity.accesscontextmanager.v1.ServicePerimeter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter 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.identity.accesscontextmanager.v1.ServicePerimeter 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; + } + /** + * + * + *
+   * `ServicePerimeter` describes a set of Google Cloud resources which can freely
+   * import and export data amongst themselves, but not export outside of the
+   * `ServicePerimeter`. If a request with a source within this `ServicePerimeter`
+   * has a target outside of the `ServicePerimeter`, the request will be blocked.
+   * Otherwise the request is allowed. There are two types of Service Perimeter -
+   * Regular and Bridge. Regular Service Perimeters cannot overlap, a single
+   * Google Cloud project can only belong to a single regular Service Perimeter.
+   * Service Perimeter Bridges can contain only Google Cloud projects as members,
+   * a single Google Cloud project may belong to multiple Service Perimeter
+   * Bridges.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.ServicePerimeter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.ServicePerimeter) + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeter.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder.class); + } + + // Construct using com.google.identity.accesscontextmanager.v1.ServicePerimeter.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_ = ""; + + title_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + perimeterType_ = 0; + + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (specBuilder_ == null) { + spec_ = null; + } else { + spec_ = null; + specBuilder_ = null; + } + useExplicitDryRunSpec_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeter + getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeter build() { + com.google.identity.accesscontextmanager.v1.ServicePerimeter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeter buildPartial() { + com.google.identity.accesscontextmanager.v1.ServicePerimeter result = + new com.google.identity.accesscontextmanager.v1.ServicePerimeter(this); + result.name_ = name_; + result.title_ = title_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.perimeterType_ = perimeterType_; + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (specBuilder_ == null) { + result.spec_ = spec_; + } else { + result.spec_ = specBuilder_.build(); + } + result.useExplicitDryRunSpec_ = useExplicitDryRunSpec_; + 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.identity.accesscontextmanager.v1.ServicePerimeter) { + return mergeFrom((com.google.identity.accesscontextmanager.v1.ServicePerimeter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.identity.accesscontextmanager.v1.ServicePerimeter other) { + if (other + == com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.perimeterType_ != 0) { + setPerimeterTypeValue(other.getPerimeterTypeValue()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + if (other.getUseExplicitDryRunSpec() != false) { + setUseExplicitDryRunSpec(other.getUseExplicitDryRunSpec()); + } + 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.identity.accesscontextmanager.v1.ServicePerimeter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name for the ServicePerimeter.  The `short_name`
+     * component must begin with a letter and only include alphanumeric and '_'.
+     * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Required. Resource name for the ServicePerimeter.  The `short_name`
+     * component must begin with a letter and only include alphanumeric and '_'.
+     * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Required. Resource name for the ServicePerimeter.  The `short_name`
+     * component must begin with a letter and only include alphanumeric and '_'.
+     * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Required. Resource name for the ServicePerimeter.  The `short_name`
+     * component must begin with a letter and only include alphanumeric and '_'.
+     * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for the ServicePerimeter.  The `short_name`
+     * component must begin with a letter and only include alphanumeric and '_'.
+     * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+     * 
+ * + * 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 title_ = ""; + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable title. Must be unique within the Policy.
+     * 
+ * + * string title = 2; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the `ServicePerimeter` and its use. Does not affect
+     * behavior.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of the `ServicePerimeter` and its use. Does not affect
+     * behavior.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of the `ServicePerimeter` and its use. Does not affect
+     * behavior.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the `ServicePerimeter` and its use. Does not affect
+     * behavior.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the `ServicePerimeter` and its use. Does not affect
+     * behavior.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was created in UTC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time the `ServicePerimeter` was updated in UTC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int perimeterType_ = 0; + /** + * + * + *
+     * Perimeter type indicator. A single project is
+     * allowed to be a member of single regular perimeter, but multiple service
+     * perimeter bridges. A project cannot be a included in a perimeter bridge
+     * without being included in regular perimeter. For perimeter bridges,
+     * the restricted service list as well as access level lists must be
+     * empty.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The enum numeric value on the wire for perimeterType. + */ + public int getPerimeterTypeValue() { + return perimeterType_; + } + /** + * + * + *
+     * Perimeter type indicator. A single project is
+     * allowed to be a member of single regular perimeter, but multiple service
+     * perimeter bridges. A project cannot be a included in a perimeter bridge
+     * without being included in regular perimeter. For perimeter bridges,
+     * the restricted service list as well as access level lists must be
+     * empty.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @param value The enum numeric value on the wire for perimeterType to set. + * @return This builder for chaining. + */ + public Builder setPerimeterTypeValue(int value) { + perimeterType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Perimeter type indicator. A single project is
+     * allowed to be a member of single regular perimeter, but multiple service
+     * perimeter bridges. A project cannot be a included in a perimeter bridge
+     * without being included in regular perimeter. For perimeter bridges,
+     * the restricted service list as well as access level lists must be
+     * empty.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The perimeterType. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + getPerimeterType() { + @SuppressWarnings("deprecation") + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType result = + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType.valueOf( + perimeterType_); + return result == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Perimeter type indicator. A single project is
+     * allowed to be a member of single regular perimeter, but multiple service
+     * perimeter bridges. A project cannot be a included in a perimeter bridge
+     * without being included in regular perimeter. For perimeter bridges,
+     * the restricted service list as well as access level lists must be
+     * empty.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @param value The perimeterType to set. + * @return This builder for chaining. + */ + public Builder setPerimeterType( + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType value) { + if (value == null) { + throw new NullPointerException(); + } + + perimeterType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Perimeter type indicator. A single project is
+     * allowed to be a member of single regular perimeter, but multiple service
+     * perimeter bridges. A project cannot be a included in a perimeter bridge
+     * without being included in regular perimeter. For perimeter bridges,
+     * the restricted service list as well as access level lists must be
+     * empty.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearPerimeterType() { + + perimeterType_ = 0; + onChanged(); + return this; + } + + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return The status. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public Builder setStatus( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public Builder setStatus( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public Builder mergeStatus( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.newBuilder(status_) + .mergeFrom(value) + .buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder + getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance() + : status_; + } + } + /** + * + * + *
+     * Current ServicePerimeter configuration. Specifies sets of resources,
+     * restricted services and access levels that determine perimeter
+     * content and boundaries.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder> + specBuilder_; + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return Whether the spec field is set. + */ + public boolean hasSpec() { + return specBuilder_ != null || spec_ != null; + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return The spec. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public Builder setSpec( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public Builder setSpec( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public Builder mergeSpec( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig value) { + if (specBuilder_ == null) { + if (spec_ != null) { + spec_ = + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.newBuilder(spec_) + .mergeFrom(value) + .buildPartial(); + } else { + spec_ = value; + } + onChanged(); + } else { + specBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + spec_ = null; + onChanged(); + } else { + spec_ = null; + specBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder + getSpecBuilder() { + + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder + getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+     * Proposed (or dry run) ServicePerimeter configuration. This configuration
+     * allows to specify and test ServicePerimeter configuration without enforcing
+     * actual access restrictions. Only allowed to be set when the
+     * "use_explicit_dry_run_spec" flag is set.
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + private boolean useExplicitDryRunSpec_; + /** + * + * + *
+     * Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly
+     * exists  for all Service Perimeters, and that spec is identical to the
+     * status for those Service Perimeters. When this flag is set, it inhibits the
+     * generation of the implicit spec, thereby allowing the user to explicitly
+     * provide a configuration ("spec") to use in a dry-run version of the Service
+     * Perimeter. This allows the user to test changes to the enforced config
+     * ("status") without actually enforcing them. This testing is done through
+     * analyzing the differences between currently enforced and suggested
+     * restrictions. use_explicit_dry_run_spec must bet set to True if any of the
+     * fields in the spec are set to non-default values.
+     * 
+ * + * bool use_explicit_dry_run_spec = 9; + * + * @return The useExplicitDryRunSpec. + */ + public boolean getUseExplicitDryRunSpec() { + return useExplicitDryRunSpec_; + } + /** + * + * + *
+     * Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly
+     * exists  for all Service Perimeters, and that spec is identical to the
+     * status for those Service Perimeters. When this flag is set, it inhibits the
+     * generation of the implicit spec, thereby allowing the user to explicitly
+     * provide a configuration ("spec") to use in a dry-run version of the Service
+     * Perimeter. This allows the user to test changes to the enforced config
+     * ("status") without actually enforcing them. This testing is done through
+     * analyzing the differences between currently enforced and suggested
+     * restrictions. use_explicit_dry_run_spec must bet set to True if any of the
+     * fields in the spec are set to non-default values.
+     * 
+ * + * bool use_explicit_dry_run_spec = 9; + * + * @param value The useExplicitDryRunSpec to set. + * @return This builder for chaining. + */ + public Builder setUseExplicitDryRunSpec(boolean value) { + + useExplicitDryRunSpec_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly
+     * exists  for all Service Perimeters, and that spec is identical to the
+     * status for those Service Perimeters. When this flag is set, it inhibits the
+     * generation of the implicit spec, thereby allowing the user to explicitly
+     * provide a configuration ("spec") to use in a dry-run version of the Service
+     * Perimeter. This allows the user to test changes to the enforced config
+     * ("status") without actually enforcing them. This testing is done through
+     * analyzing the differences between currently enforced and suggested
+     * restrictions. use_explicit_dry_run_spec must bet set to True if any of the
+     * fields in the spec are set to non-default values.
+     * 
+ * + * bool use_explicit_dry_run_spec = 9; + * + * @return This builder for chaining. + */ + public Builder clearUseExplicitDryRunSpec() { + + useExplicitDryRunSpec_ = 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.identity.accesscontextmanager.v1.ServicePerimeter) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.ServicePerimeter) + private static final com.google.identity.accesscontextmanager.v1.ServicePerimeter + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.ServicePerimeter(); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServicePerimeter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServicePerimeter(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.identity.accesscontextmanager.v1.ServicePerimeter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfig.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfig.java new file mode 100644 index 0000000..d9d9f65 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfig.java @@ -0,0 +1,2746 @@ +/* + * 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/identity/accesscontextmanager/v1/service_perimeter.proto + +package com.google.identity.accesscontextmanager.v1; + +/** + * + * + *
+ * `ServicePerimeterConfig` specifies a set of Google Cloud resources that
+ * describe specific Service Perimeter configuration.
+ * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.ServicePerimeterConfig} + */ +public final class ServicePerimeterConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + ServicePerimeterConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServicePerimeterConfig.newBuilder() to construct. + private ServicePerimeterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServicePerimeterConfig() { + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + restrictedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServicePerimeterConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServicePerimeterConfig( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + resources_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + resources_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + accessLevels_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + accessLevels_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + restrictedServices_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + restrictedServices_.add(s); + break; + } + case 82: + { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.Builder + subBuilder = null; + if (vpcAccessibleServices_ != null) { + subBuilder = vpcAccessibleServices_.toBuilder(); + } + vpcAccessibleServices_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(vpcAccessibleServices_); + vpcAccessibleServices_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + resources_ = resources_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + accessLevels_ = accessLevels_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + restrictedServices_ = restrictedServices_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder.class); + } + + public interface VpcAccessibleServicesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Whether to restrict API calls within the Service Perimeter to the list of
+     * APIs specified in 'allowed_services'.
+     * 
+ * + * bool enable_restriction = 1; + * + * @return The enableRestriction. + */ + boolean getEnableRestriction(); + + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @return A list containing the allowedServices. + */ + java.util.List getAllowedServicesList(); + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @return The count of allowedServices. + */ + int getAllowedServicesCount(); + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the element to return. + * @return The allowedServices at the given index. + */ + java.lang.String getAllowedServices(int index); + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allowedServices at the given index. + */ + com.google.protobuf.ByteString getAllowedServicesBytes(int index); + } + /** + * + * + *
+   * Specifies how APIs are allowed to communicate within the Service
+   * Perimeter.
+   * 
+ * + * Protobuf type {@code + * google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} + */ + public static final class VpcAccessibleServices extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + VpcAccessibleServicesOrBuilder { + private static final long serialVersionUID = 0L; + // Use VpcAccessibleServices.newBuilder() to construct. + private VpcAccessibleServices(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VpcAccessibleServices() { + allowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VpcAccessibleServices(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VpcAccessibleServices( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableRestriction_ = input.readBool(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedServices_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedServices_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allowedServices_ = allowedServices_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.Builder.class); + } + + public static final int ENABLE_RESTRICTION_FIELD_NUMBER = 1; + private boolean enableRestriction_; + /** + * + * + *
+     * Whether to restrict API calls within the Service Perimeter to the list of
+     * APIs specified in 'allowed_services'.
+     * 
+ * + * bool enable_restriction = 1; + * + * @return The enableRestriction. + */ + public boolean getEnableRestriction() { + return enableRestriction_; + } + + public static final int ALLOWED_SERVICES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList allowedServices_; + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @return A list containing the allowedServices. + */ + public com.google.protobuf.ProtocolStringList getAllowedServicesList() { + return allowedServices_; + } + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @return The count of allowedServices. + */ + public int getAllowedServicesCount() { + return allowedServices_.size(); + } + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the element to return. + * @return The allowedServices at the given index. + */ + public java.lang.String getAllowedServices(int index) { + return allowedServices_.get(index); + } + /** + * + * + *
+     * The list of APIs usable within the Service Perimeter. Must be empty
+     * unless 'enable_restriction' is True.
+     * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allowedServices at the given index. + */ + public com.google.protobuf.ByteString getAllowedServicesBytes(int index) { + return allowedServices_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enableRestriction_ != false) { + output.writeBool(1, enableRestriction_); + } + for (int i = 0; i < allowedServices_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allowedServices_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableRestriction_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableRestriction_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedServices_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedServices_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedServicesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + other = + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices) + obj; + + if (getEnableRestriction() != other.getEnableRestriction()) return false; + if (!getAllowedServicesList().equals(other.getAllowedServicesList())) 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) + ENABLE_RESTRICTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableRestriction()); + if (getAllowedServicesCount() > 0) { + hash = (37 * hash) + ALLOWED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedServicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + 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; + } + /** + * + * + *
+     * Specifies how APIs are allowed to communicate within the Service
+     * Perimeter.
+     * 
+ * + * Protobuf type {@code + * google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.Builder.class); + } + + // Construct using + // com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.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(); + enableRestriction_ = false; + + allowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + build() { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + buildPartial() { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + result = + new com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices(this); + int from_bitField0_ = bitField0_; + result.enableRestriction_ = enableRestriction_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedServices_ = allowedServices_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedServices_ = allowedServices_; + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices) { + return mergeFrom( + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + other) { + if (other + == com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.getDefaultInstance()) return this; + if (other.getEnableRestriction() != false) { + setEnableRestriction(other.getEnableRestriction()); + } + if (!other.allowedServices_.isEmpty()) { + if (allowedServices_.isEmpty()) { + allowedServices_ = other.allowedServices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedServicesIsMutable(); + allowedServices_.addAll(other.allowedServices_); + } + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private boolean enableRestriction_; + /** + * + * + *
+       * Whether to restrict API calls within the Service Perimeter to the list of
+       * APIs specified in 'allowed_services'.
+       * 
+ * + * bool enable_restriction = 1; + * + * @return The enableRestriction. + */ + public boolean getEnableRestriction() { + return enableRestriction_; + } + /** + * + * + *
+       * Whether to restrict API calls within the Service Perimeter to the list of
+       * APIs specified in 'allowed_services'.
+       * 
+ * + * bool enable_restriction = 1; + * + * @param value The enableRestriction to set. + * @return This builder for chaining. + */ + public Builder setEnableRestriction(boolean value) { + + enableRestriction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to restrict API calls within the Service Perimeter to the list of
+       * APIs specified in 'allowed_services'.
+       * 
+ * + * bool enable_restriction = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableRestriction() { + + enableRestriction_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList allowedServices_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedServicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedServices_ = new com.google.protobuf.LazyStringArrayList(allowedServices_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @return A list containing the allowedServices. + */ + public com.google.protobuf.ProtocolStringList getAllowedServicesList() { + return allowedServices_.getUnmodifiableView(); + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @return The count of allowedServices. + */ + public int getAllowedServicesCount() { + return allowedServices_.size(); + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the element to return. + * @return The allowedServices at the given index. + */ + public java.lang.String getAllowedServices(int index) { + return allowedServices_.get(index); + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allowedServices at the given index. + */ + public com.google.protobuf.ByteString getAllowedServicesBytes(int index) { + return allowedServices_.getByteString(index); + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param index The index to set the value at. + * @param value The allowedServices to set. + * @return This builder for chaining. + */ + public Builder setAllowedServices(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedServicesIsMutable(); + allowedServices_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param value The allowedServices to add. + * @return This builder for chaining. + */ + public Builder addAllowedServices(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedServicesIsMutable(); + allowedServices_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param values The allowedServices to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedServices(java.lang.Iterable values) { + ensureAllowedServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedServices_); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowedServices() { + allowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The list of APIs usable within the Service Perimeter. Must be empty
+       * unless 'enable_restriction' is True.
+       * 
+ * + * repeated string allowed_services = 2; + * + * @param value The bytes of the allowedServices to add. + * @return This builder for chaining. + */ + public Builder addAllowedServicesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedServicesIsMutable(); + allowedServices_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + private static final com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices(); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VpcAccessibleServices parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VpcAccessibleServices(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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESOURCES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList resources_; + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_; + } + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + public static final int ACCESS_LEVELS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList accessLevels_; + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @return A list containing the accessLevels. + */ + public com.google.protobuf.ProtocolStringList getAccessLevelsList() { + return accessLevels_; + } + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @return The count of accessLevels. + */ + public int getAccessLevelsCount() { + return accessLevels_.size(); + } + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the element to return. + * @return The accessLevels at the given index. + */ + public java.lang.String getAccessLevels(int index) { + return accessLevels_.get(index); + } + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the value to return. + * @return The bytes of the accessLevels at the given index. + */ + public com.google.protobuf.ByteString getAccessLevelsBytes(int index) { + return accessLevels_.getByteString(index); + } + + public static final int RESTRICTED_SERVICES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList restrictedServices_; + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @return A list containing the restrictedServices. + */ + public com.google.protobuf.ProtocolStringList getRestrictedServicesList() { + return restrictedServices_; + } + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @return The count of restrictedServices. + */ + public int getRestrictedServicesCount() { + return restrictedServices_.size(); + } + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the element to return. + * @return The restrictedServices at the given index. + */ + public java.lang.String getRestrictedServices(int index) { + return restrictedServices_.get(index); + } + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedServices at the given index. + */ + public com.google.protobuf.ByteString getRestrictedServicesBytes(int index) { + return restrictedServices_.getByteString(index); + } + + public static final int VPC_ACCESSIBLE_SERVICES_FIELD_NUMBER = 10; + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + vpcAccessibleServices_; + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return Whether the vpcAccessibleServices field is set. + */ + public boolean hasVpcAccessibleServices() { + return vpcAccessibleServices_ != null; + } + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return The vpcAccessibleServices. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + getVpcAccessibleServices() { + return vpcAccessibleServices_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + .getDefaultInstance() + : vpcAccessibleServices_; + } + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder + getVpcAccessibleServicesOrBuilder() { + return getVpcAccessibleServices(); + } + + 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 < resources_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resources_.getRaw(i)); + } + for (int i = 0; i < accessLevels_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, accessLevels_.getRaw(i)); + } + for (int i = 0; i < restrictedServices_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, restrictedServices_.getRaw(i)); + } + if (vpcAccessibleServices_ != null) { + output.writeMessage(10, getVpcAccessibleServices()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < resources_.size(); i++) { + dataSize += computeStringSizeNoTag(resources_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourcesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < accessLevels_.size(); i++) { + dataSize += computeStringSizeNoTag(accessLevels_.getRaw(i)); + } + size += dataSize; + size += 1 * getAccessLevelsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedServices_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedServices_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedServicesList().size(); + } + if (vpcAccessibleServices_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(10, getVpcAccessibleServices()); + } + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig)) { + return super.equals(obj); + } + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig other = + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) obj; + + if (!getResourcesList().equals(other.getResourcesList())) return false; + if (!getAccessLevelsList().equals(other.getAccessLevelsList())) return false; + if (!getRestrictedServicesList().equals(other.getRestrictedServicesList())) return false; + if (hasVpcAccessibleServices() != other.hasVpcAccessibleServices()) return false; + if (hasVpcAccessibleServices()) { + if (!getVpcAccessibleServices().equals(other.getVpcAccessibleServices())) 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 (getResourcesCount() > 0) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResourcesList().hashCode(); + } + if (getAccessLevelsCount() > 0) { + hash = (37 * hash) + ACCESS_LEVELS_FIELD_NUMBER; + hash = (53 * hash) + getAccessLevelsList().hashCode(); + } + if (getRestrictedServicesCount() > 0) { + hash = (37 * hash) + RESTRICTED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedServicesList().hashCode(); + } + if (hasVpcAccessibleServices()) { + hash = (37 * hash) + VPC_ACCESSIBLE_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getVpcAccessibleServices().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig 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.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig 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.identity.accesscontextmanager.v1.ServicePerimeterConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig 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.identity.accesscontextmanager.v1.ServicePerimeterConfig 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; + } + /** + * + * + *
+   * `ServicePerimeterConfig` specifies a set of Google Cloud resources that
+   * describe specific Service Perimeter configuration.
+   * 
+ * + * Protobuf type {@code google.identity.accesscontextmanager.v1.ServicePerimeterConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.class, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.Builder.class); + } + + // Construct using + // com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.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(); + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + restrictedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (vpcAccessibleServicesBuilder_ == null) { + vpcAccessibleServices_ = null; + } else { + vpcAccessibleServices_ = null; + vpcAccessibleServicesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterProto + .internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + getDefaultInstanceForType() { + return com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig build() { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig buildPartial() { + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig result = + new com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + resources_ = resources_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resources_ = resources_; + if (((bitField0_ & 0x00000002) != 0)) { + accessLevels_ = accessLevels_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.accessLevels_ = accessLevels_; + if (((bitField0_ & 0x00000004) != 0)) { + restrictedServices_ = restrictedServices_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.restrictedServices_ = restrictedServices_; + if (vpcAccessibleServicesBuilder_ == null) { + result.vpcAccessibleServices_ = vpcAccessibleServices_; + } else { + result.vpcAccessibleServices_ = vpcAccessibleServicesBuilder_.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.identity.accesscontextmanager.v1.ServicePerimeterConfig) { + return mergeFrom( + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig other) { + if (other + == com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .getDefaultInstance()) return this; + if (!other.resources_.isEmpty()) { + if (resources_.isEmpty()) { + resources_ = other.resources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourcesIsMutable(); + resources_.addAll(other.resources_); + } + onChanged(); + } + if (!other.accessLevels_.isEmpty()) { + if (accessLevels_.isEmpty()) { + accessLevels_ = other.accessLevels_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAccessLevelsIsMutable(); + accessLevels_.addAll(other.accessLevels_); + } + onChanged(); + } + if (!other.restrictedServices_.isEmpty()) { + if (restrictedServices_.isEmpty()) { + restrictedServices_ = other.restrictedServices_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRestrictedServicesIsMutable(); + restrictedServices_.addAll(other.restrictedServices_); + } + onChanged(); + } + if (other.hasVpcAccessibleServices()) { + mergeVpcAccessibleServices(other.getVpcAccessibleServices()); + } + 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.identity.accesscontextmanager.v1.ServicePerimeterConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList resources_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureResourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + resources_ = new com.google.protobuf.LazyStringArrayList(resources_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param index The index to set the value at. + * @param value The resources to set. + * @return This builder for chaining. + */ + public Builder setResources(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param value The resources to add. + * @return This builder for chaining. + */ + public Builder addResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param values The resources to add. + * @return This builder for chaining. + */ + public Builder addAllResources(java.lang.Iterable values) { + ensureResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @return This builder for chaining. + */ + public Builder clearResources() { + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of Google Cloud resources that are inside of the service perimeter.
+     * Currently only projects are allowed. Format: `projects/{project_number}`
+     * 
+ * + * repeated string resources = 1; + * + * @param value The bytes of the resources to add. + * @return This builder for chaining. + */ + public Builder addResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourcesIsMutable(); + resources_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList accessLevels_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAccessLevelsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + accessLevels_ = new com.google.protobuf.LazyStringArrayList(accessLevels_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @return A list containing the accessLevels. + */ + public com.google.protobuf.ProtocolStringList getAccessLevelsList() { + return accessLevels_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @return The count of accessLevels. + */ + public int getAccessLevelsCount() { + return accessLevels_.size(); + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the element to return. + * @return The accessLevels at the given index. + */ + public java.lang.String getAccessLevels(int index) { + return accessLevels_.get(index); + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the value to return. + * @return The bytes of the accessLevels at the given index. + */ + public com.google.protobuf.ByteString getAccessLevelsBytes(int index) { + return accessLevels_.getByteString(index); + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param index The index to set the value at. + * @param value The accessLevels to set. + * @return This builder for chaining. + */ + public Builder setAccessLevels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessLevelsIsMutable(); + accessLevels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param value The accessLevels to add. + * @return This builder for chaining. + */ + public Builder addAccessLevels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessLevelsIsMutable(); + accessLevels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param values The accessLevels to add. + * @return This builder for chaining. + */ + public Builder addAllAccessLevels(java.lang.Iterable values) { + ensureAccessLevelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accessLevels_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @return This builder for chaining. + */ + public Builder clearAccessLevels() { + accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of `AccessLevel` resource names that allow resources within the
+     * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+     * must be in the same policy as this `ServicePerimeter`. Referencing a
+     * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+     * listed, resources within the perimeter can only be accessed via Google
+     * Cloud calls with request origins within the perimeter. Example:
+     * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+     * For Service Perimeter Bridge, must be empty.
+     * 
+ * + * repeated string access_levels = 2; + * + * @param value The bytes of the accessLevels to add. + * @return This builder for chaining. + */ + public Builder addAccessLevelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAccessLevelsIsMutable(); + accessLevels_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList restrictedServices_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRestrictedServicesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + restrictedServices_ = new com.google.protobuf.LazyStringArrayList(restrictedServices_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @return A list containing the restrictedServices. + */ + public com.google.protobuf.ProtocolStringList getRestrictedServicesList() { + return restrictedServices_.getUnmodifiableView(); + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @return The count of restrictedServices. + */ + public int getRestrictedServicesCount() { + return restrictedServices_.size(); + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the element to return. + * @return The restrictedServices at the given index. + */ + public java.lang.String getRestrictedServices(int index) { + return restrictedServices_.get(index); + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedServices at the given index. + */ + public com.google.protobuf.ByteString getRestrictedServicesBytes(int index) { + return restrictedServices_.getByteString(index); + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index to set the value at. + * @param value The restrictedServices to set. + * @return This builder for chaining. + */ + public Builder setRestrictedServices(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedServicesIsMutable(); + restrictedServices_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param value The restrictedServices to add. + * @return This builder for chaining. + */ + public Builder addRestrictedServices(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedServicesIsMutable(); + restrictedServices_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param values The restrictedServices to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedServices(java.lang.Iterable values) { + ensureRestrictedServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedServices_); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedServices() { + restrictedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud services that are subject to the Service Perimeter
+     * restrictions. For example, if `storage.googleapis.com` is specified, access
+     * to the storage buckets inside the perimeter must meet the perimeter's
+     * access restrictions.
+     * 
+ * + * repeated string restricted_services = 4; + * + * @param value The bytes of the restrictedServices to add. + * @return This builder for chaining. + */ + public Builder addRestrictedServicesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedServicesIsMutable(); + restrictedServices_.add(value); + onChanged(); + return this; + } + + private com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + vpcAccessibleServices_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + .Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder> + vpcAccessibleServicesBuilder_; + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return Whether the vpcAccessibleServices field is set. + */ + public boolean hasVpcAccessibleServices() { + return vpcAccessibleServicesBuilder_ != null || vpcAccessibleServices_ != null; + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return The vpcAccessibleServices. + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + getVpcAccessibleServices() { + if (vpcAccessibleServicesBuilder_ == null) { + return vpcAccessibleServices_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.getDefaultInstance() + : vpcAccessibleServices_; + } else { + return vpcAccessibleServicesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public Builder setVpcAccessibleServices( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + value) { + if (vpcAccessibleServicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vpcAccessibleServices_ = value; + onChanged(); + } else { + vpcAccessibleServicesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public Builder setVpcAccessibleServices( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + .Builder + builderForValue) { + if (vpcAccessibleServicesBuilder_ == null) { + vpcAccessibleServices_ = builderForValue.build(); + onChanged(); + } else { + vpcAccessibleServicesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public Builder mergeVpcAccessibleServices( + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + value) { + if (vpcAccessibleServicesBuilder_ == null) { + if (vpcAccessibleServices_ != null) { + vpcAccessibleServices_ = + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.newBuilder(vpcAccessibleServices_) + .mergeFrom(value) + .buildPartial(); + } else { + vpcAccessibleServices_ = value; + } + onChanged(); + } else { + vpcAccessibleServicesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public Builder clearVpcAccessibleServices() { + if (vpcAccessibleServicesBuilder_ == null) { + vpcAccessibleServices_ = null; + onChanged(); + } else { + vpcAccessibleServices_ = null; + vpcAccessibleServicesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + .Builder + getVpcAccessibleServicesBuilder() { + + onChanged(); + return getVpcAccessibleServicesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder + getVpcAccessibleServicesOrBuilder() { + if (vpcAccessibleServicesBuilder_ != null) { + return vpcAccessibleServicesBuilder_.getMessageOrBuilder(); + } else { + return vpcAccessibleServices_ == null + ? com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.getDefaultInstance() + : vpcAccessibleServices_; + } + } + /** + * + * + *
+     * Configuration for APIs allowed within Perimeter.
+     * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + .Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder> + getVpcAccessibleServicesFieldBuilder() { + if (vpcAccessibleServicesBuilder_ == null) { + vpcAccessibleServicesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServices.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + .VpcAccessibleServicesOrBuilder>( + getVpcAccessibleServices(), getParentForChildren(), isClean()); + vpcAccessibleServices_ = null; + } + return vpcAccessibleServicesBuilder_; + } + + @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.identity.accesscontextmanager.v1.ServicePerimeterConfig) + } + + // @@protoc_insertion_point(class_scope:google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + private static final com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + } + + public static com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServicePerimeterConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServicePerimeterConfig(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.identity.accesscontextmanager.v1.ServicePerimeterConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfigOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfigOrBuilder.java new file mode 100644 index 0000000..7edabaa --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterConfigOrBuilder.java @@ -0,0 +1,265 @@ +/* + * 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/identity/accesscontextmanager/v1/service_perimeter.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface ServicePerimeterConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @return A list containing the resources. + */ + java.util.List getResourcesList(); + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @return The count of resources. + */ + int getResourcesCount(); + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + java.lang.String getResources(int index); + /** + * + * + *
+   * A list of Google Cloud resources that are inside of the service perimeter.
+   * Currently only projects are allowed. Format: `projects/{project_number}`
+   * 
+ * + * repeated string resources = 1; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + com.google.protobuf.ByteString getResourcesBytes(int index); + + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @return A list containing the accessLevels. + */ + java.util.List getAccessLevelsList(); + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @return The count of accessLevels. + */ + int getAccessLevelsCount(); + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the element to return. + * @return The accessLevels at the given index. + */ + java.lang.String getAccessLevels(int index); + /** + * + * + *
+   * A list of `AccessLevel` resource names that allow resources within the
+   * `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed
+   * must be in the same policy as this `ServicePerimeter`. Referencing a
+   * nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are
+   * listed, resources within the perimeter can only be accessed via Google
+   * Cloud calls with request origins within the perimeter. Example:
+   * `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`.
+   * For Service Perimeter Bridge, must be empty.
+   * 
+ * + * repeated string access_levels = 2; + * + * @param index The index of the value to return. + * @return The bytes of the accessLevels at the given index. + */ + com.google.protobuf.ByteString getAccessLevelsBytes(int index); + + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @return A list containing the restrictedServices. + */ + java.util.List getRestrictedServicesList(); + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @return The count of restrictedServices. + */ + int getRestrictedServicesCount(); + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the element to return. + * @return The restrictedServices at the given index. + */ + java.lang.String getRestrictedServices(int index); + /** + * + * + *
+   * Google Cloud services that are subject to the Service Perimeter
+   * restrictions. For example, if `storage.googleapis.com` is specified, access
+   * to the storage buckets inside the perimeter must meet the perimeter's
+   * access restrictions.
+   * 
+ * + * repeated string restricted_services = 4; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedServices at the given index. + */ + com.google.protobuf.ByteString getRestrictedServicesBytes(int index); + + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return Whether the vpcAccessibleServices field is set. + */ + boolean hasVpcAccessibleServices(); + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + * + * @return The vpcAccessibleServices. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + getVpcAccessibleServices(); + /** + * + * + *
+   * Configuration for APIs allowed within Perimeter.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices vpc_accessible_services = 10; + * + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServicesOrBuilder + getVpcAccessibleServicesOrBuilder(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterOrBuilder.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterOrBuilder.java new file mode 100644 index 0000000..d872852 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterOrBuilder.java @@ -0,0 +1,322 @@ +/* + * 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/identity/accesscontextmanager/v1/service_perimeter.proto + +package com.google.identity.accesscontextmanager.v1; + +public interface ServicePerimeterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.identity.accesscontextmanager.v1.ServicePerimeter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name for the ServicePerimeter.  The `short_name`
+   * component must begin with a letter and only include alphanumeric and '_'.
+   * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name for the ServicePerimeter.  The `short_name`
+   * component must begin with a letter and only include alphanumeric and '_'.
+   * Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Human readable title. Must be unique within the Policy.
+   * 
+ * + * string title = 2; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Description of the `ServicePerimeter` and its use. Does not affect
+   * behavior.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the `ServicePerimeter` and its use. Does not affect
+   * behavior.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was created in UTC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time the `ServicePerimeter` was updated in UTC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Perimeter type indicator. A single project is
+   * allowed to be a member of single regular perimeter, but multiple service
+   * perimeter bridges. A project cannot be a included in a perimeter bridge
+   * without being included in regular perimeter. For perimeter bridges,
+   * the restricted service list as well as access level lists must be
+   * empty.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The enum numeric value on the wire for perimeterType. + */ + int getPerimeterTypeValue(); + /** + * + * + *
+   * Perimeter type indicator. A single project is
+   * allowed to be a member of single regular perimeter, but multiple service
+   * perimeter bridges. A project cannot be a included in a perimeter bridge
+   * without being included in regular perimeter. For perimeter bridges,
+   * the restricted service list as well as access level lists must be
+   * empty.
+   * 
+ * + * + * .google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType perimeter_type = 6; + * + * + * @return The perimeterType. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType getPerimeterType(); + + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + * + * @return The status. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getStatus(); + /** + * + * + *
+   * Current ServicePerimeter configuration. Specifies sets of resources,
+   * restricted services and access levels that determine perimeter
+   * content and boundaries.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig status = 7; + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return Whether the spec field is set. + */ + boolean hasSpec(); + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + * + * @return The spec. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig getSpec(); + /** + * + * + *
+   * Proposed (or dry run) ServicePerimeter configuration. This configuration
+   * allows to specify and test ServicePerimeter configuration without enforcing
+   * actual access restrictions. Only allowed to be set when the
+   * "use_explicit_dry_run_spec" flag is set.
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeterConfig spec = 8; + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterConfigOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+   * Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly
+   * exists  for all Service Perimeters, and that spec is identical to the
+   * status for those Service Perimeters. When this flag is set, it inhibits the
+   * generation of the implicit spec, thereby allowing the user to explicitly
+   * provide a configuration ("spec") to use in a dry-run version of the Service
+   * Perimeter. This allows the user to test changes to the enforced config
+   * ("status") without actually enforcing them. This testing is done through
+   * analyzing the differences between currently enforced and suggested
+   * restrictions. use_explicit_dry_run_spec must bet set to True if any of the
+   * fields in the spec are set to non-default values.
+   * 
+ * + * bool use_explicit_dry_run_spec = 9; + * + * @return The useExplicitDryRunSpec. + */ + boolean getUseExplicitDryRunSpec(); +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterProto.java b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterProto.java new file mode 100644 index 0000000..0e7dd9c --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/ServicePerimeterProto.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/identity/accesscontextmanager/v1/service_perimeter.proto + +package com.google.identity.accesscontextmanager.v1; + +public final class ServicePerimeterProto { + private ServicePerimeterProto() {} + + 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_identity_accesscontextmanager_v1_ServicePerimeter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/identity/accesscontextmanager/v" + + "1/service_perimeter.proto\022\'google.identi" + + "ty.accesscontextmanager.v1\032\037google/proto" + + "buf/timestamp.proto\032\034google/api/annotati" + + "ons.proto\"\222\004\n\020ServicePerimeter\022\014\n\004name\030\001" + + " \001(\t\022\r\n\005title\030\002 \001(\t\022\023\n\013description\030\003 \001(\t" + + "\022/\n\013create_time\030\004 \001(\0132\032.google.protobuf." + + "Timestamp\022/\n\013update_time\030\005 \001(\0132\032.google." + + "protobuf.Timestamp\022_\n\016perimeter_type\030\006 \001" + + "(\0162G.google.identity.accesscontextmanage" + + "r.v1.ServicePerimeter.PerimeterType\022O\n\006s" + + "tatus\030\007 \001(\0132?.google.identity.accesscont" + + "extmanager.v1.ServicePerimeterConfig\022M\n\004" + + "spec\030\010 \001(\0132?.google.identity.accessconte" + + "xtmanager.v1.ServicePerimeterConfig\022!\n\031u" + + "se_explicit_dry_run_spec\030\t \001(\010\"F\n\rPerime" + + "terType\022\032\n\026PERIMETER_TYPE_REGULAR\020\000\022\031\n\025P" + + "ERIMETER_TYPE_BRIDGE\020\001\"\246\002\n\026ServicePerime" + + "terConfig\022\021\n\tresources\030\001 \003(\t\022\025\n\raccess_l" + + "evels\030\002 \003(\t\022\033\n\023restricted_services\030\004 \003(\t" + + "\022v\n\027vpc_accessible_services\030\n \001(\0132U.goog" + + "le.identity.accesscontextmanager.v1.Serv" + + "icePerimeterConfig.VpcAccessibleServices" + + "\032M\n\025VpcAccessibleServices\022\032\n\022enable_rest" + + "riction\030\001 \001(\010\022\030\n\020allowed_services\030\002 \003(\tB" + + "\253\002\n+com.google.identity.accesscontextman" + + "ager.v1B\025ServicePerimeterProtoP\001Z[google" + + ".golang.org/genproto/googleapis/identity" + + "/accesscontextmanager/v1;accesscontextma" + + "nager\242\002\004GACM\252\002\'Google.Identity.AccessCon" + + "textManager.V1\312\002\'Google\\Identity\\AccessC" + + "ontextManager\\V1\352\002*Google::Identity::Acc" + + "essContextManager::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeter_descriptor, + new java.lang.String[] { + "Name", + "Title", + "Description", + "CreateTime", + "UpdateTime", + "PerimeterType", + "Status", + "Spec", + "UseExplicitDryRunSpec", + }); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor, + new java.lang.String[] { + "Resources", "AccessLevels", "RestrictedServices", "VpcAccessibleServices", + }); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor = + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_identity_accesscontextmanager_v1_ServicePerimeterConfig_VpcAccessibleServices_descriptor, + new java.lang.String[] { + "EnableRestriction", "AllowedServices", + }); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_level.proto b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 0000000..0ebd193 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,187 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.identity.accesscontextmanager.v1; + +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + // of the `short_name` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_policy.proto b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 0000000..9ec59d1 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/access_policy.proto @@ -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 +// +// 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.identity.accesscontextmanager.v1; + +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{policy_id}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/service_perimeter.proto b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 0000000..89d7681 --- /dev/null +++ b/proto-google-identity-accesscontextmanager-v1/src/main/proto/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -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 +// +// 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.identity.accesscontextmanager.v1; + +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. + repeated string allowed_services = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..6d1c55b --- /dev/null +++ b/renovate.json @@ -0,0 +1,80 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.api.grpc:proto-google-identity-accesscontextmanager-v1", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true +} \ No newline at end of file diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 0000000..5e6b3af --- /dev/null +++ b/synth.metadata @@ -0,0 +1,32 @@ +{ + "updateTime": "2020-03-30T21:32:50.040271Z", + "sources": [ + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "f5e8c88d9870d8aa4eb43fa0b39f07e02bfbe4df" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "accesscontextmanager", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "accesscontextmanager", + "apiVersion": "type", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 0000000..fa72946 --- /dev/null +++ b/synth.py @@ -0,0 +1,45 @@ +# 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 = 'accesscontextmanager' +versions = ['v1', 'type'] + +gapic = gcp.GAPICBazel() + +for version in versions: + library = gapic.java_library( + service=service, + version=version, + proto_path=f'google/identity/accesscontextmanager/{version}', + bazel_target=f'//google/identity/accesscontextmanager/{version}:google-cloud-accesscontextmanager-{version}-java', + ) + library = library / f"google-cloud-accesscontextmanager-{version}-java" + java.fix_proto_headers(library / f"proto-google-cloud-accesscontextmanager-{version}-java") + s.copy( + [library / f"proto-google-cloud-accesscontextmanager-{version}-java/src"], + f"proto-google-identity-accesscontextmanager-{version}/src", + required=True, + ) + java.format_code(f"proto-google-identity-accesscontextmanager-{version}/src") + +java.common_templates(excludes=[ + 'README.md', + 'samples/*', +]) diff --git a/versions.txt b/versions.txt new file mode 100644 index 0000000..d8b0bc7 --- /dev/null +++ b/versions.txt @@ -0,0 +1,4 @@ +# Format: +# module:released-version:current-version + +proto-google-identity-accesscontextmanager-v1:0.0.0:0.0.1-SNAPSHOT