diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..5f0e5d39 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a + image: gcr.io/repo-automation-bots/owlbot-java:latest \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..c9350126 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,32 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/api/servicecontrol/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-service-control-$1/src" +- source: "/google/api/servicecontrol/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-service-control-$1/src" +- source: "/google/api/servicecontrol/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-service-control/src" \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6e5edae4 --- /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-service-control/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. service-control version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..649b9254 --- /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-service-control/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..c644a24e --- /dev/null +++ b/.github/generated-files-bot.yml @@ -0,0 +1,12 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# 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 the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..8ca7f9ca --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..e100454f --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..7513acae --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..9b4fd4d8 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..0195b32f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..069d08fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..b3b69b76 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -Penable-samples \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-service-control +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..46edbf7f --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..79bea159 --- /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-service-control/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..ace89f45 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..ef8dcbad --- /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-service-control/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..c50c869c --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..9030ba8f --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +shopt -s nullglob + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in **/.flattened-pom.xml +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..ef8dcbad --- /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-service-control/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..6324199b --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-service-control/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..d6c06a2b --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-service-control/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..aa12a172 --- /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-service-control/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..d2999432 --- /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-service-control/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..6324199b --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-service-control/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..d6c06a2b --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-service-control/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..40ab94bc --- /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-service-control/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..e3393cee --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-service-control + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool + +set +e +python3.6 -m autosynth.synth \ + --repository=googleapis/java-service-control \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..9ba7a4b7 --- /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-service-control/.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-service-control/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..7b843ba6 --- /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-service-control/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..5a725c3e --- /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-service-control/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..b366ad31 --- /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-service-control/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..4521642c --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,23 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..da789356 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/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 -q -DskipTests=true + +export NAME=google-cloud-service-control +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..47a263cf --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..fe2af16b --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2021 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_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-service-control +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md +# copy CHANGELOG to docfx-yml dir and rename history.md +cp CHANGELOG.md target/docfx-yml/history.md + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..889d7f7b --- /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-service-control/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..1f55b770 --- /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 deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..48cd0ff9 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-service-control/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-service-control/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-service-control" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..8a103384 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,45 @@ +#!/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 +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..9e1bae17 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "service-control", + "name_pretty": "Service Control API", + "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", + "api_description": " is a foundational platform for creating, managing, securing, and consuming APIs and services across organizations. It is used by Google APIs, Cloud APIs, Cloud Endpoints, and API Gateway.", + "client_documentation": "https://googleapis.dev/java/google-cloud-service-control/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-service-control", + "repo_short": "java-service-control", + "distribution_name": "com.google.cloud:google-cloud-service-control", + "api_id": "service-control.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# 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 *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. 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 to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + 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/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..8b58ae9c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-service-control-bom/pom.xml b/google-cloud-service-control-bom/pom.xml new file mode 100644 index 00000000..10e50b61 --- /dev/null +++ b/google-cloud-service-control-bom/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + com.google.cloud + google-cloud-service-control-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + Google Service Control API BOM + https://github.com/googleapis/java-service-control + + BOM for Service Control API + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-service-control.git + scm:git:git@github.com:googleapis/java-service-control.git + https://github.com/googleapis/java-service-control + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-service-control + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/google-cloud-service-control/pom.xml b/google-cloud-service-control/pom.xml new file mode 100644 index 00000000..8c03affd --- /dev/null +++ b/google-cloud-service-control/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-service-control + 0.0.1-SNAPSHOT + jar + Google Service Control API + https://github.com/googleapis/java-service-control + Service Control API is a foundational platform for creating, managing, securing, and consuming APIs and services across organizations. It is used by Google APIs, Cloud APIs, Cloud Endpoints, and API Gateway. + + com.google.cloud + google-cloud-service-control-parent + 0.0.1-SNAPSHOT + + + google-cloud-service-control + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-service-control-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-service-control-v1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerClient.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerClient.java new file mode 100644 index 00000000..0965c4a9 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerClient.java @@ -0,0 +1,247 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.stub.QuotaControllerStub; +import com.google.api.servicecontrol.v1.stub.QuotaControllerStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: [Google Quota Control API](/service-control/overview) + * + *

Allows clients to allocate and release quota against a [managed + * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + * + *

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

{@code
+ * try (QuotaControllerClient quotaControllerClient = QuotaControllerClient.create()) {
+ *   AllocateQuotaRequest request =
+ *       AllocateQuotaRequest.newBuilder()
+ *           .setServiceName("serviceName-1928572192")
+ *           .setAllocateOperation(QuotaOperation.newBuilder().build())
+ *           .setServiceConfigId("serviceConfigId650537426")
+ *           .build();
+ *   AllocateQuotaResponse response = quotaControllerClient.allocateQuota(request);
+ * }
+ * }
+ * + *

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

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

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

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

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

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

To customize credentials: + * + *

{@code
+ * QuotaControllerSettings quotaControllerSettings =
+ *     QuotaControllerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * QuotaControllerClient quotaControllerClient =
+ *     QuotaControllerClient.create(quotaControllerSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * QuotaControllerSettings quotaControllerSettings =
+ *     QuotaControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * QuotaControllerClient quotaControllerClient =
+ *     QuotaControllerClient.create(quotaControllerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class QuotaControllerClient implements BackgroundResource { + private final QuotaControllerSettings settings; + private final QuotaControllerStub stub; + + /** Constructs an instance of QuotaControllerClient with default settings. */ + public static final QuotaControllerClient create() throws IOException { + return create(QuotaControllerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of QuotaControllerClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final QuotaControllerClient create(QuotaControllerSettings settings) + throws IOException { + return new QuotaControllerClient(settings); + } + + /** + * Constructs an instance of QuotaControllerClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(QuotaControllerSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final QuotaControllerClient create(QuotaControllerStub stub) { + return new QuotaControllerClient(stub); + } + + /** + * Constructs an instance of QuotaControllerClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected QuotaControllerClient(QuotaControllerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((QuotaControllerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected QuotaControllerClient(QuotaControllerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final QuotaControllerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public QuotaControllerStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts to allocate quota for the specified consumer. It should be called before the operation + * is executed. + * + *

This method requires the `servicemanagement.services.quota` permission on the specified + * service. For more information, see [Cloud IAM](https://cloud.google.com/iam). + * + *

**NOTE:** The client **must** fail-open on server errors + * `INTERNAL`, `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system reliability, + * the server may inject these errors to prohibit any hard dependency on the quota functionality. + * + *

Sample code: + * + *

{@code
+   * try (QuotaControllerClient quotaControllerClient = QuotaControllerClient.create()) {
+   *   AllocateQuotaRequest request =
+   *       AllocateQuotaRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .setAllocateOperation(QuotaOperation.newBuilder().build())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   AllocateQuotaResponse response = quotaControllerClient.allocateQuota(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AllocateQuotaResponse allocateQuota(AllocateQuotaRequest request) { + return allocateQuotaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts to allocate quota for the specified consumer. It should be called before the operation + * is executed. + * + *

This method requires the `servicemanagement.services.quota` permission on the specified + * service. For more information, see [Cloud IAM](https://cloud.google.com/iam). + * + *

**NOTE:** The client **must** fail-open on server errors + * `INTERNAL`, `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system reliability, + * the server may inject these errors to prohibit any hard dependency on the quota functionality. + * + *

Sample code: + * + *

{@code
+   * try (QuotaControllerClient quotaControllerClient = QuotaControllerClient.create()) {
+   *   AllocateQuotaRequest request =
+   *       AllocateQuotaRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .setAllocateOperation(QuotaOperation.newBuilder().build())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   ApiFuture future =
+   *       quotaControllerClient.allocateQuotaCallable().futureCall(request);
+   *   // Do something.
+   *   AllocateQuotaResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable allocateQuotaCallable() { + return stub.allocateQuotaCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerSettings.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerSettings.java new file mode 100644 index 00000000..c1f7535b --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerSettings.java @@ -0,0 +1,184 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.servicecontrol.v1.stub.QuotaControllerStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link QuotaControllerClient}. + * + *

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

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

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

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

{@code
+ * QuotaControllerSettings.Builder quotaControllerSettingsBuilder =
+ *     QuotaControllerSettings.newBuilder();
+ * quotaControllerSettingsBuilder
+ *     .allocateQuotaSettings()
+ *     .setRetrySettings(
+ *         quotaControllerSettingsBuilder
+ *             .allocateQuotaSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QuotaControllerSettings quotaControllerSettings = quotaControllerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class QuotaControllerSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to allocateQuota. */ + public UnaryCallSettings allocateQuotaSettings() { + return ((QuotaControllerStubSettings) getStubSettings()).allocateQuotaSettings(); + } + + public static final QuotaControllerSettings create(QuotaControllerStubSettings stub) + throws IOException { + return new QuotaControllerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return QuotaControllerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return QuotaControllerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return QuotaControllerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return QuotaControllerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return QuotaControllerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return QuotaControllerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QuotaControllerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected QuotaControllerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for QuotaControllerSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(QuotaControllerStubSettings.newBuilder(clientContext)); + } + + protected Builder(QuotaControllerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(QuotaControllerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(QuotaControllerStubSettings.newBuilder()); + } + + public QuotaControllerStubSettings.Builder getStubSettingsBuilder() { + return ((QuotaControllerStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to allocateQuota. */ + public UnaryCallSettings.Builder + allocateQuotaSettings() { + return getStubSettingsBuilder().allocateQuotaSettings(); + } + + @Override + public QuotaControllerSettings build() throws IOException { + return new QuotaControllerSettings(this); + } + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerClient.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerClient.java new file mode 100644 index 00000000..c26159f3 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerClient.java @@ -0,0 +1,330 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.stub.ServiceControllerStub; +import com.google.api.servicecontrol.v1.stub.ServiceControllerStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: [Google Service Control API](/service-control/overview) + * + *

Lets clients check and report operations against a [managed + * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + * + *

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

{@code
+ * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+ *   CheckRequest request =
+ *       CheckRequest.newBuilder()
+ *           .setServiceName("serviceName-1928572192")
+ *           .setOperation(Operation.newBuilder().build())
+ *           .setServiceConfigId("serviceConfigId650537426")
+ *           .build();
+ *   CheckResponse response = serviceControllerClient.check(request);
+ * }
+ * }
+ * + *

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

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

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

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

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

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

To customize credentials: + * + *

{@code
+ * ServiceControllerSettings serviceControllerSettings =
+ *     ServiceControllerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ServiceControllerClient serviceControllerClient =
+ *     ServiceControllerClient.create(serviceControllerSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * ServiceControllerSettings serviceControllerSettings =
+ *     ServiceControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ServiceControllerClient serviceControllerClient =
+ *     ServiceControllerClient.create(serviceControllerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ServiceControllerClient implements BackgroundResource { + private final ServiceControllerSettings settings; + private final ServiceControllerStub stub; + + /** Constructs an instance of ServiceControllerClient with default settings. */ + public static final ServiceControllerClient create() throws IOException { + return create(ServiceControllerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ServiceControllerClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ServiceControllerClient create(ServiceControllerSettings settings) + throws IOException { + return new ServiceControllerClient(settings); + } + + /** + * Constructs an instance of ServiceControllerClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(ServiceControllerSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ServiceControllerClient create(ServiceControllerStub stub) { + return new ServiceControllerClient(stub); + } + + /** + * Constructs an instance of ServiceControllerClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ServiceControllerClient(ServiceControllerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ServiceControllerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ServiceControllerClient(ServiceControllerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ServiceControllerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ServiceControllerStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks whether an operation on a service should be allowed to proceed based on the + * configuration of the service and related policies. It must be called before the operation is + * executed. + * + *

If feasible, the client should cache the check results and reuse them for 60 seconds. In + * case of any server errors, the client should rely on the cached results for much longer time to + * avoid outage. WARNING: There is general 60s delay for the configuration and policy propagation, + * therefore callers MUST NOT depend on the `Check` method having the latest policy information. + * + *

NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit + * (wire-format byte size) of 1MB. + * + *

This method requires the `servicemanagement.services.check` permission on the specified + * service. For more information, see [Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *

{@code
+   * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+   *   CheckRequest request =
+   *       CheckRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .setOperation(Operation.newBuilder().build())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   CheckResponse response = serviceControllerClient.check(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CheckResponse check(CheckRequest request) { + return checkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks whether an operation on a service should be allowed to proceed based on the + * configuration of the service and related policies. It must be called before the operation is + * executed. + * + *

If feasible, the client should cache the check results and reuse them for 60 seconds. In + * case of any server errors, the client should rely on the cached results for much longer time to + * avoid outage. WARNING: There is general 60s delay for the configuration and policy propagation, + * therefore callers MUST NOT depend on the `Check` method having the latest policy information. + * + *

NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit + * (wire-format byte size) of 1MB. + * + *

This method requires the `servicemanagement.services.check` permission on the specified + * service. For more information, see [Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *

{@code
+   * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+   *   CheckRequest request =
+   *       CheckRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .setOperation(Operation.newBuilder().build())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   ApiFuture future = serviceControllerClient.checkCallable().futureCall(request);
+   *   // Do something.
+   *   CheckResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable checkCallable() { + return stub.checkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reports operation results to Google Service Control, such as logs and metrics. It should be + * called after an operation is completed. + * + *

If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API + * traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. + * Clients should carefully choose the aggregation time window to avoid data loss risk more than + * 0.01% for business and compliance reasons. + * + *

NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit + * (wire-format byte size) of 1MB. + * + *

This method requires the `servicemanagement.services.report` permission on the specified + * service. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *

{@code
+   * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+   *   ReportRequest request =
+   *       ReportRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .addAllOperations(new ArrayList())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   ReportResponse response = serviceControllerClient.report(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportResponse report(ReportRequest request) { + return reportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reports operation results to Google Service Control, such as logs and metrics. It should be + * called after an operation is completed. + * + *

If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API + * traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. + * Clients should carefully choose the aggregation time window to avoid data loss risk more than + * 0.01% for business and compliance reasons. + * + *

NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit + * (wire-format byte size) of 1MB. + * + *

This method requires the `servicemanagement.services.report` permission on the specified + * service. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *

{@code
+   * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+   *   ReportRequest request =
+   *       ReportRequest.newBuilder()
+   *           .setServiceName("serviceName-1928572192")
+   *           .addAllOperations(new ArrayList())
+   *           .setServiceConfigId("serviceConfigId650537426")
+   *           .build();
+   *   ApiFuture future =
+   *       serviceControllerClient.reportCallable().futureCall(request);
+   *   // Do something.
+   *   ReportResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable reportCallable() { + return stub.reportCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerSettings.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerSettings.java new file mode 100644 index 00000000..07e62ade --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerSettings.java @@ -0,0 +1,193 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.servicecontrol.v1.stub.ServiceControllerStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ServiceControllerClient}. + * + *

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

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

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

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

{@code
+ * ServiceControllerSettings.Builder serviceControllerSettingsBuilder =
+ *     ServiceControllerSettings.newBuilder();
+ * serviceControllerSettingsBuilder
+ *     .checkSettings()
+ *     .setRetrySettings(
+ *         serviceControllerSettingsBuilder
+ *             .checkSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServiceControllerSettings serviceControllerSettings = serviceControllerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ServiceControllerSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to check. */ + public UnaryCallSettings checkSettings() { + return ((ServiceControllerStubSettings) getStubSettings()).checkSettings(); + } + + /** Returns the object with the settings used for calls to report. */ + public UnaryCallSettings reportSettings() { + return ((ServiceControllerStubSettings) getStubSettings()).reportSettings(); + } + + public static final ServiceControllerSettings create(ServiceControllerStubSettings stub) + throws IOException { + return new ServiceControllerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ServiceControllerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ServiceControllerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ServiceControllerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ServiceControllerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ServiceControllerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ServiceControllerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServiceControllerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ServiceControllerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ServiceControllerSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ServiceControllerStubSettings.newBuilder(clientContext)); + } + + protected Builder(ServiceControllerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ServiceControllerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ServiceControllerStubSettings.newBuilder()); + } + + public ServiceControllerStubSettings.Builder getStubSettingsBuilder() { + return ((ServiceControllerStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to check. */ + public UnaryCallSettings.Builder checkSettings() { + return getStubSettingsBuilder().checkSettings(); + } + + /** Returns the builder for the settings used for calls to report. */ + public UnaryCallSettings.Builder reportSettings() { + return getStubSettingsBuilder().reportSettings(); + } + + @Override + public ServiceControllerSettings build() throws IOException { + return new ServiceControllerSettings(this); + } + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/gapic_metadata.json b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/gapic_metadata.json new file mode 100644 index 00000000..ad1481d3 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.api.servicecontrol.v1", + "libraryPackage": "com.google.api.servicecontrol.v1", + "services": { + "QuotaController": { + "clients": { + "grpc": { + "libraryClient": "QuotaControllerClient", + "rpcs": { + "AllocateQuota": { + "methods": ["allocateQuota", "allocateQuotaCallable"] + } + } + } + } + }, + "ServiceController": { + "clients": { + "grpc": { + "libraryClient": "ServiceControllerClient", + "rpcs": { + "Check": { + "methods": ["check", "checkCallable"] + }, + "Report": { + "methods": ["report", "reportCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/package-info.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/package-info.java new file mode 100644 index 00000000..7b169cce --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/package-info.java @@ -0,0 +1,65 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= QuotaControllerClient ======================= + * + *

Service Description: [Google Quota Control API](/service-control/overview) + * + *

Allows clients to allocate and release quota against a [managed + * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + * + *

Sample for QuotaControllerClient: + * + *

{@code
+ * try (QuotaControllerClient quotaControllerClient = QuotaControllerClient.create()) {
+ *   AllocateQuotaRequest request =
+ *       AllocateQuotaRequest.newBuilder()
+ *           .setServiceName("serviceName-1928572192")
+ *           .setAllocateOperation(QuotaOperation.newBuilder().build())
+ *           .setServiceConfigId("serviceConfigId650537426")
+ *           .build();
+ *   AllocateQuotaResponse response = quotaControllerClient.allocateQuota(request);
+ * }
+ * }
+ * + *

======================= ServiceControllerClient ======================= + * + *

Service Description: [Google Service Control API](/service-control/overview) + * + *

Lets clients check and report operations against a [managed + * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + * + *

Sample for ServiceControllerClient: + * + *

{@code
+ * try (ServiceControllerClient serviceControllerClient = ServiceControllerClient.create()) {
+ *   CheckRequest request =
+ *       CheckRequest.newBuilder()
+ *           .setServiceName("serviceName-1928572192")
+ *           .setOperation(Operation.newBuilder().build())
+ *           .setServiceConfigId("serviceConfigId650537426")
+ *           .build();
+ *   CheckResponse response = serviceControllerClient.check(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.api.servicecontrol.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerCallableFactory.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerCallableFactory.java new file mode 100644 index 00000000..a9776668 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the QuotaController service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcQuotaControllerCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerStub.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerStub.java new file mode 100644 index 00000000..dd4891c5 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcQuotaControllerStub.java @@ -0,0 +1,162 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.AllocateQuotaRequest; +import com.google.api.servicecontrol.v1.AllocateQuotaResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the QuotaController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcQuotaControllerStub extends QuotaControllerStub { + private static final MethodDescriptor + allocateQuotaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.servicecontrol.v1.QuotaController/AllocateQuota") + .setRequestMarshaller( + ProtoUtils.marshaller(AllocateQuotaRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AllocateQuotaResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable allocateQuotaCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcQuotaControllerStub create(QuotaControllerStubSettings settings) + throws IOException { + return new GrpcQuotaControllerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcQuotaControllerStub create(ClientContext clientContext) + throws IOException { + return new GrpcQuotaControllerStub( + QuotaControllerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcQuotaControllerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcQuotaControllerStub( + QuotaControllerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcQuotaControllerStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcQuotaControllerStub( + QuotaControllerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcQuotaControllerCallableFactory()); + } + + /** + * Constructs an instance of GrpcQuotaControllerStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcQuotaControllerStub( + QuotaControllerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings allocateQuotaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(allocateQuotaMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AllocateQuotaRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("service_name", String.valueOf(request.getServiceName())); + return params.build(); + } + }) + .build(); + + this.allocateQuotaCallable = + callableFactory.createUnaryCallable( + allocateQuotaTransportSettings, settings.allocateQuotaSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable allocateQuotaCallable() { + return allocateQuotaCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerCallableFactory.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerCallableFactory.java new file mode 100644 index 00000000..859f41ca --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ServiceController service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcServiceControllerCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerStub.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerStub.java new file mode 100644 index 00000000..dbdca68a --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/GrpcServiceControllerStub.java @@ -0,0 +1,191 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.CheckRequest; +import com.google.api.servicecontrol.v1.CheckResponse; +import com.google.api.servicecontrol.v1.ReportRequest; +import com.google.api.servicecontrol.v1.ReportResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ServiceController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcServiceControllerStub extends ServiceControllerStub { + private static final MethodDescriptor checkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.servicecontrol.v1.ServiceController/Check") + .setRequestMarshaller(ProtoUtils.marshaller(CheckRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CheckResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor reportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.servicecontrol.v1.ServiceController/Report") + .setRequestMarshaller(ProtoUtils.marshaller(ReportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReportResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable checkCallable; + private final UnaryCallable reportCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcServiceControllerStub create(ServiceControllerStubSettings settings) + throws IOException { + return new GrpcServiceControllerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcServiceControllerStub create(ClientContext clientContext) + throws IOException { + return new GrpcServiceControllerStub( + ServiceControllerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcServiceControllerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcServiceControllerStub( + ServiceControllerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcServiceControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcServiceControllerStub( + ServiceControllerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcServiceControllerCallableFactory()); + } + + /** + * Constructs an instance of GrpcServiceControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcServiceControllerStub( + ServiceControllerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings checkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(checkMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CheckRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("service_name", String.valueOf(request.getServiceName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings reportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ReportRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("service_name", String.valueOf(request.getServiceName())); + return params.build(); + } + }) + .build(); + + this.checkCallable = + callableFactory.createUnaryCallable( + checkTransportSettings, settings.checkSettings(), clientContext); + this.reportCallable = + callableFactory.createUnaryCallable( + reportTransportSettings, settings.reportSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable checkCallable() { + return checkCallable; + } + + @Override + public UnaryCallable reportCallable() { + return reportCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStub.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStub.java new file mode 100644 index 00000000..c28eee9c --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStub.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.AllocateQuotaRequest; +import com.google.api.servicecontrol.v1.AllocateQuotaResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the QuotaController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class QuotaControllerStub implements BackgroundResource { + + public UnaryCallable allocateQuotaCallable() { + throw new UnsupportedOperationException("Not implemented: allocateQuotaCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStubSettings.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStubSettings.java new file mode 100644 index 00000000..c754d797 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/QuotaControllerStubSettings.java @@ -0,0 +1,268 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.servicecontrol.v1.AllocateQuotaRequest; +import com.google.api.servicecontrol.v1.AllocateQuotaResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link QuotaControllerStub}. + * + *

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

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

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

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

{@code
+ * QuotaControllerStubSettings.Builder quotaControllerSettingsBuilder =
+ *     QuotaControllerStubSettings.newBuilder();
+ * quotaControllerSettingsBuilder
+ *     .allocateQuotaSettings()
+ *     .setRetrySettings(
+ *         quotaControllerSettingsBuilder
+ *             .allocateQuotaSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QuotaControllerStubSettings quotaControllerSettings = quotaControllerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class QuotaControllerStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/servicecontrol") + .build(); + + private final UnaryCallSettings + allocateQuotaSettings; + + /** Returns the object with the settings used for calls to allocateQuota. */ + public UnaryCallSettings allocateQuotaSettings() { + return allocateQuotaSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public QuotaControllerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcQuotaControllerStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "servicecontrol.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "servicecontrol.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(QuotaControllerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected QuotaControllerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + allocateQuotaSettings = settingsBuilder.allocateQuotaSettings().build(); + } + + /** Builder for QuotaControllerStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + allocateQuotaSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + allocateQuotaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(allocateQuotaSettings); + initDefaults(this); + } + + protected Builder(QuotaControllerStubSettings settings) { + super(settings); + + allocateQuotaSettings = settings.allocateQuotaSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(allocateQuotaSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .allocateQuotaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to allocateQuota. */ + public UnaryCallSettings.Builder + allocateQuotaSettings() { + return allocateQuotaSettings; + } + + @Override + public QuotaControllerStubSettings build() throws IOException { + return new QuotaControllerStubSettings(this); + } + } +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStub.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStub.java new file mode 100644 index 00000000..d3dc9ebd --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStub.java @@ -0,0 +1,46 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.servicecontrol.v1.CheckRequest; +import com.google.api.servicecontrol.v1.CheckResponse; +import com.google.api.servicecontrol.v1.ReportRequest; +import com.google.api.servicecontrol.v1.ReportResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ServiceController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ServiceControllerStub implements BackgroundResource { + + public UnaryCallable checkCallable() { + throw new UnsupportedOperationException("Not implemented: checkCallable()"); + } + + public UnaryCallable reportCallable() { + throw new UnsupportedOperationException("Not implemented: reportCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStubSettings.java b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStubSettings.java new file mode 100644 index 00000000..c4afcc17 --- /dev/null +++ b/google-cloud-service-control/src/main/java/com/google/api/servicecontrol/v1/stub/ServiceControllerStubSettings.java @@ -0,0 +1,310 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.servicecontrol.v1.CheckRequest; +import com.google.api.servicecontrol.v1.CheckResponse; +import com.google.api.servicecontrol.v1.ReportRequest; +import com.google.api.servicecontrol.v1.ReportResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ServiceControllerStub}. + * + *

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

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

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

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

{@code
+ * ServiceControllerStubSettings.Builder serviceControllerSettingsBuilder =
+ *     ServiceControllerStubSettings.newBuilder();
+ * serviceControllerSettingsBuilder
+ *     .checkSettings()
+ *     .setRetrySettings(
+ *         serviceControllerSettingsBuilder
+ *             .checkSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServiceControllerStubSettings serviceControllerSettings =
+ *     serviceControllerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ServiceControllerStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/servicecontrol") + .build(); + + private final UnaryCallSettings checkSettings; + private final UnaryCallSettings reportSettings; + + /** Returns the object with the settings used for calls to check. */ + public UnaryCallSettings checkSettings() { + return checkSettings; + } + + /** Returns the object with the settings used for calls to report. */ + public UnaryCallSettings reportSettings() { + return reportSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ServiceControllerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcServiceControllerStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "servicecontrol.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "servicecontrol.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ServiceControllerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ServiceControllerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + checkSettings = settingsBuilder.checkSettings().build(); + reportSettings = settingsBuilder.reportSettings().build(); + } + + /** Builder for ServiceControllerStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder checkSettings; + private final UnaryCallSettings.Builder reportSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(16000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(16000L)) + .setTotalTimeout(Duration.ofMillis(16000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + checkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(checkSettings, reportSettings); + initDefaults(this); + } + + protected Builder(ServiceControllerStubSettings settings) { + super(settings); + + checkSettings = settings.checkSettings.toBuilder(); + reportSettings = settings.reportSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(checkSettings, reportSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .checkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .reportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to check. */ + public UnaryCallSettings.Builder checkSettings() { + return checkSettings; + } + + /** Returns the builder for the settings used for calls to report. */ + public UnaryCallSettings.Builder reportSettings() { + return reportSettings; + } + + @Override + public ServiceControllerStubSettings build() throws IOException { + return new ServiceControllerStubSettings(this); + } + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaController.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaController.java new file mode 100644 index 00000000..2856bdcd --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaController.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockQuotaController implements MockGrpcService { + private final MockQuotaControllerImpl serviceImpl; + + public MockQuotaController() { + serviceImpl = new MockQuotaControllerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaControllerImpl.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaControllerImpl.java new file mode 100644 index 00000000..c9fab29a --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockQuotaControllerImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.servicecontrol.v1.QuotaControllerGrpc.QuotaControllerImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockQuotaControllerImpl extends QuotaControllerImplBase { + private List requests; + private Queue responses; + + public MockQuotaControllerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void allocateQuota( + AllocateQuotaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AllocateQuotaResponse) { + requests.add(request); + responseObserver.onNext(((AllocateQuotaResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AllocateQuota, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AllocateQuotaResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceController.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceController.java new file mode 100644 index 00000000..fa157937 --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceController.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockServiceController implements MockGrpcService { + private final MockServiceControllerImpl serviceImpl; + + public MockServiceController() { + serviceImpl = new MockServiceControllerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceControllerImpl.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceControllerImpl.java new file mode 100644 index 00000000..36bf8b31 --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/MockServiceControllerImpl.java @@ -0,0 +1,100 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.core.BetaApi; +import com.google.api.servicecontrol.v1.ServiceControllerGrpc.ServiceControllerImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockServiceControllerImpl extends ServiceControllerImplBase { + private List requests; + private Queue responses; + + public MockServiceControllerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void check(CheckRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CheckResponse) { + requests.add(request); + responseObserver.onNext(((CheckResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Check, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CheckResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void report(ReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportResponse) { + requests.add(request); + responseObserver.onNext(((ReportResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Report, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/QuotaControllerClientTest.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/QuotaControllerClientTest.java new file mode 100644 index 00000000..4f6386ed --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/QuotaControllerClientTest.java @@ -0,0 +1,131 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class QuotaControllerClientTest { + private static MockQuotaController mockQuotaController; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private QuotaControllerClient client; + + @BeforeClass + public static void startStaticServer() { + mockQuotaController = new MockQuotaController(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockQuotaController)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + QuotaControllerSettings settings = + QuotaControllerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QuotaControllerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void allocateQuotaTest() throws Exception { + AllocateQuotaResponse expectedResponse = + AllocateQuotaResponse.newBuilder() + .setOperationId("operationId129704162") + .addAllAllocateErrors(new ArrayList()) + .addAllQuotaMetrics(new ArrayList()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + mockQuotaController.addResponse(expectedResponse); + + AllocateQuotaRequest request = + AllocateQuotaRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .setAllocateOperation(QuotaOperation.newBuilder().build()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + + AllocateQuotaResponse actualResponse = client.allocateQuota(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockQuotaController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AllocateQuotaRequest actualRequest = ((AllocateQuotaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getServiceName(), actualRequest.getServiceName()); + Assert.assertEquals(request.getAllocateOperation(), actualRequest.getAllocateOperation()); + Assert.assertEquals(request.getServiceConfigId(), actualRequest.getServiceConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void allocateQuotaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaController.addException(exception); + + try { + AllocateQuotaRequest request = + AllocateQuotaRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .setAllocateOperation(QuotaOperation.newBuilder().build()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + client.allocateQuota(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/ServiceControllerClientTest.java b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/ServiceControllerClientTest.java new file mode 100644 index 00000000..4281b6fd --- /dev/null +++ b/google-cloud-service-control/src/test/java/com/google/api/servicecontrol/v1/ServiceControllerClientTest.java @@ -0,0 +1,184 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.servicecontrol.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ServiceControllerClientTest { + private static MockServiceController mockServiceController; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ServiceControllerClient client; + + @BeforeClass + public static void startStaticServer() { + mockServiceController = new MockServiceController(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockServiceController)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ServiceControllerSettings settings = + ServiceControllerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServiceControllerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void checkTest() throws Exception { + CheckResponse expectedResponse = + CheckResponse.newBuilder() + .setOperationId("operationId129704162") + .addAllCheckErrors(new ArrayList()) + .setServiceConfigId("serviceConfigId650537426") + .setServiceRolloutId("serviceRolloutId47544183") + .setCheckInfo(CheckResponse.CheckInfo.newBuilder().build()) + .build(); + mockServiceController.addResponse(expectedResponse); + + CheckRequest request = + CheckRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .setOperation(Operation.newBuilder().build()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + + CheckResponse actualResponse = client.check(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CheckRequest actualRequest = ((CheckRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getServiceName(), actualRequest.getServiceName()); + Assert.assertEquals(request.getOperation(), actualRequest.getOperation()); + Assert.assertEquals(request.getServiceConfigId(), actualRequest.getServiceConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void checkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceController.addException(exception); + + try { + CheckRequest request = + CheckRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .setOperation(Operation.newBuilder().build()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + client.check(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportTest() throws Exception { + ReportResponse expectedResponse = + ReportResponse.newBuilder() + .addAllReportErrors(new ArrayList()) + .setServiceConfigId("serviceConfigId650537426") + .setServiceRolloutId("serviceRolloutId47544183") + .build(); + mockServiceController.addResponse(expectedResponse); + + ReportRequest request = + ReportRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .addAllOperations(new ArrayList()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + + ReportResponse actualResponse = client.report(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReportRequest actualRequest = ((ReportRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getServiceName(), actualRequest.getServiceName()); + Assert.assertEquals(request.getOperationsList(), actualRequest.getOperationsList()); + Assert.assertEquals(request.getServiceConfigId(), actualRequest.getServiceConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceController.addException(exception); + + try { + ReportRequest request = + ReportRequest.newBuilder() + .setServiceName("serviceName-1928572192") + .addAllOperations(new ArrayList()) + .setServiceConfigId("serviceConfigId650537426") + .build(); + client.report(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-service-control-v1/pom.xml b/grpc-google-cloud-service-control-v1/pom.xml new file mode 100644 index 00000000..b407a2ed --- /dev/null +++ b/grpc-google-cloud-service-control-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-service-control-v1 + GRPC library for google-cloud-service-control + + com.google.cloud + google-cloud-service-control-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-service-control-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerGrpc.java b/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerGrpc.java new file mode 100644 index 00000000..2ed7eebb --- /dev/null +++ b/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerGrpc.java @@ -0,0 +1,404 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.servicecontrol.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * [Google Quota Control API](/service-control/overview)
+ * Allows clients to allocate and release quota against a [managed
+ * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/api/servicecontrol/v1/quota_controller.proto") +public final class QuotaControllerGrpc { + + private QuotaControllerGrpc() {} + + public static final String SERVICE_NAME = "google.api.servicecontrol.v1.QuotaController"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.AllocateQuotaRequest, + com.google.api.servicecontrol.v1.AllocateQuotaResponse> + getAllocateQuotaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AllocateQuota", + requestType = com.google.api.servicecontrol.v1.AllocateQuotaRequest.class, + responseType = com.google.api.servicecontrol.v1.AllocateQuotaResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.AllocateQuotaRequest, + com.google.api.servicecontrol.v1.AllocateQuotaResponse> + getAllocateQuotaMethod() { + io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.AllocateQuotaRequest, + com.google.api.servicecontrol.v1.AllocateQuotaResponse> + getAllocateQuotaMethod; + if ((getAllocateQuotaMethod = QuotaControllerGrpc.getAllocateQuotaMethod) == null) { + synchronized (QuotaControllerGrpc.class) { + if ((getAllocateQuotaMethod = QuotaControllerGrpc.getAllocateQuotaMethod) == null) { + QuotaControllerGrpc.getAllocateQuotaMethod = + getAllocateQuotaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AllocateQuota")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.AllocateQuotaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.AllocateQuotaResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new QuotaControllerMethodDescriptorSupplier("AllocateQuota")) + .build(); + } + } + } + return getAllocateQuotaMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static QuotaControllerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaControllerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerStub(channel, callOptions); + } + }; + return QuotaControllerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static QuotaControllerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaControllerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerBlockingStub(channel, callOptions); + } + }; + return QuotaControllerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static QuotaControllerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaControllerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerFutureStub(channel, callOptions); + } + }; + return QuotaControllerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * [Google Quota Control API](/service-control/overview)
+   * Allows clients to allocate and release quota against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public abstract static class QuotaControllerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Attempts to allocate quota for the specified consumer. It should be called
+     * before the operation is executed.
+     * This method requires the `servicemanagement.services.quota`
+     * permission on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * **NOTE:** The client **must** fail-open on server errors `INTERNAL`,
+     * `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system
+     * reliability, the server may inject these errors to prohibit any hard
+     * dependency on the quota functionality.
+     * 
+ */ + public void allocateQuota( + com.google.api.servicecontrol.v1.AllocateQuotaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAllocateQuotaMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getAllocateQuotaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.servicecontrol.v1.AllocateQuotaRequest, + com.google.api.servicecontrol.v1.AllocateQuotaResponse>( + this, METHODID_ALLOCATE_QUOTA))) + .build(); + } + } + + /** + * + * + *
+   * [Google Quota Control API](/service-control/overview)
+   * Allows clients to allocate and release quota against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class QuotaControllerStub + extends io.grpc.stub.AbstractAsyncStub { + private QuotaControllerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaControllerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerStub(channel, callOptions); + } + + /** + * + * + *
+     * Attempts to allocate quota for the specified consumer. It should be called
+     * before the operation is executed.
+     * This method requires the `servicemanagement.services.quota`
+     * permission on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * **NOTE:** The client **must** fail-open on server errors `INTERNAL`,
+     * `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system
+     * reliability, the server may inject these errors to prohibit any hard
+     * dependency on the quota functionality.
+     * 
+ */ + public void allocateQuota( + com.google.api.servicecontrol.v1.AllocateQuotaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAllocateQuotaMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * [Google Quota Control API](/service-control/overview)
+   * Allows clients to allocate and release quota against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class QuotaControllerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private QuotaControllerBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaControllerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Attempts to allocate quota for the specified consumer. It should be called
+     * before the operation is executed.
+     * This method requires the `servicemanagement.services.quota`
+     * permission on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * **NOTE:** The client **must** fail-open on server errors `INTERNAL`,
+     * `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system
+     * reliability, the server may inject these errors to prohibit any hard
+     * dependency on the quota functionality.
+     * 
+ */ + public com.google.api.servicecontrol.v1.AllocateQuotaResponse allocateQuota( + com.google.api.servicecontrol.v1.AllocateQuotaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAllocateQuotaMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * [Google Quota Control API](/service-control/overview)
+   * Allows clients to allocate and release quota against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class QuotaControllerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private QuotaControllerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaControllerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaControllerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Attempts to allocate quota for the specified consumer. It should be called
+     * before the operation is executed.
+     * This method requires the `servicemanagement.services.quota`
+     * permission on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * **NOTE:** The client **must** fail-open on server errors `INTERNAL`,
+     * `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system
+     * reliability, the server may inject these errors to prohibit any hard
+     * dependency on the quota functionality.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.servicecontrol.v1.AllocateQuotaResponse> + allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAllocateQuotaMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ALLOCATE_QUOTA = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final QuotaControllerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(QuotaControllerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_ALLOCATE_QUOTA: + serviceImpl.allocateQuota( + (com.google.api.servicecontrol.v1.AllocateQuotaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class QuotaControllerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + QuotaControllerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("QuotaController"); + } + } + + private static final class QuotaControllerFileDescriptorSupplier + extends QuotaControllerBaseDescriptorSupplier { + QuotaControllerFileDescriptorSupplier() {} + } + + private static final class QuotaControllerMethodDescriptorSupplier + extends QuotaControllerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + QuotaControllerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (QuotaControllerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new QuotaControllerFileDescriptorSupplier()) + .addMethod(getAllocateQuotaMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerGrpc.java b/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerGrpc.java new file mode 100644 index 00000000..1653af05 --- /dev/null +++ b/grpc-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerGrpc.java @@ -0,0 +1,577 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.servicecontrol.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * [Google Service Control API](/service-control/overview)
+ * Lets clients check and report operations against a [managed
+ * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/api/servicecontrol/v1/service_controller.proto") +public final class ServiceControllerGrpc { + + private ServiceControllerGrpc() {} + + public static final String SERVICE_NAME = "google.api.servicecontrol.v1.ServiceController"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.CheckRequest, + com.google.api.servicecontrol.v1.CheckResponse> + getCheckMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Check", + requestType = com.google.api.servicecontrol.v1.CheckRequest.class, + responseType = com.google.api.servicecontrol.v1.CheckResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.CheckRequest, + com.google.api.servicecontrol.v1.CheckResponse> + getCheckMethod() { + io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.CheckRequest, + com.google.api.servicecontrol.v1.CheckResponse> + getCheckMethod; + if ((getCheckMethod = ServiceControllerGrpc.getCheckMethod) == null) { + synchronized (ServiceControllerGrpc.class) { + if ((getCheckMethod = ServiceControllerGrpc.getCheckMethod) == null) { + ServiceControllerGrpc.getCheckMethod = + getCheckMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Check")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.CheckRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.CheckResponse.getDefaultInstance())) + .setSchemaDescriptor(new ServiceControllerMethodDescriptorSupplier("Check")) + .build(); + } + } + } + return getCheckMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.ReportRequest, + com.google.api.servicecontrol.v1.ReportResponse> + getReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Report", + requestType = com.google.api.servicecontrol.v1.ReportRequest.class, + responseType = com.google.api.servicecontrol.v1.ReportResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.ReportRequest, + com.google.api.servicecontrol.v1.ReportResponse> + getReportMethod() { + io.grpc.MethodDescriptor< + com.google.api.servicecontrol.v1.ReportRequest, + com.google.api.servicecontrol.v1.ReportResponse> + getReportMethod; + if ((getReportMethod = ServiceControllerGrpc.getReportMethod) == null) { + synchronized (ServiceControllerGrpc.class) { + if ((getReportMethod = ServiceControllerGrpc.getReportMethod) == null) { + ServiceControllerGrpc.getReportMethod = + getReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Report")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.ReportRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.servicecontrol.v1.ReportResponse.getDefaultInstance())) + .setSchemaDescriptor(new ServiceControllerMethodDescriptorSupplier("Report")) + .build(); + } + } + } + return getReportMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ServiceControllerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceControllerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerStub(channel, callOptions); + } + }; + return ServiceControllerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServiceControllerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceControllerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerBlockingStub(channel, callOptions); + } + }; + return ServiceControllerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ServiceControllerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceControllerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerFutureStub(channel, callOptions); + } + }; + return ServiceControllerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * [Google Service Control API](/service-control/overview)
+   * Lets clients check and report operations against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public abstract static class ServiceControllerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Checks whether an operation on a service should be allowed to proceed
+     * based on the configuration of the service and related policies. It must be
+     * called before the operation is executed.
+     * If feasible, the client should cache the check results and reuse them for
+     * 60 seconds. In case of any server errors, the client should rely on the
+     * cached results for much longer time to avoid outage.
+     * WARNING: There is general 60s delay for the configuration and policy
+     * propagation, therefore callers MUST NOT depend on the `Check` method having
+     * the latest policy information.
+     * NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.check` permission
+     * on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void check( + com.google.api.servicecontrol.v1.CheckRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCheckMethod(), responseObserver); + } + + /** + * + * + *
+     * Reports operation results to Google Service Control, such as logs and
+     * metrics. It should be called after an operation is completed.
+     * If feasible, the client should aggregate reporting data for up to 5
+     * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
+     * reduce data loss during client crashes. Clients should carefully choose
+     * the aggregation time window to avoid data loss risk more than 0.01%
+     * for business and compliance reasons.
+     * NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.report` permission
+     * on the specified service. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void report( + com.google.api.servicecontrol.v1.ReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReportMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCheckMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.servicecontrol.v1.CheckRequest, + com.google.api.servicecontrol.v1.CheckResponse>(this, METHODID_CHECK))) + .addMethod( + getReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.servicecontrol.v1.ReportRequest, + com.google.api.servicecontrol.v1.ReportResponse>(this, METHODID_REPORT))) + .build(); + } + } + + /** + * + * + *
+   * [Google Service Control API](/service-control/overview)
+   * Lets clients check and report operations against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class ServiceControllerStub + extends io.grpc.stub.AbstractAsyncStub { + private ServiceControllerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceControllerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerStub(channel, callOptions); + } + + /** + * + * + *
+     * Checks whether an operation on a service should be allowed to proceed
+     * based on the configuration of the service and related policies. It must be
+     * called before the operation is executed.
+     * If feasible, the client should cache the check results and reuse them for
+     * 60 seconds. In case of any server errors, the client should rely on the
+     * cached results for much longer time to avoid outage.
+     * WARNING: There is general 60s delay for the configuration and policy
+     * propagation, therefore callers MUST NOT depend on the `Check` method having
+     * the latest policy information.
+     * NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.check` permission
+     * on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void check( + com.google.api.servicecontrol.v1.CheckRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCheckMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Reports operation results to Google Service Control, such as logs and
+     * metrics. It should be called after an operation is completed.
+     * If feasible, the client should aggregate reporting data for up to 5
+     * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
+     * reduce data loss during client crashes. Clients should carefully choose
+     * the aggregation time window to avoid data loss risk more than 0.01%
+     * for business and compliance reasons.
+     * NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.report` permission
+     * on the specified service. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void report( + com.google.api.servicecontrol.v1.ReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReportMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * [Google Service Control API](/service-control/overview)
+   * Lets clients check and report operations against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class ServiceControllerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ServiceControllerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceControllerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Checks whether an operation on a service should be allowed to proceed
+     * based on the configuration of the service and related policies. It must be
+     * called before the operation is executed.
+     * If feasible, the client should cache the check results and reuse them for
+     * 60 seconds. In case of any server errors, the client should rely on the
+     * cached results for much longer time to avoid outage.
+     * WARNING: There is general 60s delay for the configuration and policy
+     * propagation, therefore callers MUST NOT depend on the `Check` method having
+     * the latest policy information.
+     * NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.check` permission
+     * on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.api.servicecontrol.v1.CheckResponse check( + com.google.api.servicecontrol.v1.CheckRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCheckMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reports operation results to Google Service Control, such as logs and
+     * metrics. It should be called after an operation is completed.
+     * If feasible, the client should aggregate reporting data for up to 5
+     * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
+     * reduce data loss during client crashes. Clients should carefully choose
+     * the aggregation time window to avoid data loss risk more than 0.01%
+     * for business and compliance reasons.
+     * NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.report` permission
+     * on the specified service. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.api.servicecontrol.v1.ReportResponse report( + com.google.api.servicecontrol.v1.ReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * [Google Service Control API](/service-control/overview)
+   * Lets clients check and report operations against a [managed
+   * service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).
+   * 
+ */ + public static final class ServiceControllerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ServiceControllerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceControllerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceControllerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Checks whether an operation on a service should be allowed to proceed
+     * based on the configuration of the service and related policies. It must be
+     * called before the operation is executed.
+     * If feasible, the client should cache the check results and reuse them for
+     * 60 seconds. In case of any server errors, the client should rely on the
+     * cached results for much longer time to avoid outage.
+     * WARNING: There is general 60s delay for the configuration and policy
+     * propagation, therefore callers MUST NOT depend on the `Check` method having
+     * the latest policy information.
+     * NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.check` permission
+     * on the specified service. For more information, see
+     * [Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.servicecontrol.v1.CheckResponse> + check(com.google.api.servicecontrol.v1.CheckRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCheckMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reports operation results to Google Service Control, such as logs and
+     * metrics. It should be called after an operation is completed.
+     * If feasible, the client should aggregate reporting data for up to 5
+     * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
+     * reduce data loss during client crashes. Clients should carefully choose
+     * the aggregation time window to avoid data loss risk more than 0.01%
+     * for business and compliance reasons.
+     * NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has
+     * the size limit (wire-format byte size) of 1MB.
+     * This method requires the `servicemanagement.services.report` permission
+     * on the specified service. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.servicecontrol.v1.ReportResponse> + report(com.google.api.servicecontrol.v1.ReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CHECK = 0; + private static final int METHODID_REPORT = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ServiceControllerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServiceControllerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CHECK: + serviceImpl.check( + (com.google.api.servicecontrol.v1.CheckRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPORT: + serviceImpl.report( + (com.google.api.servicecontrol.v1.ReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ServiceControllerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServiceControllerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServiceController"); + } + } + + private static final class ServiceControllerFileDescriptorSupplier + extends ServiceControllerBaseDescriptorSupplier { + ServiceControllerFileDescriptorSupplier() {} + } + + private static final class ServiceControllerMethodDescriptorSupplier + extends ServiceControllerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServiceControllerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ServiceControllerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServiceControllerFileDescriptorSupplier()) + .addMethod(getCheckMethod()) + .addMethod(getReportMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..77243461 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,24 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..0581b2a3 --- /dev/null +++ b/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + com.google.cloud + google-cloud-service-control-parent + pom + 0.0.1-SNAPSHOT + Google Service Control API Parent + https://github.com/googleapis/java-service-control + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.12.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-service-control.git + scm:git:git@github.com:googleapis/java-service-control.git + https://github.com/googleapis/java-service-control + HEAD + + + https://github.com/googleapis/java-service-control/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-service-control-parent + + + + + + com.google.cloud + google-cloud-service-control + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 1.3.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-service-control + grpc-google-cloud-service-control-v1 + proto-google-cloud-service-control-v1 + google-cloud-service-control-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + diff --git a/proto-google-cloud-service-control-v1/clirr-ignored-differences.xml b/proto-google-cloud-service-control-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..95ba8c75 --- /dev/null +++ b/proto-google-cloud-service-control-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/api/servicecontrol/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/api/servicecontrol/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/api/servicecontrol/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-service-control-v1/pom.xml b/proto-google-cloud-service-control-v1/pom.xml new file mode 100644 index 00000000..f410d0ac --- /dev/null +++ b/proto-google-cloud-service-control-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-service-control-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-service-control-v1 + Proto library for google-cloud-service-control + + com.google.cloud + google-cloud-service-control-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequest.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequest.java new file mode 100644 index 00000000..7b67f89a --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequest.java @@ -0,0 +1,1123 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Request message for the AllocateQuota method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaRequest} + */ +public final class AllocateQuotaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.AllocateQuotaRequest) + AllocateQuotaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllocateQuotaRequest.newBuilder() to construct. + private AllocateQuotaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllocateQuotaRequest() { + serviceName_ = ""; + serviceConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AllocateQuotaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AllocateQuotaRequest( + 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(); + + serviceName_ = s; + break; + } + case 18: + { + com.google.api.servicecontrol.v1.QuotaOperation.Builder subBuilder = null; + if (allocateOperation_ != null) { + subBuilder = allocateOperation_.toBuilder(); + } + allocateOperation_ = + input.readMessage( + com.google.api.servicecontrol.v1.QuotaOperation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allocateOperation_); + allocateOperation_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = 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.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.AllocateQuotaRequest.class, + com.google.api.servicecontrol.v1.AllocateQuotaRequest.Builder.class); + } + + public static final int SERVICE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object serviceName_; + /** + * + * + *
+   * Name of the service as specified in the service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See [google.api.Service][google.api.Service] for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + @java.lang.Override + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + 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(); + serviceName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the service as specified in the service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See [google.api.Service][google.api.Service] for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATE_OPERATION_FIELD_NUMBER = 2; + private com.google.api.servicecontrol.v1.QuotaOperation allocateOperation_; + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return Whether the allocateOperation field is set. + */ + @java.lang.Override + public boolean hasAllocateOperation() { + return allocateOperation_ != null; + } + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return The allocateOperation. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation getAllocateOperation() { + return allocateOperation_ == null + ? com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() + : allocateOperation_; + } + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperationOrBuilder getAllocateOperationOrBuilder() { + return getAllocateOperation(); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request. If unspecified or no matching version can be found, the latest
+   * one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request. If unspecified or no matching version can be found, the latest
+   * one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = 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 (!getServiceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceName_); + } + if (allocateOperation_ != null) { + output.writeMessage(2, getAllocateOperation()); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceConfigId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceName_); + } + if (allocateOperation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAllocateOperation()); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceConfigId_); + } + 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.api.servicecontrol.v1.AllocateQuotaRequest)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.AllocateQuotaRequest other = + (com.google.api.servicecontrol.v1.AllocateQuotaRequest) obj; + + if (!getServiceName().equals(other.getServiceName())) return false; + if (hasAllocateOperation() != other.hasAllocateOperation()) return false; + if (hasAllocateOperation()) { + if (!getAllocateOperation().equals(other.getAllocateOperation())) return false; + } + if (!getServiceConfigId().equals(other.getServiceConfigId())) 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) + SERVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getServiceName().hashCode(); + if (hasAllocateOperation()) { + hash = (37 * hash) + ALLOCATE_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getAllocateOperation().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest 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.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest 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.api.servicecontrol.v1.AllocateQuotaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest 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.api.servicecontrol.v1.AllocateQuotaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest 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.api.servicecontrol.v1.AllocateQuotaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the AllocateQuota method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.AllocateQuotaRequest) + com.google.api.servicecontrol.v1.AllocateQuotaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.AllocateQuotaRequest.class, + com.google.api.servicecontrol.v1.AllocateQuotaRequest.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.AllocateQuotaRequest.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(); + serviceName_ = ""; + + if (allocateOperationBuilder_ == null) { + allocateOperation_ = null; + } else { + allocateOperation_ = null; + allocateOperationBuilder_ = null; + } + serviceConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaRequest build() { + com.google.api.servicecontrol.v1.AllocateQuotaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaRequest buildPartial() { + com.google.api.servicecontrol.v1.AllocateQuotaRequest result = + new com.google.api.servicecontrol.v1.AllocateQuotaRequest(this); + result.serviceName_ = serviceName_; + if (allocateOperationBuilder_ == null) { + result.allocateOperation_ = allocateOperation_; + } else { + result.allocateOperation_ = allocateOperationBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + 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.api.servicecontrol.v1.AllocateQuotaRequest) { + return mergeFrom((com.google.api.servicecontrol.v1.AllocateQuotaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.AllocateQuotaRequest other) { + if (other == com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDefaultInstance()) + return this; + if (!other.getServiceName().isEmpty()) { + serviceName_ = other.serviceName_; + onChanged(); + } + if (other.hasAllocateOperation()) { + mergeAllocateOperation(other.getAllocateOperation()); + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + 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.api.servicecontrol.v1.AllocateQuotaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.AllocateQuotaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object serviceName_ = ""; + /** + * + * + *
+     * Name of the service as specified in the service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See [google.api.Service][google.api.Service] for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the service as specified in the service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See [google.api.Service][google.api.Service] for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the service as specified in the service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See [google.api.Service][google.api.Service] for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the service as specified in the service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See [google.api.Service][google.api.Service] for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearServiceName() { + + serviceName_ = getDefaultInstance().getServiceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the service as specified in the service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See [google.api.Service][google.api.Service] for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The bytes for serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceName_ = value; + onChanged(); + return this; + } + + private com.google.api.servicecontrol.v1.QuotaOperation allocateOperation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaOperation, + com.google.api.servicecontrol.v1.QuotaOperation.Builder, + com.google.api.servicecontrol.v1.QuotaOperationOrBuilder> + allocateOperationBuilder_; + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return Whether the allocateOperation field is set. + */ + public boolean hasAllocateOperation() { + return allocateOperationBuilder_ != null || allocateOperation_ != null; + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return The allocateOperation. + */ + public com.google.api.servicecontrol.v1.QuotaOperation getAllocateOperation() { + if (allocateOperationBuilder_ == null) { + return allocateOperation_ == null + ? com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() + : allocateOperation_; + } else { + return allocateOperationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public Builder setAllocateOperation(com.google.api.servicecontrol.v1.QuotaOperation value) { + if (allocateOperationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocateOperation_ = value; + onChanged(); + } else { + allocateOperationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public Builder setAllocateOperation( + com.google.api.servicecontrol.v1.QuotaOperation.Builder builderForValue) { + if (allocateOperationBuilder_ == null) { + allocateOperation_ = builderForValue.build(); + onChanged(); + } else { + allocateOperationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public Builder mergeAllocateOperation(com.google.api.servicecontrol.v1.QuotaOperation value) { + if (allocateOperationBuilder_ == null) { + if (allocateOperation_ != null) { + allocateOperation_ = + com.google.api.servicecontrol.v1.QuotaOperation.newBuilder(allocateOperation_) + .mergeFrom(value) + .buildPartial(); + } else { + allocateOperation_ = value; + } + onChanged(); + } else { + allocateOperationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public Builder clearAllocateOperation() { + if (allocateOperationBuilder_ == null) { + allocateOperation_ = null; + onChanged(); + } else { + allocateOperation_ = null; + allocateOperationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public com.google.api.servicecontrol.v1.QuotaOperation.Builder getAllocateOperationBuilder() { + + onChanged(); + return getAllocateOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + public com.google.api.servicecontrol.v1.QuotaOperationOrBuilder + getAllocateOperationOrBuilder() { + if (allocateOperationBuilder_ != null) { + return allocateOperationBuilder_.getMessageOrBuilder(); + } else { + return allocateOperation_ == null + ? com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() + : allocateOperation_; + } + } + /** + * + * + *
+     * Operation that describes the quota allocation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaOperation, + com.google.api.servicecontrol.v1.QuotaOperation.Builder, + com.google.api.servicecontrol.v1.QuotaOperationOrBuilder> + getAllocateOperationFieldBuilder() { + if (allocateOperationBuilder_ == null) { + allocateOperationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaOperation, + com.google.api.servicecontrol.v1.QuotaOperation.Builder, + com.google.api.servicecontrol.v1.QuotaOperationOrBuilder>( + getAllocateOperation(), getParentForChildren(), isClean()); + allocateOperation_ = null; + } + return allocateOperationBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request. If unspecified or no matching version can be found, the latest
+     * one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request. If unspecified or no matching version can be found, the latest
+     * one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request. If unspecified or no matching version can be found, the latest
+     * one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request. If unspecified or no matching version can be found, the latest
+     * one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request. If unspecified or no matching version can be found, the latest
+     * one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = 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.api.servicecontrol.v1.AllocateQuotaRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.AllocateQuotaRequest) + private static final com.google.api.servicecontrol.v1.AllocateQuotaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.AllocateQuotaRequest(); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocateQuotaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllocateQuotaRequest(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.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequestOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequestOrBuilder.java new file mode 100644 index 00000000..0b8fbc70 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaRequestOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface AllocateQuotaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.AllocateQuotaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the service as specified in the service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See [google.api.Service][google.api.Service] for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + java.lang.String getServiceName(); + /** + * + * + *
+   * Name of the service as specified in the service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See [google.api.Service][google.api.Service] for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + com.google.protobuf.ByteString getServiceNameBytes(); + + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return Whether the allocateOperation field is set. + */ + boolean hasAllocateOperation(); + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + * + * @return The allocateOperation. + */ + com.google.api.servicecontrol.v1.QuotaOperation getAllocateOperation(); + /** + * + * + *
+   * Operation that describes the quota allocation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2; + */ + com.google.api.servicecontrol.v1.QuotaOperationOrBuilder getAllocateOperationOrBuilder(); + + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request. If unspecified or no matching version can be found, the latest
+   * one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request. If unspecified or no matching version can be found, the latest
+   * one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponse.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponse.java new file mode 100644 index 00000000..97be6522 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponse.java @@ -0,0 +1,1980 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Response message for the AllocateQuota method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaResponse} + */ +public final class AllocateQuotaResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.AllocateQuotaResponse) + AllocateQuotaResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllocateQuotaResponse.newBuilder() to construct. + private AllocateQuotaResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllocateQuotaResponse() { + operationId_ = ""; + allocateErrors_ = java.util.Collections.emptyList(); + quotaMetrics_ = java.util.Collections.emptyList(); + serviceConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AllocateQuotaResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AllocateQuotaResponse( + 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(); + + operationId_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allocateErrors_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allocateErrors_.add( + input.readMessage( + com.google.api.servicecontrol.v1.QuotaError.parser(), extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + quotaMetrics_.add( + input.readMessage( + com.google.api.servicecontrol.v1.MetricValueSet.parser(), extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = 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)) { + allocateErrors_ = java.util.Collections.unmodifiableList(allocateErrors_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = java.util.Collections.unmodifiableList(quotaMetrics_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.AllocateQuotaResponse.class, + com.google.api.servicecontrol.v1.AllocateQuotaResponse.Builder.class); + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object operationId_; + /** + * + * + *
+   * The same operation_id value used in the AllocateQuotaRequest. Used for
+   * logging and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + 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(); + operationId_ = s; + return s; + } + } + /** + * + * + *
+   * The same operation_id value used in the AllocateQuotaRequest. Used for
+   * logging and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATE_ERRORS_FIELD_NUMBER = 2; + private java.util.List allocateErrors_; + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + @java.lang.Override + public java.util.List getAllocateErrorsList() { + return allocateErrors_; + } + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + @java.lang.Override + public java.util.List + getAllocateErrorsOrBuilderList() { + return allocateErrors_; + } + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + @java.lang.Override + public int getAllocateErrorsCount() { + return allocateErrors_.size(); + } + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError getAllocateErrors(int index) { + return allocateErrors_.get(index); + } + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaErrorOrBuilder getAllocateErrorsOrBuilder( + int index) { + return allocateErrors_.get(index); + } + + public static final int QUOTA_METRICS_FIELD_NUMBER = 3; + private java.util.List quotaMetrics_; + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + @java.lang.Override + public java.util.List getQuotaMetricsList() { + return quotaMetrics_; + } + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + @java.lang.Override + public java.util.List + getQuotaMetricsOrBuilderList() { + return quotaMetrics_; + } + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + @java.lang.Override + public int getQuotaMetricsCount() { + return quotaMetrics_.size(); + } + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index) { + return quotaMetrics_.get(index); + } + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder( + int index) { + return quotaMetrics_.get(index); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * ID of the actual config used to process the request.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the actual config used to process the request.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = 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 (!getOperationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationId_); + } + for (int i = 0; i < allocateErrors_.size(); i++) { + output.writeMessage(2, allocateErrors_.get(i)); + } + for (int i = 0; i < quotaMetrics_.size(); i++) { + output.writeMessage(3, quotaMetrics_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceConfigId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationId_); + } + for (int i = 0; i < allocateErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, allocateErrors_.get(i)); + } + for (int i = 0; i < quotaMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, quotaMetrics_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceConfigId_); + } + 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.api.servicecontrol.v1.AllocateQuotaResponse)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.AllocateQuotaResponse other = + (com.google.api.servicecontrol.v1.AllocateQuotaResponse) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getAllocateErrorsList().equals(other.getAllocateErrorsList())) return false; + if (!getQuotaMetricsList().equals(other.getQuotaMetricsList())) return false; + if (!getServiceConfigId().equals(other.getServiceConfigId())) 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) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + if (getAllocateErrorsCount() > 0) { + hash = (37 * hash) + ALLOCATE_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getAllocateErrorsList().hashCode(); + } + if (getQuotaMetricsCount() > 0) { + hash = (37 * hash) + QUOTA_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaMetricsList().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse 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.api.servicecontrol.v1.AllocateQuotaResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse 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.api.servicecontrol.v1.AllocateQuotaResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse 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.api.servicecontrol.v1.AllocateQuotaResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse 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.api.servicecontrol.v1.AllocateQuotaResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the AllocateQuota method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.AllocateQuotaResponse) + com.google.api.servicecontrol.v1.AllocateQuotaResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.AllocateQuotaResponse.class, + com.google.api.servicecontrol.v1.AllocateQuotaResponse.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.AllocateQuotaResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAllocateErrorsFieldBuilder(); + getQuotaMetricsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + operationId_ = ""; + + if (allocateErrorsBuilder_ == null) { + allocateErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + allocateErrorsBuilder_.clear(); + } + if (quotaMetricsBuilder_ == null) { + quotaMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + quotaMetricsBuilder_.clear(); + } + serviceConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaResponse getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.AllocateQuotaResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaResponse build() { + com.google.api.servicecontrol.v1.AllocateQuotaResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.AllocateQuotaResponse buildPartial() { + com.google.api.servicecontrol.v1.AllocateQuotaResponse result = + new com.google.api.servicecontrol.v1.AllocateQuotaResponse(this); + int from_bitField0_ = bitField0_; + result.operationId_ = operationId_; + if (allocateErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + allocateErrors_ = java.util.Collections.unmodifiableList(allocateErrors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allocateErrors_ = allocateErrors_; + } else { + result.allocateErrors_ = allocateErrorsBuilder_.build(); + } + if (quotaMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = java.util.Collections.unmodifiableList(quotaMetrics_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.quotaMetrics_ = quotaMetrics_; + } else { + result.quotaMetrics_ = quotaMetricsBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + 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.api.servicecontrol.v1.AllocateQuotaResponse) { + return mergeFrom((com.google.api.servicecontrol.v1.AllocateQuotaResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.AllocateQuotaResponse other) { + if (other == com.google.api.servicecontrol.v1.AllocateQuotaResponse.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + onChanged(); + } + if (allocateErrorsBuilder_ == null) { + if (!other.allocateErrors_.isEmpty()) { + if (allocateErrors_.isEmpty()) { + allocateErrors_ = other.allocateErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllocateErrorsIsMutable(); + allocateErrors_.addAll(other.allocateErrors_); + } + onChanged(); + } + } else { + if (!other.allocateErrors_.isEmpty()) { + if (allocateErrorsBuilder_.isEmpty()) { + allocateErrorsBuilder_.dispose(); + allocateErrorsBuilder_ = null; + allocateErrors_ = other.allocateErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + allocateErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAllocateErrorsFieldBuilder() + : null; + } else { + allocateErrorsBuilder_.addAllMessages(other.allocateErrors_); + } + } + } + if (quotaMetricsBuilder_ == null) { + if (!other.quotaMetrics_.isEmpty()) { + if (quotaMetrics_.isEmpty()) { + quotaMetrics_ = other.quotaMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.addAll(other.quotaMetrics_); + } + onChanged(); + } + } else { + if (!other.quotaMetrics_.isEmpty()) { + if (quotaMetricsBuilder_.isEmpty()) { + quotaMetricsBuilder_.dispose(); + quotaMetricsBuilder_ = null; + quotaMetrics_ = other.quotaMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + quotaMetricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaMetricsFieldBuilder() + : null; + } else { + quotaMetricsBuilder_.addAllMessages(other.quotaMetrics_); + } + } + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + 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.api.servicecontrol.v1.AllocateQuotaResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.AllocateQuotaResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object operationId_ = ""; + /** + * + * + *
+     * The same operation_id value used in the AllocateQuotaRequest. Used for
+     * logging and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The same operation_id value used in the AllocateQuotaRequest. Used for
+     * logging and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The same operation_id value used in the AllocateQuotaRequest. Used for
+     * logging and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The same operation_id value used in the AllocateQuotaRequest. Used for
+     * logging and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + + operationId_ = getDefaultInstance().getOperationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The same operation_id value used in the AllocateQuotaRequest. Used for
+     * logging and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationId_ = value; + onChanged(); + return this; + } + + private java.util.List allocateErrors_ = + java.util.Collections.emptyList(); + + private void ensureAllocateErrorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allocateErrors_ = + new java.util.ArrayList(allocateErrors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaError, + com.google.api.servicecontrol.v1.QuotaError.Builder, + com.google.api.servicecontrol.v1.QuotaErrorOrBuilder> + allocateErrorsBuilder_; + + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public java.util.List getAllocateErrorsList() { + if (allocateErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(allocateErrors_); + } else { + return allocateErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public int getAllocateErrorsCount() { + if (allocateErrorsBuilder_ == null) { + return allocateErrors_.size(); + } else { + return allocateErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public com.google.api.servicecontrol.v1.QuotaError getAllocateErrors(int index) { + if (allocateErrorsBuilder_ == null) { + return allocateErrors_.get(index); + } else { + return allocateErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder setAllocateErrors(int index, com.google.api.servicecontrol.v1.QuotaError value) { + if (allocateErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocateErrorsIsMutable(); + allocateErrors_.set(index, value); + onChanged(); + } else { + allocateErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder setAllocateErrors( + int index, com.google.api.servicecontrol.v1.QuotaError.Builder builderForValue) { + if (allocateErrorsBuilder_ == null) { + ensureAllocateErrorsIsMutable(); + allocateErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + allocateErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder addAllocateErrors(com.google.api.servicecontrol.v1.QuotaError value) { + if (allocateErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocateErrorsIsMutable(); + allocateErrors_.add(value); + onChanged(); + } else { + allocateErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder addAllocateErrors(int index, com.google.api.servicecontrol.v1.QuotaError value) { + if (allocateErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocateErrorsIsMutable(); + allocateErrors_.add(index, value); + onChanged(); + } else { + allocateErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder addAllocateErrors( + com.google.api.servicecontrol.v1.QuotaError.Builder builderForValue) { + if (allocateErrorsBuilder_ == null) { + ensureAllocateErrorsIsMutable(); + allocateErrors_.add(builderForValue.build()); + onChanged(); + } else { + allocateErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder addAllocateErrors( + int index, com.google.api.servicecontrol.v1.QuotaError.Builder builderForValue) { + if (allocateErrorsBuilder_ == null) { + ensureAllocateErrorsIsMutable(); + allocateErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + allocateErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder addAllAllocateErrors( + java.lang.Iterable values) { + if (allocateErrorsBuilder_ == null) { + ensureAllocateErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allocateErrors_); + onChanged(); + } else { + allocateErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder clearAllocateErrors() { + if (allocateErrorsBuilder_ == null) { + allocateErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + allocateErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public Builder removeAllocateErrors(int index) { + if (allocateErrorsBuilder_ == null) { + ensureAllocateErrorsIsMutable(); + allocateErrors_.remove(index); + onChanged(); + } else { + allocateErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public com.google.api.servicecontrol.v1.QuotaError.Builder getAllocateErrorsBuilder(int index) { + return getAllocateErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public com.google.api.servicecontrol.v1.QuotaErrorOrBuilder getAllocateErrorsOrBuilder( + int index) { + if (allocateErrorsBuilder_ == null) { + return allocateErrors_.get(index); + } else { + return allocateErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public java.util.List + getAllocateErrorsOrBuilderList() { + if (allocateErrorsBuilder_ != null) { + return allocateErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allocateErrors_); + } + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public com.google.api.servicecontrol.v1.QuotaError.Builder addAllocateErrorsBuilder() { + return getAllocateErrorsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.QuotaError.getDefaultInstance()); + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public com.google.api.servicecontrol.v1.QuotaError.Builder addAllocateErrorsBuilder(int index) { + return getAllocateErrorsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.QuotaError.getDefaultInstance()); + } + /** + * + * + *
+     * Indicates the decision of the allocate.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + public java.util.List + getAllocateErrorsBuilderList() { + return getAllocateErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaError, + com.google.api.servicecontrol.v1.QuotaError.Builder, + com.google.api.servicecontrol.v1.QuotaErrorOrBuilder> + getAllocateErrorsFieldBuilder() { + if (allocateErrorsBuilder_ == null) { + allocateErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.QuotaError, + com.google.api.servicecontrol.v1.QuotaError.Builder, + com.google.api.servicecontrol.v1.QuotaErrorOrBuilder>( + allocateErrors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + allocateErrors_ = null; + } + return allocateErrorsBuilder_; + } + + private java.util.List quotaMetrics_ = + java.util.Collections.emptyList(); + + private void ensureQuotaMetricsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = + new java.util.ArrayList(quotaMetrics_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + quotaMetricsBuilder_; + + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public java.util.List getQuotaMetricsList() { + if (quotaMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaMetrics_); + } else { + return quotaMetricsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public int getQuotaMetricsCount() { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.size(); + } else { + return quotaMetricsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index) { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.get(index); + } else { + return quotaMetricsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder setQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.set(index, value); + onChanged(); + } else { + quotaMetricsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder setQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder addQuotaMetrics(com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(value); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder addQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(index, value); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder addQuotaMetrics( + com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder addQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder addAllQuotaMetrics( + java.lang.Iterable values) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaMetrics_); + onChanged(); + } else { + quotaMetricsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder clearQuotaMetrics() { + if (quotaMetricsBuilder_ == null) { + quotaMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + quotaMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public Builder removeQuotaMetrics(int index) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.remove(index); + onChanged(); + } else { + quotaMetricsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder getQuotaMetricsBuilder( + int index) { + return getQuotaMetricsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder( + int index) { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.get(index); + } else { + return quotaMetricsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public java.util.List + getQuotaMetricsOrBuilderList() { + if (quotaMetricsBuilder_ != null) { + return quotaMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaMetrics_); + } + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addQuotaMetricsBuilder() { + return getQuotaMetricsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addQuotaMetricsBuilder( + int index) { + return getQuotaMetricsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Quota metrics to indicate the result of allocation. Depending on the
+     * request, one or more of the following metrics will be included:
+     * 1. Per quota group or per quota metric incremental usage will be specified
+     * using the following delta metric :
+     *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+     * 2. The quota limit reached condition will be specified using the following
+     * boolean metric :
+     *   "serviceruntime.googleapis.com/quota/exceeded"
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + public java.util.List + getQuotaMetricsBuilderList() { + return getQuotaMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + getQuotaMetricsFieldBuilder() { + if (quotaMetricsBuilder_ == null) { + quotaMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder>( + quotaMetrics_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + quotaMetrics_ = null; + } + return quotaMetricsBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * ID of the actual config used to process the request.
+     * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the actual config used to process the request.
+     * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the actual config used to process the request.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the actual config used to process the request.
+     * 
+ * + * string service_config_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the actual config used to process the request.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = 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.api.servicecontrol.v1.AllocateQuotaResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.AllocateQuotaResponse) + private static final com.google.api.servicecontrol.v1.AllocateQuotaResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.AllocateQuotaResponse(); + } + + public static com.google.api.servicecontrol.v1.AllocateQuotaResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocateQuotaResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllocateQuotaResponse(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.api.servicecontrol.v1.AllocateQuotaResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponseOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponseOrBuilder.java new file mode 100644 index 00000000..fa81a190 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/AllocateQuotaResponseOrBuilder.java @@ -0,0 +1,216 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface AllocateQuotaResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.AllocateQuotaResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The same operation_id value used in the AllocateQuotaRequest. Used for
+   * logging and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + /** + * + * + *
+   * The same operation_id value used in the AllocateQuotaRequest. Used for
+   * logging and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); + + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + java.util.List getAllocateErrorsList(); + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + com.google.api.servicecontrol.v1.QuotaError getAllocateErrors(int index); + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + int getAllocateErrorsCount(); + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + java.util.List + getAllocateErrorsOrBuilderList(); + /** + * + * + *
+   * Indicates the decision of the allocate.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.QuotaError allocate_errors = 2; + */ + com.google.api.servicecontrol.v1.QuotaErrorOrBuilder getAllocateErrorsOrBuilder(int index); + + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + java.util.List getQuotaMetricsList(); + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index); + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + int getQuotaMetricsCount(); + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + java.util.List + getQuotaMetricsOrBuilderList(); + /** + * + * + *
+   * Quota metrics to indicate the result of allocation. Depending on the
+   * request, one or more of the following metrics will be included:
+   * 1. Per quota group or per quota metric incremental usage will be specified
+   * using the following delta metric :
+   *   "serviceruntime.googleapis.com/api/consumer/quota_used_count"
+   * 2. The quota limit reached condition will be specified using the following
+   * boolean metric :
+   *   "serviceruntime.googleapis.com/quota/exceeded"
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 3; + */ + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder(int index); + + /** + * + * + *
+   * ID of the actual config used to process the request.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * ID of the actual config used to process the request.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckError.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckError.java new file mode 100644 index 00000000..12c59903 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckError.java @@ -0,0 +1,1849 @@ +/* + * 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/api/servicecontrol/v1/check_error.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Defines the errors to be returned in
+ * [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors].
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckError} + */ +public final class CheckError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.CheckError) + CheckErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use CheckError.newBuilder() to construct. + private CheckError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CheckError() { + code_ = 0; + subject_ = ""; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CheckError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CheckError( + 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(); + + code_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + detail_ = s; + break; + } + case 26: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + subject_ = 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.api.servicecontrol.v1.CheckErrorProto + .internal_static_google_api_servicecontrol_v1_CheckError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.CheckErrorProto + .internal_static_google_api_servicecontrol_v1_CheckError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckError.class, + com.google.api.servicecontrol.v1.CheckError.Builder.class); + } + + /** + * + * + *
+   * Error codes for Check responses.
+   * 
+ * + * Protobuf enum {@code google.api.servicecontrol.v1.CheckError.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is never used in `CheckResponse`.
+     * 
+ * + * ERROR_CODE_UNSPECIFIED = 0; + */ + ERROR_CODE_UNSPECIFIED(0), + /** + * + * + *
+     * The consumer's project id, network container, or resource container was
+     * not found. Same as [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND].
+     * 
+ * + * NOT_FOUND = 5; + */ + NOT_FOUND(5), + /** + * + * + *
+     * The consumer doesn't have access to the specified resource.
+     * Same as [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * PERMISSION_DENIED = 7; + */ + PERMISSION_DENIED(7), + /** + * + * + *
+     * Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED].
+     * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + RESOURCE_EXHAUSTED(8), + /** + * + * + *
+     * The consumer hasn't activated the service.
+     * 
+ * + * SERVICE_NOT_ACTIVATED = 104; + */ + SERVICE_NOT_ACTIVATED(104), + /** + * + * + *
+     * The consumer cannot access the service because billing is disabled.
+     * 
+ * + * BILLING_DISABLED = 107; + */ + BILLING_DISABLED(107), + /** + * + * + *
+     * The consumer's project has been marked as deleted (soft deletion).
+     * 
+ * + * PROJECT_DELETED = 108; + */ + PROJECT_DELETED(108), + /** + * + * + *
+     * The consumer's project number or id does not represent a valid project.
+     * 
+ * + * PROJECT_INVALID = 114; + */ + PROJECT_INVALID(114), + /** + * + * + *
+     * The input consumer info does not represent a valid consumer folder or
+     * organization.
+     * 
+ * + * CONSUMER_INVALID = 125; + */ + CONSUMER_INVALID(125), + /** + * + * + *
+     * The IP address of the consumer is invalid for the specific consumer
+     * project.
+     * 
+ * + * IP_ADDRESS_BLOCKED = 109; + */ + IP_ADDRESS_BLOCKED(109), + /** + * + * + *
+     * The referer address of the consumer request is invalid for the specific
+     * consumer project.
+     * 
+ * + * REFERER_BLOCKED = 110; + */ + REFERER_BLOCKED(110), + /** + * + * + *
+     * The client application of the consumer request is invalid for the
+     * specific consumer project.
+     * 
+ * + * CLIENT_APP_BLOCKED = 111; + */ + CLIENT_APP_BLOCKED(111), + /** + * + * + *
+     * The API targeted by this request is invalid for the specified consumer
+     * project.
+     * 
+ * + * API_TARGET_BLOCKED = 122; + */ + API_TARGET_BLOCKED(122), + /** + * + * + *
+     * The consumer's API key is invalid.
+     * 
+ * + * API_KEY_INVALID = 105; + */ + API_KEY_INVALID(105), + /** + * + * + *
+     * The consumer's API Key has expired.
+     * 
+ * + * API_KEY_EXPIRED = 112; + */ + API_KEY_EXPIRED(112), + /** + * + * + *
+     * The consumer's API Key was not found in config record.
+     * 
+ * + * API_KEY_NOT_FOUND = 113; + */ + API_KEY_NOT_FOUND(113), + /** + * + * + *
+     * The credential in the request can not be verified.
+     * 
+ * + * INVALID_CREDENTIAL = 123; + */ + INVALID_CREDENTIAL(123), + /** + * + * + *
+     * The backend server for looking up project id/number is unavailable.
+     * 
+ * + * NAMESPACE_LOOKUP_UNAVAILABLE = 300; + */ + NAMESPACE_LOOKUP_UNAVAILABLE(300), + /** + * + * + *
+     * The backend server for checking service status is unavailable.
+     * 
+ * + * SERVICE_STATUS_UNAVAILABLE = 301; + */ + SERVICE_STATUS_UNAVAILABLE(301), + /** + * + * + *
+     * The backend server for checking billing status is unavailable.
+     * 
+ * + * BILLING_STATUS_UNAVAILABLE = 302; + */ + BILLING_STATUS_UNAVAILABLE(302), + /** + * + * + *
+     * Cloud Resource Manager backend server is unavailable.
+     * 
+ * + * CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE = 305; + */ + CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE(305), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is never used in `CheckResponse`.
+     * 
+ * + * ERROR_CODE_UNSPECIFIED = 0; + */ + public static final int ERROR_CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The consumer's project id, network container, or resource container was
+     * not found. Same as [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND].
+     * 
+ * + * NOT_FOUND = 5; + */ + public static final int NOT_FOUND_VALUE = 5; + /** + * + * + *
+     * The consumer doesn't have access to the specified resource.
+     * Same as [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * PERMISSION_DENIED = 7; + */ + public static final int PERMISSION_DENIED_VALUE = 7; + /** + * + * + *
+     * Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED].
+     * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + public static final int RESOURCE_EXHAUSTED_VALUE = 8; + /** + * + * + *
+     * The consumer hasn't activated the service.
+     * 
+ * + * SERVICE_NOT_ACTIVATED = 104; + */ + public static final int SERVICE_NOT_ACTIVATED_VALUE = 104; + /** + * + * + *
+     * The consumer cannot access the service because billing is disabled.
+     * 
+ * + * BILLING_DISABLED = 107; + */ + public static final int BILLING_DISABLED_VALUE = 107; + /** + * + * + *
+     * The consumer's project has been marked as deleted (soft deletion).
+     * 
+ * + * PROJECT_DELETED = 108; + */ + public static final int PROJECT_DELETED_VALUE = 108; + /** + * + * + *
+     * The consumer's project number or id does not represent a valid project.
+     * 
+ * + * PROJECT_INVALID = 114; + */ + public static final int PROJECT_INVALID_VALUE = 114; + /** + * + * + *
+     * The input consumer info does not represent a valid consumer folder or
+     * organization.
+     * 
+ * + * CONSUMER_INVALID = 125; + */ + public static final int CONSUMER_INVALID_VALUE = 125; + /** + * + * + *
+     * The IP address of the consumer is invalid for the specific consumer
+     * project.
+     * 
+ * + * IP_ADDRESS_BLOCKED = 109; + */ + public static final int IP_ADDRESS_BLOCKED_VALUE = 109; + /** + * + * + *
+     * The referer address of the consumer request is invalid for the specific
+     * consumer project.
+     * 
+ * + * REFERER_BLOCKED = 110; + */ + public static final int REFERER_BLOCKED_VALUE = 110; + /** + * + * + *
+     * The client application of the consumer request is invalid for the
+     * specific consumer project.
+     * 
+ * + * CLIENT_APP_BLOCKED = 111; + */ + public static final int CLIENT_APP_BLOCKED_VALUE = 111; + /** + * + * + *
+     * The API targeted by this request is invalid for the specified consumer
+     * project.
+     * 
+ * + * API_TARGET_BLOCKED = 122; + */ + public static final int API_TARGET_BLOCKED_VALUE = 122; + /** + * + * + *
+     * The consumer's API key is invalid.
+     * 
+ * + * API_KEY_INVALID = 105; + */ + public static final int API_KEY_INVALID_VALUE = 105; + /** + * + * + *
+     * The consumer's API Key has expired.
+     * 
+ * + * API_KEY_EXPIRED = 112; + */ + public static final int API_KEY_EXPIRED_VALUE = 112; + /** + * + * + *
+     * The consumer's API Key was not found in config record.
+     * 
+ * + * API_KEY_NOT_FOUND = 113; + */ + public static final int API_KEY_NOT_FOUND_VALUE = 113; + /** + * + * + *
+     * The credential in the request can not be verified.
+     * 
+ * + * INVALID_CREDENTIAL = 123; + */ + public static final int INVALID_CREDENTIAL_VALUE = 123; + /** + * + * + *
+     * The backend server for looking up project id/number is unavailable.
+     * 
+ * + * NAMESPACE_LOOKUP_UNAVAILABLE = 300; + */ + public static final int NAMESPACE_LOOKUP_UNAVAILABLE_VALUE = 300; + /** + * + * + *
+     * The backend server for checking service status is unavailable.
+     * 
+ * + * SERVICE_STATUS_UNAVAILABLE = 301; + */ + public static final int SERVICE_STATUS_UNAVAILABLE_VALUE = 301; + /** + * + * + *
+     * The backend server for checking billing status is unavailable.
+     * 
+ * + * BILLING_STATUS_UNAVAILABLE = 302; + */ + public static final int BILLING_STATUS_UNAVAILABLE_VALUE = 302; + /** + * + * + *
+     * Cloud Resource Manager backend server is unavailable.
+     * 
+ * + * CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE = 305; + */ + public static final int CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE_VALUE = 305; + + 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 Code 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 Code forNumber(int value) { + switch (value) { + case 0: + return ERROR_CODE_UNSPECIFIED; + case 5: + return NOT_FOUND; + case 7: + return PERMISSION_DENIED; + case 8: + return RESOURCE_EXHAUSTED; + case 104: + return SERVICE_NOT_ACTIVATED; + case 107: + return BILLING_DISABLED; + case 108: + return PROJECT_DELETED; + case 114: + return PROJECT_INVALID; + case 125: + return CONSUMER_INVALID; + case 109: + return IP_ADDRESS_BLOCKED; + case 110: + return REFERER_BLOCKED; + case 111: + return CLIENT_APP_BLOCKED; + case 122: + return API_TARGET_BLOCKED; + case 105: + return API_KEY_INVALID; + case 112: + return API_KEY_EXPIRED; + case 113: + return API_KEY_NOT_FOUND; + case 123: + return INVALID_CREDENTIAL; + case 300: + return NAMESPACE_LOOKUP_UNAVAILABLE; + case 301: + return SERVICE_STATUS_UNAVAILABLE; + case 302: + return BILLING_STATUS_UNAVAILABLE; + case 305: + return CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE; + 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 Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.servicecontrol.v1.CheckError.getDescriptor().getEnumTypes().get(0); + } + + private static final Code[] VALUES = values(); + + public static Code 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 Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.CheckError.Code) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * The error code.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * The error code.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.CheckError.Code result = + com.google.api.servicecontrol.v1.CheckError.Code.valueOf(code_); + return result == null ? com.google.api.servicecontrol.v1.CheckError.Code.UNRECOGNIZED : result; + } + + public static final int SUBJECT_FIELD_NUMBER = 4; + private volatile java.lang.Object subject_; + /** + * + * + *
+   * Subject to whom this error applies. See the specific code enum for more
+   * details on this field. For example:
+   * - "project:<project-id or project-number>"
+   * - "folder:<folder-id>"
+   * - "organization:<organization-id>"
+   * 
+ * + * string subject = 4; + * + * @return The subject. + */ + @java.lang.Override + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + 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(); + subject_ = s; + return s; + } + } + /** + * + * + *
+   * Subject to whom this error applies. See the specific code enum for more
+   * details on this field. For example:
+   * - "project:<project-id or project-number>"
+   * - "folder:<folder-id>"
+   * - "organization:<organization-id>"
+   * 
+ * + * string subject = 4; + * + * @return The bytes for subject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DETAIL_FIELD_NUMBER = 2; + private volatile java.lang.Object detail_; + /** + * + * + *
+   * Free-form text providing details on the error cause of the error.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } + } + /** + * + * + *
+   * Free-form text providing details on the error cause of the error.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private com.google.rpc.Status status_; + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + 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 (code_ + != com.google.api.servicecontrol.v1.CheckError.Code.ERROR_CODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, code_); + } + if (!getDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + } + if (status_ != null) { + output.writeMessage(3, getStatus()); + } + if (!getSubjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, subject_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.api.servicecontrol.v1.CheckError.Code.ERROR_CODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!getDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } + if (!getSubjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, subject_); + } + 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.api.servicecontrol.v1.CheckError)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.CheckError other = + (com.google.api.servicecontrol.v1.CheckError) obj; + + if (code_ != other.code_) return false; + if (!getSubject().equals(other.getSubject())) return false; + if (!getDetail().equals(other.getDetail())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.CheckError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckError 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.api.servicecontrol.v1.CheckError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckError 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.api.servicecontrol.v1.CheckError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckError 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.api.servicecontrol.v1.CheckError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckError 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.api.servicecontrol.v1.CheckError 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; + } + /** + * + * + *
+   * Defines the errors to be returned in
+   * [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors].
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.CheckError) + com.google.api.servicecontrol.v1.CheckErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.CheckErrorProto + .internal_static_google_api_servicecontrol_v1_CheckError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.CheckErrorProto + .internal_static_google_api_servicecontrol_v1_CheckError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckError.class, + com.google.api.servicecontrol.v1.CheckError.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.CheckError.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(); + code_ = 0; + + subject_ = ""; + + detail_ = ""; + + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.CheckErrorProto + .internal_static_google_api_servicecontrol_v1_CheckError_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.CheckError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError build() { + com.google.api.servicecontrol.v1.CheckError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError buildPartial() { + com.google.api.servicecontrol.v1.CheckError result = + new com.google.api.servicecontrol.v1.CheckError(this); + result.code_ = code_; + result.subject_ = subject_; + result.detail_ = detail_; + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.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.api.servicecontrol.v1.CheckError) { + return mergeFrom((com.google.api.servicecontrol.v1.CheckError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.CheckError other) { + if (other == com.google.api.servicecontrol.v1.CheckError.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getSubject().isEmpty()) { + subject_ = other.subject_; + onChanged(); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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.api.servicecontrol.v1.CheckError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.CheckError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * The error code.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * The error code.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The error code.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.CheckError.Code result = + com.google.api.servicecontrol.v1.CheckError.Code.valueOf(code_); + return result == null + ? com.google.api.servicecontrol.v1.CheckError.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The error code.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.api.servicecontrol.v1.CheckError.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The error code.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object subject_ = ""; + /** + * + * + *
+     * Subject to whom this error applies. See the specific code enum for more
+     * details on this field. For example:
+     * - "project:<project-id or project-number>"
+     * - "folder:<folder-id>"
+     * - "organization:<organization-id>"
+     * 
+ * + * string subject = 4; + * + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific code enum for more
+     * details on this field. For example:
+     * - "project:<project-id or project-number>"
+     * - "folder:<folder-id>"
+     * - "organization:<organization-id>"
+     * 
+ * + * string subject = 4; + * + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific code enum for more
+     * details on this field. For example:
+     * - "project:<project-id or project-number>"
+     * - "folder:<folder-id>"
+     * - "organization:<organization-id>"
+     * 
+ * + * string subject = 4; + * + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subject_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific code enum for more
+     * details on this field. For example:
+     * - "project:<project-id or project-number>"
+     * - "folder:<folder-id>"
+     * - "organization:<organization-id>"
+     * 
+ * + * string subject = 4; + * + * @return This builder for chaining. + */ + public Builder clearSubject() { + + subject_ = getDefaultInstance().getSubject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific code enum for more
+     * details on this field. For example:
+     * - "project:<project-id or project-number>"
+     * - "folder:<folder-id>"
+     * - "organization:<organization-id>"
+     * 
+ * + * string subject = 4; + * + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subject_ = value; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * + * + *
+     * Free-form text providing details on the error cause of the error.
+     * 
+ * + * string detail = 2; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Free-form text providing details on the error cause of the error.
+     * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Free-form text providing details on the error cause of the error.
+     * 
+ * + * string detail = 2; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + detail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Free-form text providing details on the error cause of the error.
+     * 
+ * + * string detail = 2; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + + detail_ = getDefaultInstance().getDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Free-form text providing details on the error cause of the error.
+     * 
+ * + * string detail = 2; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + detail_ = value; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+     * Contains public information about the check error. If available,
+     * `status.code` will be non zero and client can propagate it out as public
+     * error.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @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.api.servicecontrol.v1.CheckError) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.CheckError) + private static final com.google.api.servicecontrol.v1.CheckError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.CheckError(); + } + + public static com.google.api.servicecontrol.v1.CheckError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CheckError(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.api.servicecontrol.v1.CheckError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorOrBuilder.java new file mode 100644 index 00000000..5088ddae --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorOrBuilder.java @@ -0,0 +1,149 @@ +/* + * 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/api/servicecontrol/v1/check_error.proto + +package com.google.api.servicecontrol.v1; + +public interface CheckErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.CheckError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The error code.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * The error code.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckError.Code code = 1; + * + * @return The code. + */ + com.google.api.servicecontrol.v1.CheckError.Code getCode(); + + /** + * + * + *
+   * Subject to whom this error applies. See the specific code enum for more
+   * details on this field. For example:
+   * - "project:<project-id or project-number>"
+   * - "folder:<folder-id>"
+   * - "organization:<organization-id>"
+   * 
+ * + * string subject = 4; + * + * @return The subject. + */ + java.lang.String getSubject(); + /** + * + * + *
+   * Subject to whom this error applies. See the specific code enum for more
+   * details on this field. For example:
+   * - "project:<project-id or project-number>"
+   * - "folder:<folder-id>"
+   * - "organization:<organization-id>"
+   * 
+ * + * string subject = 4; + * + * @return The bytes for subject. + */ + com.google.protobuf.ByteString getSubjectBytes(); + + /** + * + * + *
+   * Free-form text providing details on the error cause of the error.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + java.lang.String getDetail(); + /** + * + * + *
+   * Free-form text providing details on the error cause of the error.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); + + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+   * Contains public information about the check error. If available,
+   * `status.code` will be non zero and client can propagate it out as public
+   * error.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorProto.java new file mode 100644 index 00000000..9ae77c40 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckErrorProto.java @@ -0,0 +1,88 @@ +/* + * 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/api/servicecontrol/v1/check_error.proto + +package com.google.api.servicecontrol.v1; + +public final class CheckErrorProto { + private CheckErrorProto() {} + + 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_api_servicecontrol_v1_CheckError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_CheckError_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/api/servicecontrol/v1/check_err" + + "or.proto\022\034google.api.servicecontrol.v1\032\027" + + "google/rpc/status.proto\"\256\005\n\nCheckError\022;" + + "\n\004code\030\001 \001(\0162-.google.api.servicecontrol" + + ".v1.CheckError.Code\022\017\n\007subject\030\004 \001(\t\022\016\n\006" + + "detail\030\002 \001(\t\022\"\n\006status\030\003 \001(\0132\022.google.rp" + + "c.Status\"\235\004\n\004Code\022\032\n\026ERROR_CODE_UNSPECIF" + + "IED\020\000\022\r\n\tNOT_FOUND\020\005\022\025\n\021PERMISSION_DENIE" + + "D\020\007\022\026\n\022RESOURCE_EXHAUSTED\020\010\022\031\n\025SERVICE_N" + + "OT_ACTIVATED\020h\022\024\n\020BILLING_DISABLED\020k\022\023\n\017" + + "PROJECT_DELETED\020l\022\023\n\017PROJECT_INVALID\020r\022\024" + + "\n\020CONSUMER_INVALID\020}\022\026\n\022IP_ADDRESS_BLOCK" + + "ED\020m\022\023\n\017REFERER_BLOCKED\020n\022\026\n\022CLIENT_APP_" + + "BLOCKED\020o\022\026\n\022API_TARGET_BLOCKED\020z\022\023\n\017API" + + "_KEY_INVALID\020i\022\023\n\017API_KEY_EXPIRED\020p\022\025\n\021A" + + "PI_KEY_NOT_FOUND\020q\022\026\n\022INVALID_CREDENTIAL" + + "\020{\022!\n\034NAMESPACE_LOOKUP_UNAVAILABLE\020\254\002\022\037\n" + + "\032SERVICE_STATUS_UNAVAILABLE\020\255\002\022\037\n\032BILLIN" + + "G_STATUS_UNAVAILABLE\020\256\002\022/\n*CLOUD_RESOURC" + + "E_MANAGER_BACKEND_UNAVAILABLE\020\261\002B\352\001\n com" + + ".google.api.servicecontrol.v1B\017CheckErro" + + "rProtoP\001ZJgoogle.golang.org/genproto/goo" + + "gleapis/api/servicecontrol/v1;servicecon" + + "trol\370\001\001\252\002\036Google.Cloud.ServiceControl.V1" + + "\312\002\036Google\\Cloud\\ServiceControl\\V1\352\002!Goog" + + "le::Cloud::ServiceControl::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_CheckError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_CheckError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_CheckError_descriptor, + new java.lang.String[] { + "Code", "Subject", "Detail", "Status", + }); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequest.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequest.java new file mode 100644 index 00000000..8e4d0805 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequest.java @@ -0,0 +1,1140 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Request message for the Check method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckRequest} + */ +public final class CheckRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.CheckRequest) + CheckRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CheckRequest.newBuilder() to construct. + private CheckRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CheckRequest() { + serviceName_ = ""; + serviceConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CheckRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CheckRequest( + 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(); + + serviceName_ = s; + break; + } + case 18: + { + com.google.api.servicecontrol.v1.Operation.Builder subBuilder = null; + if (operation_ != null) { + subBuilder = operation_.toBuilder(); + } + operation_ = + input.readMessage( + com.google.api.servicecontrol.v1.Operation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(operation_); + operation_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = 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.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckRequest.class, + com.google.api.servicecontrol.v1.CheckRequest.Builder.class); + } + + public static final int SERVICE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object serviceName_; + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + @java.lang.Override + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + 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(); + serviceName_ = s; + return s; + } + } + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_FIELD_NUMBER = 2; + private com.google.api.servicecontrol.v1.Operation operation_; + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return operation_ != null; + } + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return The operation. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation getOperation() { + return operation_ == null + ? com.google.api.servicecontrol.v1.Operation.getDefaultInstance() + : operation_; + } + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.OperationOrBuilder getOperationOrBuilder() { + return getOperation(); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = 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 (!getServiceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceName_); + } + if (operation_ != null) { + output.writeMessage(2, getOperation()); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceConfigId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceName_); + } + if (operation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOperation()); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceConfigId_); + } + 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.api.servicecontrol.v1.CheckRequest)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.CheckRequest other = + (com.google.api.servicecontrol.v1.CheckRequest) obj; + + if (!getServiceName().equals(other.getServiceName())) return false; + if (hasOperation() != other.hasOperation()) return false; + if (hasOperation()) { + if (!getOperation().equals(other.getOperation())) return false; + } + if (!getServiceConfigId().equals(other.getServiceConfigId())) 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) + SERVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getServiceName().hashCode(); + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.CheckRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckRequest 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.api.servicecontrol.v1.CheckRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckRequest 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.api.servicecontrol.v1.CheckRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckRequest 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.api.servicecontrol.v1.CheckRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckRequest 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.api.servicecontrol.v1.CheckRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the Check method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.CheckRequest) + com.google.api.servicecontrol.v1.CheckRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckRequest.class, + com.google.api.servicecontrol.v1.CheckRequest.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.CheckRequest.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(); + serviceName_ = ""; + + if (operationBuilder_ == null) { + operation_ = null; + } else { + operation_ = null; + operationBuilder_ = null; + } + serviceConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckRequest_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckRequest getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.CheckRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckRequest build() { + com.google.api.servicecontrol.v1.CheckRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckRequest buildPartial() { + com.google.api.servicecontrol.v1.CheckRequest result = + new com.google.api.servicecontrol.v1.CheckRequest(this); + result.serviceName_ = serviceName_; + if (operationBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = operationBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + 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.api.servicecontrol.v1.CheckRequest) { + return mergeFrom((com.google.api.servicecontrol.v1.CheckRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.CheckRequest other) { + if (other == com.google.api.servicecontrol.v1.CheckRequest.getDefaultInstance()) return this; + if (!other.getServiceName().isEmpty()) { + serviceName_ = other.serviceName_; + onChanged(); + } + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + 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.api.servicecontrol.v1.CheckRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.CheckRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object serviceName_ = ""; + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearServiceName() { + + serviceName_ = getDefaultInstance().getServiceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The bytes for serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceName_ = value; + onChanged(); + return this; + } + + private com.google.api.servicecontrol.v1.Operation operation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder> + operationBuilder_; + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + public boolean hasOperation() { + return operationBuilder_ != null || operation_ != null; + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return The operation. + */ + public com.google.api.servicecontrol.v1.Operation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null + ? com.google.api.servicecontrol.v1.Operation.getDefaultInstance() + : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public Builder setOperation(com.google.api.servicecontrol.v1.Operation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + operationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public Builder setOperation( + com.google.api.servicecontrol.v1.Operation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public Builder mergeOperation(com.google.api.servicecontrol.v1.Operation value) { + if (operationBuilder_ == null) { + if (operation_ != null) { + operation_ = + com.google.api.servicecontrol.v1.Operation.newBuilder(operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + operationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public Builder clearOperation() { + if (operationBuilder_ == null) { + operation_ = null; + onChanged(); + } else { + operation_ = null; + operationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public com.google.api.servicecontrol.v1.Operation.Builder getOperationBuilder() { + + onChanged(); + return getOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + public com.google.api.servicecontrol.v1.OperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null + ? com.google.api.servicecontrol.v1.Operation.getDefaultInstance() + : operation_; + } + } + /** + * + * + *
+     * The operation to be checked.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder> + getOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder>( + getOperation(), getParentForChildren(), isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service configuration should be used to process
+     * the request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 4; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = 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.api.servicecontrol.v1.CheckRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.CheckRequest) + private static final com.google.api.servicecontrol.v1.CheckRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.CheckRequest(); + } + + public static com.google.api.servicecontrol.v1.CheckRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CheckRequest(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.api.servicecontrol.v1.CheckRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequestOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequestOrBuilder.java new file mode 100644 index 00000000..35171796 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckRequestOrBuilder.java @@ -0,0 +1,124 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface CheckRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.CheckRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + java.lang.String getServiceName(); + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + com.google.protobuf.ByteString getServiceNameBytes(); + + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + * + * @return The operation. + */ + com.google.api.servicecontrol.v1.Operation getOperation(); + /** + * + * + *
+   * The operation to be checked.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation operation = 2; + */ + com.google.api.servicecontrol.v1.OperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * Specifies which version of service configuration should be used to process
+   * the request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 4; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponse.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponse.java new file mode 100644 index 00000000..3ca704e4 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponse.java @@ -0,0 +1,4077 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Response message for the Check method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse} + */ +public final class CheckResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.CheckResponse) + CheckResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CheckResponse.newBuilder() to construct. + private CheckResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CheckResponse() { + operationId_ = ""; + checkErrors_ = java.util.Collections.emptyList(); + serviceConfigId_ = ""; + serviceRolloutId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CheckResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CheckResponse( + 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(); + + operationId_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + checkErrors_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + checkErrors_.add( + input.readMessage( + com.google.api.servicecontrol.v1.CheckError.parser(), extensionRegistry)); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = s; + break; + } + case 50: + { + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder subBuilder = null; + if (checkInfo_ != null) { + subBuilder = checkInfo_.toBuilder(); + } + checkInfo_ = + input.readMessage( + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(checkInfo_); + checkInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceRolloutId_ = 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)) { + checkErrors_ = java.util.Collections.unmodifiableList(checkErrors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.class, + com.google.api.servicecontrol.v1.CheckResponse.Builder.class); + } + + public interface CheckInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.CheckResponse.CheckInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @return A list containing the unusedArguments. + */ + java.util.List getUnusedArgumentsList(); + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @return The count of unusedArguments. + */ + int getUnusedArgumentsCount(); + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the element to return. + * @return The unusedArguments at the given index. + */ + java.lang.String getUnusedArguments(int index); + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the value to return. + * @return The bytes of the unusedArguments at the given index. + */ + com.google.protobuf.ByteString getUnusedArgumentsBytes(int index); + + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return Whether the consumerInfo field is set. + */ + boolean hasConsumerInfo(); + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return The consumerInfo. + */ + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo getConsumerInfo(); + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder getConsumerInfoOrBuilder(); + } + /** + * + * + *
+   * Contains additional information about the check operation.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse.CheckInfo} + */ + public static final class CheckInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.CheckResponse.CheckInfo) + CheckInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use CheckInfo.newBuilder() to construct. + private CheckInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CheckInfo() { + unusedArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CheckInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CheckInfo( + 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)) { + unusedArguments_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + unusedArguments_.add(s); + break; + } + case 18: + { + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder subBuilder = + null; + if (consumerInfo_ != null) { + subBuilder = consumerInfo_.toBuilder(); + } + consumerInfo_ = + input.readMessage( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(consumerInfo_); + consumerInfo_ = 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)) { + unusedArguments_ = unusedArguments_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.class, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder.class); + } + + public static final int UNUSED_ARGUMENTS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList unusedArguments_; + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @return A list containing the unusedArguments. + */ + public com.google.protobuf.ProtocolStringList getUnusedArgumentsList() { + return unusedArguments_; + } + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @return The count of unusedArguments. + */ + public int getUnusedArgumentsCount() { + return unusedArguments_.size(); + } + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the element to return. + * @return The unusedArguments at the given index. + */ + public java.lang.String getUnusedArguments(int index) { + return unusedArguments_.get(index); + } + /** + * + * + *
+     * A list of fields and label keys that are ignored by the server.
+     * The client doesn't need to send them for following requests to improve
+     * performance and allow better aggregation.
+     * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the value to return. + * @return The bytes of the unusedArguments at the given index. + */ + public com.google.protobuf.ByteString getUnusedArgumentsBytes(int index) { + return unusedArguments_.getByteString(index); + } + + public static final int CONSUMER_INFO_FIELD_NUMBER = 2; + private com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumerInfo_; + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return Whether the consumerInfo field is set. + */ + @java.lang.Override + public boolean hasConsumerInfo() { + return consumerInfo_ != null; + } + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return The consumerInfo. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo getConsumerInfo() { + return consumerInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDefaultInstance() + : consumerInfo_; + } + /** + * + * + *
+     * Consumer info of this check.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder + getConsumerInfoOrBuilder() { + return getConsumerInfo(); + } + + 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 < unusedArguments_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, unusedArguments_.getRaw(i)); + } + if (consumerInfo_ != null) { + output.writeMessage(2, getConsumerInfo()); + } + 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 < unusedArguments_.size(); i++) { + dataSize += computeStringSizeNoTag(unusedArguments_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnusedArgumentsList().size(); + } + if (consumerInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConsumerInfo()); + } + 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.api.servicecontrol.v1.CheckResponse.CheckInfo)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo other = + (com.google.api.servicecontrol.v1.CheckResponse.CheckInfo) obj; + + if (!getUnusedArgumentsList().equals(other.getUnusedArgumentsList())) return false; + if (hasConsumerInfo() != other.hasConsumerInfo()) return false; + if (hasConsumerInfo()) { + if (!getConsumerInfo().equals(other.getConsumerInfo())) 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 (getUnusedArgumentsCount() > 0) { + hash = (37 * hash) + UNUSED_ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getUnusedArgumentsList().hashCode(); + } + if (hasConsumerInfo()) { + hash = (37 * hash) + CONSUMER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getConsumerInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo 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.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo 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.api.servicecontrol.v1.CheckResponse.CheckInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo 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.api.servicecontrol.v1.CheckResponse.CheckInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo 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.api.servicecontrol.v1.CheckResponse.CheckInfo 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; + } + /** + * + * + *
+     * Contains additional information about the check operation.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse.CheckInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.CheckResponse.CheckInfo) + com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.class, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.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(); + unusedArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (consumerInfoBuilder_ == null) { + consumerInfo_ = null; + } else { + consumerInfo_ = null; + consumerInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo build() { + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo buildPartial() { + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo result = + new com.google.api.servicecontrol.v1.CheckResponse.CheckInfo(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + unusedArguments_ = unusedArguments_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.unusedArguments_ = unusedArguments_; + if (consumerInfoBuilder_ == null) { + result.consumerInfo_ = consumerInfo_; + } else { + result.consumerInfo_ = consumerInfoBuilder_.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.api.servicecontrol.v1.CheckResponse.CheckInfo) { + return mergeFrom((com.google.api.servicecontrol.v1.CheckResponse.CheckInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.CheckResponse.CheckInfo other) { + if (other == com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.getDefaultInstance()) + return this; + if (!other.unusedArguments_.isEmpty()) { + if (unusedArguments_.isEmpty()) { + unusedArguments_ = other.unusedArguments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUnusedArgumentsIsMutable(); + unusedArguments_.addAll(other.unusedArguments_); + } + onChanged(); + } + if (other.hasConsumerInfo()) { + mergeConsumerInfo(other.getConsumerInfo()); + } + 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.api.servicecontrol.v1.CheckResponse.CheckInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.CheckResponse.CheckInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList unusedArguments_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnusedArgumentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + unusedArguments_ = new com.google.protobuf.LazyStringArrayList(unusedArguments_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @return A list containing the unusedArguments. + */ + public com.google.protobuf.ProtocolStringList getUnusedArgumentsList() { + return unusedArguments_.getUnmodifiableView(); + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @return The count of unusedArguments. + */ + public int getUnusedArgumentsCount() { + return unusedArguments_.size(); + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the element to return. + * @return The unusedArguments at the given index. + */ + public java.lang.String getUnusedArguments(int index) { + return unusedArguments_.get(index); + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index of the value to return. + * @return The bytes of the unusedArguments at the given index. + */ + public com.google.protobuf.ByteString getUnusedArgumentsBytes(int index) { + return unusedArguments_.getByteString(index); + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param index The index to set the value at. + * @param value The unusedArguments to set. + * @return This builder for chaining. + */ + public Builder setUnusedArguments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnusedArgumentsIsMutable(); + unusedArguments_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param value The unusedArguments to add. + * @return This builder for chaining. + */ + public Builder addUnusedArguments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnusedArgumentsIsMutable(); + unusedArguments_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param values The unusedArguments to add. + * @return This builder for chaining. + */ + public Builder addAllUnusedArguments(java.lang.Iterable values) { + ensureUnusedArgumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unusedArguments_); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @return This builder for chaining. + */ + public Builder clearUnusedArguments() { + unusedArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of fields and label keys that are ignored by the server.
+       * The client doesn't need to send them for following requests to improve
+       * performance and allow better aggregation.
+       * 
+ * + * repeated string unused_arguments = 1; + * + * @param value The bytes of the unusedArguments to add. + * @return This builder for chaining. + */ + public Builder addUnusedArgumentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnusedArgumentsIsMutable(); + unusedArguments_.add(value); + onChanged(); + return this; + } + + private com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumerInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder> + consumerInfoBuilder_; + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return Whether the consumerInfo field is set. + */ + public boolean hasConsumerInfo() { + return consumerInfoBuilder_ != null || consumerInfo_ != null; + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + * + * @return The consumerInfo. + */ + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo getConsumerInfo() { + if (consumerInfoBuilder_ == null) { + return consumerInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDefaultInstance() + : consumerInfo_; + } else { + return consumerInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public Builder setConsumerInfo( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo value) { + if (consumerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consumerInfo_ = value; + onChanged(); + } else { + consumerInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public Builder setConsumerInfo( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder builderForValue) { + if (consumerInfoBuilder_ == null) { + consumerInfo_ = builderForValue.build(); + onChanged(); + } else { + consumerInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public Builder mergeConsumerInfo( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo value) { + if (consumerInfoBuilder_ == null) { + if (consumerInfo_ != null) { + consumerInfo_ = + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.newBuilder( + consumerInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + consumerInfo_ = value; + } + onChanged(); + } else { + consumerInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public Builder clearConsumerInfo() { + if (consumerInfoBuilder_ == null) { + consumerInfo_ = null; + onChanged(); + } else { + consumerInfo_ = null; + consumerInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder + getConsumerInfoBuilder() { + + onChanged(); + return getConsumerInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder + getConsumerInfoOrBuilder() { + if (consumerInfoBuilder_ != null) { + return consumerInfoBuilder_.getMessageOrBuilder(); + } else { + return consumerInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDefaultInstance() + : consumerInfo_; + } + } + /** + * + * + *
+       * Consumer info of this check.
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo consumer_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder> + getConsumerInfoFieldBuilder() { + if (consumerInfoBuilder_ == null) { + consumerInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder>( + getConsumerInfo(), getParentForChildren(), isClean()); + consumerInfo_ = null; + } + return consumerInfoBuilder_; + } + + @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.api.servicecontrol.v1.CheckResponse.CheckInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.CheckResponse.CheckInfo) + private static final com.google.api.servicecontrol.v1.CheckResponse.CheckInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.CheckResponse.CheckInfo(); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.CheckInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CheckInfo(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.api.servicecontrol.v1.CheckResponse.CheckInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConsumerInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Google cloud project number, e.g. 1234567890. A value of 0 indicates
+     * no project number is found.
+     * NOTE: This field is deprecated after we support flexible consumer
+     * id. New code should not depend on this field anymore.
+     * 
+ * + * int64 project_number = 1; + * + * @return The projectNumber. + */ + long getProjectNumber(); + + /** + * + * + *
+     * The type of the consumer which should have been defined in
+     * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+     * The type of the consumer which should have been defined in
+     * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * @return The type. + */ + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType getType(); + + /** + * + * + *
+     * The consumer identity number, can be Google cloud project number, folder
+     * number or organization number e.g. 1234567890. A value of 0 indicates no
+     * consumer number is found.
+     * 
+ * + * int64 consumer_number = 3; + * + * @return The consumerNumber. + */ + long getConsumerNumber(); + } + /** + * + * + *
+   * `ConsumerInfo` provides information about the consumer.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse.ConsumerInfo} + */ + public static final class ConsumerInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + ConsumerInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConsumerInfo.newBuilder() to construct. + private ConsumerInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConsumerInfo() { + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConsumerInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConsumerInfo( + 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: + { + projectNumber_ = input.readInt64(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 24: + { + consumerNumber_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.class, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder.class); + } + + /** + * + * + *
+     * The type of the consumer as defined in
+     * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+     * 
+ * + * Protobuf enum {@code google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType} + */ + public enum ConsumerType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * This is never used.
+       * 
+ * + * CONSUMER_TYPE_UNSPECIFIED = 0; + */ + CONSUMER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * The consumer is a Google Cloud Project.
+       * 
+ * + * PROJECT = 1; + */ + PROJECT(1), + /** + * + * + *
+       * The consumer is a Google Cloud Folder.
+       * 
+ * + * FOLDER = 2; + */ + FOLDER(2), + /** + * + * + *
+       * The consumer is a Google Cloud Organization.
+       * 
+ * + * ORGANIZATION = 3; + */ + ORGANIZATION(3), + /** + * + * + *
+       * Service-specific resource container which is defined by the service
+       * producer to offer their users the ability to manage service control
+       * functionalities at a finer level of granularity than the PROJECT.
+       * 
+ * + * SERVICE_SPECIFIC = 4; + */ + SERVICE_SPECIFIC(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * This is never used.
+       * 
+ * + * CONSUMER_TYPE_UNSPECIFIED = 0; + */ + public static final int CONSUMER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The consumer is a Google Cloud Project.
+       * 
+ * + * PROJECT = 1; + */ + public static final int PROJECT_VALUE = 1; + /** + * + * + *
+       * The consumer is a Google Cloud Folder.
+       * 
+ * + * FOLDER = 2; + */ + public static final int FOLDER_VALUE = 2; + /** + * + * + *
+       * The consumer is a Google Cloud Organization.
+       * 
+ * + * ORGANIZATION = 3; + */ + public static final int ORGANIZATION_VALUE = 3; + /** + * + * + *
+       * Service-specific resource container which is defined by the service
+       * producer to offer their users the ability to manage service control
+       * functionalities at a finer level of granularity than the PROJECT.
+       * 
+ * + * SERVICE_SPECIFIC = 4; + */ + public static final int SERVICE_SPECIFIC_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConsumerType 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 ConsumerType forNumber(int value) { + switch (value) { + case 0: + return CONSUMER_TYPE_UNSPECIFIED; + case 1: + return PROJECT; + case 2: + return FOLDER; + case 3: + return ORGANIZATION; + case 4: + return SERVICE_SPECIFIC; + 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 ConsumerType findValueByNumber(int number) { + return ConsumerType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ConsumerType[] VALUES = values(); + + public static ConsumerType 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 ConsumerType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType) + } + + public static final int PROJECT_NUMBER_FIELD_NUMBER = 1; + private long projectNumber_; + /** + * + * + *
+     * The Google cloud project number, e.g. 1234567890. A value of 0 indicates
+     * no project number is found.
+     * NOTE: This field is deprecated after we support flexible consumer
+     * id. New code should not depend on this field anymore.
+     * 
+ * + * int64 project_number = 1; + * + * @return The projectNumber. + */ + @java.lang.Override + public long getProjectNumber() { + return projectNumber_; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * + * + *
+     * The type of the consumer which should have been defined in
+     * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The type of the consumer which should have been defined in
+     * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType getType() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType result = + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType.valueOf(type_); + return result == null + ? com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType.UNRECOGNIZED + : result; + } + + public static final int CONSUMER_NUMBER_FIELD_NUMBER = 3; + private long consumerNumber_; + /** + * + * + *
+     * The consumer identity number, can be Google cloud project number, folder
+     * number or organization number e.g. 1234567890. A value of 0 indicates no
+     * consumer number is found.
+     * 
+ * + * int64 consumer_number = 3; + * + * @return The consumerNumber. + */ + @java.lang.Override + public long getConsumerNumber() { + return consumerNumber_; + } + + 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 (projectNumber_ != 0L) { + output.writeInt64(1, projectNumber_); + } + if (type_ + != com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType + .CONSUMER_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, type_); + } + if (consumerNumber_ != 0L) { + output.writeInt64(3, consumerNumber_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (projectNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, projectNumber_); + } + if (type_ + != com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType + .CONSUMER_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (consumerNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, consumerNumber_); + } + 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo other = + (com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) obj; + + if (getProjectNumber() != other.getProjectNumber()) return false; + if (type_ != other.type_) return false; + if (getConsumerNumber() != other.getConsumerNumber()) 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) + PROJECT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getProjectNumber()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + CONSUMER_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getConsumerNumber()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo 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; + } + /** + * + * + *
+     * `ConsumerInfo` provides information about the consumer.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse.ConsumerInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.class, + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.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(); + projectNumber_ = 0L; + + type_ = 0; + + consumerNumber_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo + getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo build() { + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo buildPartial() { + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo result = + new com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo(this); + result.projectNumber_ = projectNumber_; + result.type_ = type_; + result.consumerNumber_ = consumerNumber_; + 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo) { + return mergeFrom((com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo other) { + if (other + == com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.getDefaultInstance()) + return this; + if (other.getProjectNumber() != 0L) { + setProjectNumber(other.getProjectNumber()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getConsumerNumber() != 0L) { + setConsumerNumber(other.getConsumerNumber()); + } + 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.api.servicecontrol.v1.CheckResponse.ConsumerInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long projectNumber_; + /** + * + * + *
+       * The Google cloud project number, e.g. 1234567890. A value of 0 indicates
+       * no project number is found.
+       * NOTE: This field is deprecated after we support flexible consumer
+       * id. New code should not depend on this field anymore.
+       * 
+ * + * int64 project_number = 1; + * + * @return The projectNumber. + */ + @java.lang.Override + public long getProjectNumber() { + return projectNumber_; + } + /** + * + * + *
+       * The Google cloud project number, e.g. 1234567890. A value of 0 indicates
+       * no project number is found.
+       * NOTE: This field is deprecated after we support flexible consumer
+       * id. New code should not depend on this field anymore.
+       * 
+ * + * int64 project_number = 1; + * + * @param value The projectNumber to set. + * @return This builder for chaining. + */ + public Builder setProjectNumber(long value) { + + projectNumber_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The Google cloud project number, e.g. 1234567890. A value of 0 indicates
+       * no project number is found.
+       * NOTE: This field is deprecated after we support flexible consumer
+       * id. New code should not depend on this field anymore.
+       * 
+ * + * int64 project_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectNumber() { + + projectNumber_ = 0L; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+       * The type of the consumer which should have been defined in
+       * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * The type of the consumer which should have been defined in
+       * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the consumer which should have been defined in
+       * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType getType() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType result = + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType.valueOf(type_); + return result == null + ? com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The type of the consumer which should have been defined in
+       * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the consumer which should have been defined in
+       * [Google Resource Manager](https://cloud.google.com/resource-manager/).
+       * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType type = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private long consumerNumber_; + /** + * + * + *
+       * The consumer identity number, can be Google cloud project number, folder
+       * number or organization number e.g. 1234567890. A value of 0 indicates no
+       * consumer number is found.
+       * 
+ * + * int64 consumer_number = 3; + * + * @return The consumerNumber. + */ + @java.lang.Override + public long getConsumerNumber() { + return consumerNumber_; + } + /** + * + * + *
+       * The consumer identity number, can be Google cloud project number, folder
+       * number or organization number e.g. 1234567890. A value of 0 indicates no
+       * consumer number is found.
+       * 
+ * + * int64 consumer_number = 3; + * + * @param value The consumerNumber to set. + * @return This builder for chaining. + */ + public Builder setConsumerNumber(long value) { + + consumerNumber_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The consumer identity number, can be Google cloud project number, folder
+       * number or organization number e.g. 1234567890. A value of 0 indicates no
+       * consumer number is found.
+       * 
+ * + * int64 consumer_number = 3; + * + * @return This builder for chaining. + */ + public Builder clearConsumerNumber() { + + consumerNumber_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.CheckResponse.ConsumerInfo) + private static final com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo(); + } + + public static com.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConsumerInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConsumerInfo(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.api.servicecontrol.v1.CheckResponse.ConsumerInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object operationId_; + /** + * + * + *
+   * The same operation_id value used in the
+   * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+   * and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + 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(); + operationId_ = s; + return s; + } + } + /** + * + * + *
+   * The same operation_id value used in the
+   * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+   * and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHECK_ERRORS_FIELD_NUMBER = 2; + private java.util.List checkErrors_; + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + @java.lang.Override + public java.util.List getCheckErrorsList() { + return checkErrors_; + } + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + @java.lang.Override + public java.util.List + getCheckErrorsOrBuilderList() { + return checkErrors_; + } + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + @java.lang.Override + public int getCheckErrorsCount() { + return checkErrors_.size(); + } + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckError getCheckErrors(int index) { + return checkErrors_.get(index); + } + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckErrorOrBuilder getCheckErrorsOrBuilder(int index) { + return checkErrors_.get(index); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 5; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 5; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ROLLOUT_ID_FIELD_NUMBER = 11; + private volatile java.lang.Object serviceRolloutId_; + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 11; + * + * @return The serviceRolloutId. + */ + @java.lang.Override + public java.lang.String getServiceRolloutId() { + java.lang.Object ref = serviceRolloutId_; + 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(); + serviceRolloutId_ = s; + return s; + } + } + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 11; + * + * @return The bytes for serviceRolloutId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceRolloutIdBytes() { + java.lang.Object ref = serviceRolloutId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRolloutId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHECK_INFO_FIELD_NUMBER = 6; + private com.google.api.servicecontrol.v1.CheckResponse.CheckInfo checkInfo_; + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return Whether the checkInfo field is set. + */ + @java.lang.Override + public boolean hasCheckInfo() { + return checkInfo_ != null; + } + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return The checkInfo. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo getCheckInfo() { + return checkInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.getDefaultInstance() + : checkInfo_; + } + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder getCheckInfoOrBuilder() { + return getCheckInfo(); + } + + 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 (!getOperationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationId_); + } + for (int i = 0; i < checkErrors_.size(); i++) { + output.writeMessage(2, checkErrors_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceConfigId_); + } + if (checkInfo_ != null) { + output.writeMessage(6, getCheckInfo()); + } + if (!getServiceRolloutIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, serviceRolloutId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationId_); + } + for (int i = 0; i < checkErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, checkErrors_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceConfigId_); + } + if (checkInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCheckInfo()); + } + if (!getServiceRolloutIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, serviceRolloutId_); + } + 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.api.servicecontrol.v1.CheckResponse)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.CheckResponse other = + (com.google.api.servicecontrol.v1.CheckResponse) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getCheckErrorsList().equals(other.getCheckErrorsList())) return false; + if (!getServiceConfigId().equals(other.getServiceConfigId())) return false; + if (!getServiceRolloutId().equals(other.getServiceRolloutId())) return false; + if (hasCheckInfo() != other.hasCheckInfo()) return false; + if (hasCheckInfo()) { + if (!getCheckInfo().equals(other.getCheckInfo())) 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) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + if (getCheckErrorsCount() > 0) { + hash = (37 * hash) + CHECK_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getCheckErrorsList().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (37 * hash) + SERVICE_ROLLOUT_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceRolloutId().hashCode(); + if (hasCheckInfo()) { + hash = (37 * hash) + CHECK_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCheckInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.CheckResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse 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.api.servicecontrol.v1.CheckResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.CheckResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.CheckResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse 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.api.servicecontrol.v1.CheckResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse 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.api.servicecontrol.v1.CheckResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.CheckResponse 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.api.servicecontrol.v1.CheckResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the Check method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.CheckResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.CheckResponse) + com.google.api.servicecontrol.v1.CheckResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.CheckResponse.class, + com.google.api.servicecontrol.v1.CheckResponse.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.CheckResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCheckErrorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + operationId_ = ""; + + if (checkErrorsBuilder_ == null) { + checkErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + checkErrorsBuilder_.clear(); + } + serviceConfigId_ = ""; + + serviceRolloutId_ = ""; + + if (checkInfoBuilder_ == null) { + checkInfo_ = null; + } else { + checkInfo_ = null; + checkInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.CheckResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse build() { + com.google.api.servicecontrol.v1.CheckResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.CheckResponse buildPartial() { + com.google.api.servicecontrol.v1.CheckResponse result = + new com.google.api.servicecontrol.v1.CheckResponse(this); + int from_bitField0_ = bitField0_; + result.operationId_ = operationId_; + if (checkErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + checkErrors_ = java.util.Collections.unmodifiableList(checkErrors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.checkErrors_ = checkErrors_; + } else { + result.checkErrors_ = checkErrorsBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + result.serviceRolloutId_ = serviceRolloutId_; + if (checkInfoBuilder_ == null) { + result.checkInfo_ = checkInfo_; + } else { + result.checkInfo_ = checkInfoBuilder_.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.api.servicecontrol.v1.CheckResponse) { + return mergeFrom((com.google.api.servicecontrol.v1.CheckResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.CheckResponse other) { + if (other == com.google.api.servicecontrol.v1.CheckResponse.getDefaultInstance()) return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + onChanged(); + } + if (checkErrorsBuilder_ == null) { + if (!other.checkErrors_.isEmpty()) { + if (checkErrors_.isEmpty()) { + checkErrors_ = other.checkErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCheckErrorsIsMutable(); + checkErrors_.addAll(other.checkErrors_); + } + onChanged(); + } + } else { + if (!other.checkErrors_.isEmpty()) { + if (checkErrorsBuilder_.isEmpty()) { + checkErrorsBuilder_.dispose(); + checkErrorsBuilder_ = null; + checkErrors_ = other.checkErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + checkErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCheckErrorsFieldBuilder() + : null; + } else { + checkErrorsBuilder_.addAllMessages(other.checkErrors_); + } + } + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + onChanged(); + } + if (!other.getServiceRolloutId().isEmpty()) { + serviceRolloutId_ = other.serviceRolloutId_; + onChanged(); + } + if (other.hasCheckInfo()) { + mergeCheckInfo(other.getCheckInfo()); + } + 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.api.servicecontrol.v1.CheckResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.CheckResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object operationId_ = ""; + /** + * + * + *
+     * The same operation_id value used in the
+     * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+     * and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The same operation_id value used in the
+     * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+     * and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The same operation_id value used in the
+     * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+     * and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The same operation_id value used in the
+     * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+     * and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + + operationId_ = getDefaultInstance().getOperationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The same operation_id value used in the
+     * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+     * and diagnostics purposes.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationId_ = value; + onChanged(); + return this; + } + + private java.util.List checkErrors_ = + java.util.Collections.emptyList(); + + private void ensureCheckErrorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + checkErrors_ = + new java.util.ArrayList(checkErrors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckError, + com.google.api.servicecontrol.v1.CheckError.Builder, + com.google.api.servicecontrol.v1.CheckErrorOrBuilder> + checkErrorsBuilder_; + + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public java.util.List getCheckErrorsList() { + if (checkErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(checkErrors_); + } else { + return checkErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public int getCheckErrorsCount() { + if (checkErrorsBuilder_ == null) { + return checkErrors_.size(); + } else { + return checkErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public com.google.api.servicecontrol.v1.CheckError getCheckErrors(int index) { + if (checkErrorsBuilder_ == null) { + return checkErrors_.get(index); + } else { + return checkErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder setCheckErrors(int index, com.google.api.servicecontrol.v1.CheckError value) { + if (checkErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCheckErrorsIsMutable(); + checkErrors_.set(index, value); + onChanged(); + } else { + checkErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder setCheckErrors( + int index, com.google.api.servicecontrol.v1.CheckError.Builder builderForValue) { + if (checkErrorsBuilder_ == null) { + ensureCheckErrorsIsMutable(); + checkErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + checkErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder addCheckErrors(com.google.api.servicecontrol.v1.CheckError value) { + if (checkErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCheckErrorsIsMutable(); + checkErrors_.add(value); + onChanged(); + } else { + checkErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder addCheckErrors(int index, com.google.api.servicecontrol.v1.CheckError value) { + if (checkErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCheckErrorsIsMutable(); + checkErrors_.add(index, value); + onChanged(); + } else { + checkErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder addCheckErrors( + com.google.api.servicecontrol.v1.CheckError.Builder builderForValue) { + if (checkErrorsBuilder_ == null) { + ensureCheckErrorsIsMutable(); + checkErrors_.add(builderForValue.build()); + onChanged(); + } else { + checkErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder addCheckErrors( + int index, com.google.api.servicecontrol.v1.CheckError.Builder builderForValue) { + if (checkErrorsBuilder_ == null) { + ensureCheckErrorsIsMutable(); + checkErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + checkErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder addAllCheckErrors( + java.lang.Iterable values) { + if (checkErrorsBuilder_ == null) { + ensureCheckErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, checkErrors_); + onChanged(); + } else { + checkErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder clearCheckErrors() { + if (checkErrorsBuilder_ == null) { + checkErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + checkErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public Builder removeCheckErrors(int index) { + if (checkErrorsBuilder_ == null) { + ensureCheckErrorsIsMutable(); + checkErrors_.remove(index); + onChanged(); + } else { + checkErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public com.google.api.servicecontrol.v1.CheckError.Builder getCheckErrorsBuilder(int index) { + return getCheckErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public com.google.api.servicecontrol.v1.CheckErrorOrBuilder getCheckErrorsOrBuilder(int index) { + if (checkErrorsBuilder_ == null) { + return checkErrors_.get(index); + } else { + return checkErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public java.util.List + getCheckErrorsOrBuilderList() { + if (checkErrorsBuilder_ != null) { + return checkErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(checkErrors_); + } + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public com.google.api.servicecontrol.v1.CheckError.Builder addCheckErrorsBuilder() { + return getCheckErrorsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.CheckError.getDefaultInstance()); + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public com.google.api.servicecontrol.v1.CheckError.Builder addCheckErrorsBuilder(int index) { + return getCheckErrorsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.CheckError.getDefaultInstance()); + } + /** + * + * + *
+     * Indicate the decision of the check.
+     * If no check errors are present, the service should process the operation.
+     * Otherwise the service should use the list of errors to determine the
+     * appropriate action.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + public java.util.List + getCheckErrorsBuilderList() { + return getCheckErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckError, + com.google.api.servicecontrol.v1.CheckError.Builder, + com.google.api.servicecontrol.v1.CheckErrorOrBuilder> + getCheckErrorsFieldBuilder() { + if (checkErrorsBuilder_ == null) { + checkErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckError, + com.google.api.servicecontrol.v1.CheckError.Builder, + com.google.api.servicecontrol.v1.CheckErrorOrBuilder>( + checkErrors_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + checkErrors_ = null; + } + return checkErrorsBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 5; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 5; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 5; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 5; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceRolloutId_ = ""; + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 11; + * + * @return The serviceRolloutId. + */ + public java.lang.String getServiceRolloutId() { + java.lang.Object ref = serviceRolloutId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceRolloutId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 11; + * + * @return The bytes for serviceRolloutId. + */ + public com.google.protobuf.ByteString getServiceRolloutIdBytes() { + java.lang.Object ref = serviceRolloutId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRolloutId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 11; + * + * @param value The serviceRolloutId to set. + * @return This builder for chaining. + */ + public Builder setServiceRolloutId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceRolloutId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 11; + * + * @return This builder for chaining. + */ + public Builder clearServiceRolloutId() { + + serviceRolloutId_ = getDefaultInstance().getServiceRolloutId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 11; + * + * @param value The bytes for serviceRolloutId to set. + * @return This builder for chaining. + */ + public Builder setServiceRolloutIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceRolloutId_ = value; + onChanged(); + return this; + } + + private com.google.api.servicecontrol.v1.CheckResponse.CheckInfo checkInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder> + checkInfoBuilder_; + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return Whether the checkInfo field is set. + */ + public boolean hasCheckInfo() { + return checkInfoBuilder_ != null || checkInfo_ != null; + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return The checkInfo. + */ + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo getCheckInfo() { + if (checkInfoBuilder_ == null) { + return checkInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.getDefaultInstance() + : checkInfo_; + } else { + return checkInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public Builder setCheckInfo(com.google.api.servicecontrol.v1.CheckResponse.CheckInfo value) { + if (checkInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checkInfo_ = value; + onChanged(); + } else { + checkInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public Builder setCheckInfo( + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder builderForValue) { + if (checkInfoBuilder_ == null) { + checkInfo_ = builderForValue.build(); + onChanged(); + } else { + checkInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public Builder mergeCheckInfo(com.google.api.servicecontrol.v1.CheckResponse.CheckInfo value) { + if (checkInfoBuilder_ == null) { + if (checkInfo_ != null) { + checkInfo_ = + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.newBuilder(checkInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + checkInfo_ = value; + } + onChanged(); + } else { + checkInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public Builder clearCheckInfo() { + if (checkInfoBuilder_ == null) { + checkInfo_ = null; + onChanged(); + } else { + checkInfo_ = null; + checkInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder getCheckInfoBuilder() { + + onChanged(); + return getCheckInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + public com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder + getCheckInfoOrBuilder() { + if (checkInfoBuilder_ != null) { + return checkInfoBuilder_.getMessageOrBuilder(); + } else { + return checkInfo_ == null + ? com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.getDefaultInstance() + : checkInfo_; + } + } + /** + * + * + *
+     * Feedback data returned from the server during processing a Check request.
+     * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder> + getCheckInfoFieldBuilder() { + if (checkInfoBuilder_ == null) { + checkInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo.Builder, + com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder>( + getCheckInfo(), getParentForChildren(), isClean()); + checkInfo_ = null; + } + return checkInfoBuilder_; + } + + @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.api.servicecontrol.v1.CheckResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.CheckResponse) + private static final com.google.api.servicecontrol.v1.CheckResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.CheckResponse(); + } + + public static com.google.api.servicecontrol.v1.CheckResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CheckResponse(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.api.servicecontrol.v1.CheckResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponseOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponseOrBuilder.java new file mode 100644 index 00000000..366d5dcb --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/CheckResponseOrBuilder.java @@ -0,0 +1,206 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface CheckResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.CheckResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The same operation_id value used in the
+   * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+   * and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + /** + * + * + *
+   * The same operation_id value used in the
+   * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging
+   * and diagnostics purposes.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); + + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + java.util.List getCheckErrorsList(); + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + com.google.api.servicecontrol.v1.CheckError getCheckErrors(int index); + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + int getCheckErrorsCount(); + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + java.util.List + getCheckErrorsOrBuilderList(); + /** + * + * + *
+   * Indicate the decision of the check.
+   * If no check errors are present, the service should process the operation.
+   * Otherwise the service should use the list of errors to determine the
+   * appropriate action.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.CheckError check_errors = 2; + */ + com.google.api.servicecontrol.v1.CheckErrorOrBuilder getCheckErrorsOrBuilder(int index); + + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 5; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 5; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); + + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 11; + * + * @return The serviceRolloutId. + */ + java.lang.String getServiceRolloutId(); + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 11; + * + * @return The bytes for serviceRolloutId. + */ + com.google.protobuf.ByteString getServiceRolloutIdBytes(); + + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return Whether the checkInfo field is set. + */ + boolean hasCheckInfo(); + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + * + * @return The checkInfo. + */ + com.google.api.servicecontrol.v1.CheckResponse.CheckInfo getCheckInfo(); + /** + * + * + *
+   * Feedback data returned from the server during processing a Check request.
+   * 
+ * + * .google.api.servicecontrol.v1.CheckResponse.CheckInfo check_info = 6; + */ + com.google.api.servicecontrol.v1.CheckResponse.CheckInfoOrBuilder getCheckInfoOrBuilder(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Distribution.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Distribution.java new file mode 100644 index 00000000..d400ae29 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Distribution.java @@ -0,0 +1,5331 @@ +/* + * 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/api/servicecontrol/v1/distribution.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Distribution represents a frequency distribution of double-valued sample
+ * points. It contains the size of the population of sample points plus
+ * additional optional information:
+ *   - the arithmetic mean of the samples
+ *   - the minimum and maximum of the samples
+ *   - the sum-squared-deviation of the samples, used to compute variance
+ *   - a histogram of the values of the sample points
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution} + */ +public final class Distribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.Distribution) + DistributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Distribution.newBuilder() to construct. + private Distribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Distribution() { + bucketCounts_ = emptyLongList(); + exemplars_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Distribution(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Distribution( + 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: + { + count_ = input.readInt64(); + break; + } + case 17: + { + mean_ = input.readDouble(); + break; + } + case 25: + { + minimum_ = input.readDouble(); + break; + } + case 33: + { + maximum_ = input.readDouble(); + break; + } + case 41: + { + sumOfSquaredDeviation_ = input.readDouble(); + break; + } + case 48: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + bucketCounts_ = newLongList(); + mutable_bitField0_ |= 0x00000001; + } + bucketCounts_.addLong(input.readInt64()); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + bucketCounts_ = newLongList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + bucketCounts_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } + case 58: + { + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder subBuilder = null; + if (bucketOptionCase_ == 7) { + subBuilder = + ((com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_) + .toBuilder(); + } + bucketOption_ = + input.readMessage( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_); + bucketOption_ = subBuilder.buildPartial(); + } + bucketOptionCase_ = 7; + break; + } + case 66: + { + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder subBuilder = + null; + if (bucketOptionCase_ == 8) { + subBuilder = + ((com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + bucketOption_) + .toBuilder(); + } + bucketOption_ = + input.readMessage( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + bucketOption_); + bucketOption_ = subBuilder.buildPartial(); + } + bucketOptionCase_ = 8; + break; + } + case 74: + { + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder subBuilder = + null; + if (bucketOptionCase_ == 9) { + subBuilder = + ((com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_) + .toBuilder(); + } + bucketOption_ = + input.readMessage( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_); + bucketOption_ = subBuilder.buildPartial(); + } + bucketOptionCase_ = 9; + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + exemplars_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + exemplars_.add( + input.readMessage( + com.google.api.Distribution.Exemplar.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + bucketCounts_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + exemplars_ = java.util.Collections.unmodifiableList(exemplars_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.class, + com.google.api.servicecontrol.v1.Distribution.Builder.class); + } + + public interface LinearBucketsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.Distribution.LinearBuckets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of finite buckets. With the underflow and overflow buckets,
+     * the total number of buckets is `num_finite_buckets` + 2.
+     * See comments on `bucket_options` for details.
+     * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + int getNumFiniteBuckets(); + + /** + * + * + *
+     * The i'th linear bucket covers the interval
+     *   [offset + (i-1) * width, offset + i * width)
+     * where i ranges from 1 to num_finite_buckets, inclusive.
+     * Must be strictly positive.
+     * 
+ * + * double width = 2; + * + * @return The width. + */ + double getWidth(); + + /** + * + * + *
+     * The i'th linear bucket covers the interval
+     *   [offset + (i-1) * width, offset + i * width)
+     * where i ranges from 1 to num_finite_buckets, inclusive.
+     * 
+ * + * double offset = 3; + * + * @return The offset. + */ + double getOffset(); + } + /** + * + * + *
+   * Describing buckets with constant width.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.LinearBuckets} + */ + public static final class LinearBuckets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.Distribution.LinearBuckets) + LinearBucketsOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinearBuckets.newBuilder() to construct. + private LinearBuckets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LinearBuckets() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LinearBuckets(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LinearBuckets( + 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: + { + numFiniteBuckets_ = input.readInt32(); + break; + } + case 17: + { + width_ = input.readDouble(); + break; + } + case 25: + { + offset_ = input.readDouble(); + 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.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.class, + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder.class); + } + + public static final int NUM_FINITE_BUCKETS_FIELD_NUMBER = 1; + private int numFiniteBuckets_; + /** + * + * + *
+     * The number of finite buckets. With the underflow and overflow buckets,
+     * the total number of buckets is `num_finite_buckets` + 2.
+     * See comments on `bucket_options` for details.
+     * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + @java.lang.Override + public int getNumFiniteBuckets() { + return numFiniteBuckets_; + } + + public static final int WIDTH_FIELD_NUMBER = 2; + private double width_; + /** + * + * + *
+     * The i'th linear bucket covers the interval
+     *   [offset + (i-1) * width, offset + i * width)
+     * where i ranges from 1 to num_finite_buckets, inclusive.
+     * Must be strictly positive.
+     * 
+ * + * double width = 2; + * + * @return The width. + */ + @java.lang.Override + public double getWidth() { + return width_; + } + + public static final int OFFSET_FIELD_NUMBER = 3; + private double offset_; + /** + * + * + *
+     * The i'th linear bucket covers the interval
+     *   [offset + (i-1) * width, offset + i * width)
+     * where i ranges from 1 to num_finite_buckets, inclusive.
+     * 
+ * + * double offset = 3; + * + * @return The offset. + */ + @java.lang.Override + public double getOffset() { + return offset_; + } + + 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 (numFiniteBuckets_ != 0) { + output.writeInt32(1, numFiniteBuckets_); + } + if (width_ != 0D) { + output.writeDouble(2, width_); + } + if (offset_ != 0D) { + output.writeDouble(3, offset_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numFiniteBuckets_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, numFiniteBuckets_); + } + if (width_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, width_); + } + if (offset_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, offset_); + } + 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.api.servicecontrol.v1.Distribution.LinearBuckets)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.Distribution.LinearBuckets other = + (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) obj; + + if (getNumFiniteBuckets() != other.getNumFiniteBuckets()) return false; + if (java.lang.Double.doubleToLongBits(getWidth()) + != java.lang.Double.doubleToLongBits(other.getWidth())) return false; + if (java.lang.Double.doubleToLongBits(getOffset()) + != java.lang.Double.doubleToLongBits(other.getOffset())) 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) + NUM_FINITE_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getNumFiniteBuckets(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getWidth())); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getOffset())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets 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.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets 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.api.servicecontrol.v1.Distribution.LinearBuckets parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets 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.api.servicecontrol.v1.Distribution.LinearBuckets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets 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.api.servicecontrol.v1.Distribution.LinearBuckets 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; + } + /** + * + * + *
+     * Describing buckets with constant width.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.LinearBuckets} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.Distribution.LinearBuckets) + com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.class, + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.Distribution.LinearBuckets.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(); + numFiniteBuckets_ = 0; + + width_ = 0D; + + offset_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets + getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets build() { + com.google.api.servicecontrol.v1.Distribution.LinearBuckets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets buildPartial() { + com.google.api.servicecontrol.v1.Distribution.LinearBuckets result = + new com.google.api.servicecontrol.v1.Distribution.LinearBuckets(this); + result.numFiniteBuckets_ = numFiniteBuckets_; + result.width_ = width_; + result.offset_ = offset_; + 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.api.servicecontrol.v1.Distribution.LinearBuckets) { + return mergeFrom((com.google.api.servicecontrol.v1.Distribution.LinearBuckets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.Distribution.LinearBuckets other) { + if (other + == com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance()) + return this; + if (other.getNumFiniteBuckets() != 0) { + setNumFiniteBuckets(other.getNumFiniteBuckets()); + } + if (other.getWidth() != 0D) { + setWidth(other.getWidth()); + } + if (other.getOffset() != 0D) { + setOffset(other.getOffset()); + } + 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.api.servicecontrol.v1.Distribution.LinearBuckets parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int numFiniteBuckets_; + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + @java.lang.Override + public int getNumFiniteBuckets() { + return numFiniteBuckets_; + } + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @param value The numFiniteBuckets to set. + * @return This builder for chaining. + */ + public Builder setNumFiniteBuckets(int value) { + + numFiniteBuckets_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @return This builder for chaining. + */ + public Builder clearNumFiniteBuckets() { + + numFiniteBuckets_ = 0; + onChanged(); + return this; + } + + private double width_; + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * Must be strictly positive.
+       * 
+ * + * double width = 2; + * + * @return The width. + */ + @java.lang.Override + public double getWidth() { + return width_; + } + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * Must be strictly positive.
+       * 
+ * + * double width = 2; + * + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(double value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * Must be strictly positive.
+       * 
+ * + * double width = 2; + * + * @return This builder for chaining. + */ + public Builder clearWidth() { + + width_ = 0D; + onChanged(); + return this; + } + + private double offset_; + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * 
+ * + * double offset = 3; + * + * @return The offset. + */ + @java.lang.Override + public double getOffset() { + return offset_; + } + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * 
+ * + * double offset = 3; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(double value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The i'th linear bucket covers the interval
+       *   [offset + (i-1) * width, offset + i * width)
+       * where i ranges from 1 to num_finite_buckets, inclusive.
+       * 
+ * + * double offset = 3; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0D; + 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.api.servicecontrol.v1.Distribution.LinearBuckets) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.Distribution.LinearBuckets) + private static final com.google.api.servicecontrol.v1.Distribution.LinearBuckets + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.Distribution.LinearBuckets(); + } + + public static com.google.api.servicecontrol.v1.Distribution.LinearBuckets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinearBuckets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinearBuckets(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.api.servicecontrol.v1.Distribution.LinearBuckets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExponentialBucketsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The number of finite buckets. With the underflow and overflow buckets,
+     * the total number of buckets is `num_finite_buckets` + 2.
+     * See comments on `bucket_options` for details.
+     * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + int getNumFiniteBuckets(); + + /** + * + * + *
+     * The i'th exponential bucket covers the interval
+     *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+     * where i ranges from 1 to num_finite_buckets inclusive.
+     * Must be larger than 1.0.
+     * 
+ * + * double growth_factor = 2; + * + * @return The growthFactor. + */ + double getGrowthFactor(); + + /** + * + * + *
+     * The i'th exponential bucket covers the interval
+     *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+     * where i ranges from 1 to num_finite_buckets inclusive.
+     * Must be > 0.
+     * 
+ * + * double scale = 3; + * + * @return The scale. + */ + double getScale(); + } + /** + * + * + *
+   * Describing buckets with exponentially growing width.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.ExponentialBuckets} + */ + public static final class ExponentialBuckets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + ExponentialBucketsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExponentialBuckets.newBuilder() to construct. + private ExponentialBuckets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExponentialBuckets() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExponentialBuckets(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExponentialBuckets( + 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: + { + numFiniteBuckets_ = input.readInt32(); + break; + } + case 17: + { + growthFactor_ = input.readDouble(); + break; + } + case 25: + { + scale_ = input.readDouble(); + 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.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.class, + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder.class); + } + + public static final int NUM_FINITE_BUCKETS_FIELD_NUMBER = 1; + private int numFiniteBuckets_; + /** + * + * + *
+     * The number of finite buckets. With the underflow and overflow buckets,
+     * the total number of buckets is `num_finite_buckets` + 2.
+     * See comments on `bucket_options` for details.
+     * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + @java.lang.Override + public int getNumFiniteBuckets() { + return numFiniteBuckets_; + } + + public static final int GROWTH_FACTOR_FIELD_NUMBER = 2; + private double growthFactor_; + /** + * + * + *
+     * The i'th exponential bucket covers the interval
+     *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+     * where i ranges from 1 to num_finite_buckets inclusive.
+     * Must be larger than 1.0.
+     * 
+ * + * double growth_factor = 2; + * + * @return The growthFactor. + */ + @java.lang.Override + public double getGrowthFactor() { + return growthFactor_; + } + + public static final int SCALE_FIELD_NUMBER = 3; + private double scale_; + /** + * + * + *
+     * The i'th exponential bucket covers the interval
+     *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+     * where i ranges from 1 to num_finite_buckets inclusive.
+     * Must be > 0.
+     * 
+ * + * double scale = 3; + * + * @return The scale. + */ + @java.lang.Override + public double getScale() { + return scale_; + } + + 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 (numFiniteBuckets_ != 0) { + output.writeInt32(1, numFiniteBuckets_); + } + if (growthFactor_ != 0D) { + output.writeDouble(2, growthFactor_); + } + if (scale_ != 0D) { + output.writeDouble(3, scale_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numFiniteBuckets_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, numFiniteBuckets_); + } + if (growthFactor_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, growthFactor_); + } + if (scale_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, scale_); + } + 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.api.servicecontrol.v1.Distribution.ExponentialBuckets)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets other = + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) obj; + + if (getNumFiniteBuckets() != other.getNumFiniteBuckets()) return false; + if (java.lang.Double.doubleToLongBits(getGrowthFactor()) + != java.lang.Double.doubleToLongBits(other.getGrowthFactor())) return false; + if (java.lang.Double.doubleToLongBits(getScale()) + != java.lang.Double.doubleToLongBits(other.getScale())) 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) + NUM_FINITE_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getNumFiniteBuckets(); + hash = (37 * hash) + GROWTH_FACTOR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getGrowthFactor())); + hash = (37 * hash) + SCALE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getScale())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets 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.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets 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.api.servicecontrol.v1.Distribution.ExponentialBuckets + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + 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.api.servicecontrol.v1.Distribution.ExponentialBuckets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets 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.api.servicecontrol.v1.Distribution.ExponentialBuckets 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; + } + /** + * + * + *
+     * Describing buckets with exponentially growing width.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.ExponentialBuckets} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.class, + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder.class); + } + + // Construct using + // com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.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(); + numFiniteBuckets_ = 0; + + growthFactor_ = 0D; + + scale_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets build() { + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets buildPartial() { + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets result = + new com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets(this); + result.numFiniteBuckets_ = numFiniteBuckets_; + result.growthFactor_ = growthFactor_; + result.scale_ = scale_; + 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.api.servicecontrol.v1.Distribution.ExponentialBuckets) { + return mergeFrom( + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets other) { + if (other + == com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance()) return this; + if (other.getNumFiniteBuckets() != 0) { + setNumFiniteBuckets(other.getNumFiniteBuckets()); + } + if (other.getGrowthFactor() != 0D) { + setGrowthFactor(other.getGrowthFactor()); + } + if (other.getScale() != 0D) { + setScale(other.getScale()); + } + 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.api.servicecontrol.v1.Distribution.ExponentialBuckets parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int numFiniteBuckets_; + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @return The numFiniteBuckets. + */ + @java.lang.Override + public int getNumFiniteBuckets() { + return numFiniteBuckets_; + } + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @param value The numFiniteBuckets to set. + * @return This builder for chaining. + */ + public Builder setNumFiniteBuckets(int value) { + + numFiniteBuckets_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of finite buckets. With the underflow and overflow buckets,
+       * the total number of buckets is `num_finite_buckets` + 2.
+       * See comments on `bucket_options` for details.
+       * 
+ * + * int32 num_finite_buckets = 1; + * + * @return This builder for chaining. + */ + public Builder clearNumFiniteBuckets() { + + numFiniteBuckets_ = 0; + onChanged(); + return this; + } + + private double growthFactor_; + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be larger than 1.0.
+       * 
+ * + * double growth_factor = 2; + * + * @return The growthFactor. + */ + @java.lang.Override + public double getGrowthFactor() { + return growthFactor_; + } + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be larger than 1.0.
+       * 
+ * + * double growth_factor = 2; + * + * @param value The growthFactor to set. + * @return This builder for chaining. + */ + public Builder setGrowthFactor(double value) { + + growthFactor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be larger than 1.0.
+       * 
+ * + * double growth_factor = 2; + * + * @return This builder for chaining. + */ + public Builder clearGrowthFactor() { + + growthFactor_ = 0D; + onChanged(); + return this; + } + + private double scale_; + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be > 0.
+       * 
+ * + * double scale = 3; + * + * @return The scale. + */ + @java.lang.Override + public double getScale() { + return scale_; + } + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be > 0.
+       * 
+ * + * double scale = 3; + * + * @param value The scale to set. + * @return This builder for chaining. + */ + public Builder setScale(double value) { + + scale_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The i'th exponential bucket covers the interval
+       *   [scale * growth_factor^(i-1), scale * growth_factor^i)
+       * where i ranges from 1 to num_finite_buckets inclusive.
+       * Must be > 0.
+       * 
+ * + * double scale = 3; + * + * @return This builder for chaining. + */ + public Builder clearScale() { + + scale_ = 0D; + 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.api.servicecontrol.v1.Distribution.ExponentialBuckets) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + private static final com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets(); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExponentialBuckets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExponentialBuckets(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.api.servicecontrol.v1.Distribution.ExponentialBuckets + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExplicitBucketsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.Distribution.ExplicitBuckets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @return A list containing the bounds. + */ + java.util.List getBoundsList(); + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @return The count of bounds. + */ + int getBoundsCount(); + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @param index The index of the element to return. + * @return The bounds at the given index. + */ + double getBounds(int index); + } + /** + * + * + *
+   * Describing buckets with arbitrary user-provided width.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.ExplicitBuckets} + */ + public static final class ExplicitBuckets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.Distribution.ExplicitBuckets) + ExplicitBucketsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplicitBuckets.newBuilder() to construct. + private ExplicitBuckets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplicitBuckets() { + bounds_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplicitBuckets(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExplicitBuckets( + 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 9: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + bounds_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + bounds_.addDouble(input.readDouble()); + break; + } + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + bounds_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + bounds_.addDouble(input.readDouble()); + } + input.popLimit(limit); + 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)) { + bounds_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.class, + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder.class); + } + + public static final int BOUNDS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.DoubleList bounds_; + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @return A list containing the bounds. + */ + @java.lang.Override + public java.util.List getBoundsList() { + return bounds_; + } + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @return The count of bounds. + */ + public int getBoundsCount() { + return bounds_.size(); + } + /** + * + * + *
+     * 'bound' is a list of strictly increasing boundaries between
+     * buckets. Note that a list of length N-1 defines N buckets because
+     * of fenceposting. See comments on `bucket_options` for details.
+     * The i'th finite bucket covers the interval
+     *   [bound[i-1], bound[i])
+     * where i ranges from 1 to bound_size() - 1. Note that there are no
+     * finite buckets at all if 'bound' only contains a single element; in
+     * that special case the single bound defines the boundary between the
+     * underflow and overflow buckets.
+     * bucket number                   lower bound    upper bound
+     *  i == 0 (underflow)              -inf           bound[i]
+     *  0 < i < bound_size()            bound[i-1]     bound[i]
+     *  i == bound_size() (overflow)    bound[i-1]     +inf
+     * 
+ * + * repeated double bounds = 1; + * + * @param index The index of the element to return. + * @return The bounds at the given index. + */ + public double getBounds(int index) { + return bounds_.getDouble(index); + } + + private int boundsMemoizedSerializedSize = -1; + + 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 (getBoundsList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(boundsMemoizedSerializedSize); + } + for (int i = 0; i < bounds_.size(); i++) { + output.writeDoubleNoTag(bounds_.getDouble(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getBoundsList().size(); + size += dataSize; + if (!getBoundsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + boundsMemoizedSerializedSize = dataSize; + } + 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.api.servicecontrol.v1.Distribution.ExplicitBuckets)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets other = + (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) obj; + + if (!getBoundsList().equals(other.getBoundsList())) 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 (getBoundsCount() > 0) { + hash = (37 * hash) + BOUNDS_FIELD_NUMBER; + hash = (53 * hash) + getBoundsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets 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.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets 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.api.servicecontrol.v1.Distribution.ExplicitBuckets parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets 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.api.servicecontrol.v1.Distribution.ExplicitBuckets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets 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.api.servicecontrol.v1.Distribution.ExplicitBuckets 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; + } + /** + * + * + *
+     * Describing buckets with arbitrary user-provided width.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution.ExplicitBuckets} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.Distribution.ExplicitBuckets) + com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.class, + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.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(); + bounds_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets + getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets build() { + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets buildPartial() { + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets result = + new com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + bounds_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.bounds_ = bounds_; + 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.api.servicecontrol.v1.Distribution.ExplicitBuckets) { + return mergeFrom((com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets other) { + if (other + == com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance()) + return this; + if (!other.bounds_.isEmpty()) { + if (bounds_.isEmpty()) { + bounds_ = other.bounds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBoundsIsMutable(); + bounds_.addAll(other.bounds_); + } + 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.api.servicecontrol.v1.Distribution.ExplicitBuckets parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList bounds_ = emptyDoubleList(); + + private void ensureBoundsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + bounds_ = mutableCopy(bounds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @return A list containing the bounds. + */ + public java.util.List getBoundsList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(bounds_) + : bounds_; + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @return The count of bounds. + */ + public int getBoundsCount() { + return bounds_.size(); + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @param index The index of the element to return. + * @return The bounds at the given index. + */ + public double getBounds(int index) { + return bounds_.getDouble(index); + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @param index The index to set the value at. + * @param value The bounds to set. + * @return This builder for chaining. + */ + public Builder setBounds(int index, double value) { + ensureBoundsIsMutable(); + bounds_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @param value The bounds to add. + * @return This builder for chaining. + */ + public Builder addBounds(double value) { + ensureBoundsIsMutable(); + bounds_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @param values The bounds to add. + * @return This builder for chaining. + */ + public Builder addAllBounds(java.lang.Iterable values) { + ensureBoundsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bounds_); + onChanged(); + return this; + } + /** + * + * + *
+       * 'bound' is a list of strictly increasing boundaries between
+       * buckets. Note that a list of length N-1 defines N buckets because
+       * of fenceposting. See comments on `bucket_options` for details.
+       * The i'th finite bucket covers the interval
+       *   [bound[i-1], bound[i])
+       * where i ranges from 1 to bound_size() - 1. Note that there are no
+       * finite buckets at all if 'bound' only contains a single element; in
+       * that special case the single bound defines the boundary between the
+       * underflow and overflow buckets.
+       * bucket number                   lower bound    upper bound
+       *  i == 0 (underflow)              -inf           bound[i]
+       *  0 < i < bound_size()            bound[i-1]     bound[i]
+       *  i == bound_size() (overflow)    bound[i-1]     +inf
+       * 
+ * + * repeated double bounds = 1; + * + * @return This builder for chaining. + */ + public Builder clearBounds() { + bounds_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + 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.api.servicecontrol.v1.Distribution.ExplicitBuckets) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.Distribution.ExplicitBuckets) + private static final com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets(); + } + + public static com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplicitBuckets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExplicitBuckets(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.api.servicecontrol.v1.Distribution.ExplicitBuckets + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bucketOptionCase_ = 0; + private java.lang.Object bucketOption_; + + public enum BucketOptionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LINEAR_BUCKETS(7), + EXPONENTIAL_BUCKETS(8), + EXPLICIT_BUCKETS(9), + BUCKETOPTION_NOT_SET(0); + private final int value; + + private BucketOptionCase(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 BucketOptionCase valueOf(int value) { + return forNumber(value); + } + + public static BucketOptionCase forNumber(int value) { + switch (value) { + case 7: + return LINEAR_BUCKETS; + case 8: + return EXPONENTIAL_BUCKETS; + case 9: + return EXPLICIT_BUCKETS; + case 0: + return BUCKETOPTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public BucketOptionCase getBucketOptionCase() { + return BucketOptionCase.forNumber(bucketOptionCase_); + } + + public static final int COUNT_FIELD_NUMBER = 1; + private long count_; + /** + * + * + *
+   * The total number of samples in the distribution. Must be >= 0.
+   * 
+ * + * int64 count = 1; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + public static final int MEAN_FIELD_NUMBER = 2; + private double mean_; + /** + * + * + *
+   * The arithmetic mean of the samples in the distribution. If `count` is
+   * zero then this field must be zero.
+   * 
+ * + * double mean = 2; + * + * @return The mean. + */ + @java.lang.Override + public double getMean() { + return mean_; + } + + public static final int MINIMUM_FIELD_NUMBER = 3; + private double minimum_; + /** + * + * + *
+   * The minimum of the population of values. Ignored if `count` is zero.
+   * 
+ * + * double minimum = 3; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + return minimum_; + } + + public static final int MAXIMUM_FIELD_NUMBER = 4; + private double maximum_; + /** + * + * + *
+   * The maximum of the population of values. Ignored if `count` is zero.
+   * 
+ * + * double maximum = 4; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + return maximum_; + } + + public static final int SUM_OF_SQUARED_DEVIATION_FIELD_NUMBER = 5; + private double sumOfSquaredDeviation_; + /** + * + * + *
+   * The sum of squared deviations from the mean:
+   *   Sum[i=1..count]((x_i - mean)^2)
+   * where each x_i is a sample values. If `count` is zero then this field
+   * must be zero, otherwise validation of the request fails.
+   * 
+ * + * double sum_of_squared_deviation = 5; + * + * @return The sumOfSquaredDeviation. + */ + @java.lang.Override + public double getSumOfSquaredDeviation() { + return sumOfSquaredDeviation_; + } + + public static final int BUCKET_COUNTS_FIELD_NUMBER = 6; + private com.google.protobuf.Internal.LongList bucketCounts_; + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return A list containing the bucketCounts. + */ + @java.lang.Override + public java.util.List getBucketCountsList() { + return bucketCounts_; + } + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return The count of bucketCounts. + */ + public int getBucketCountsCount() { + return bucketCounts_.size(); + } + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param index The index of the element to return. + * @return The bucketCounts at the given index. + */ + public long getBucketCounts(int index) { + return bucketCounts_.getLong(index); + } + + private int bucketCountsMemoizedSerializedSize = -1; + + public static final int LINEAR_BUCKETS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return Whether the linearBuckets field is set. + */ + @java.lang.Override + public boolean hasLinearBuckets() { + return bucketOptionCase_ == 7; + } + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return The linearBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets getLinearBuckets() { + if (bucketOptionCase_ == 7) { + return (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder + getLinearBucketsOrBuilder() { + if (bucketOptionCase_ == 7) { + return (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + + public static final int EXPONENTIAL_BUCKETS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return Whether the exponentialBuckets field is set. + */ + @java.lang.Override + public boolean hasExponentialBuckets() { + return bucketOptionCase_ == 8; + } + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return The exponentialBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets getExponentialBuckets() { + if (bucketOptionCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.getDefaultInstance(); + } + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder + getExponentialBucketsOrBuilder() { + if (bucketOptionCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.getDefaultInstance(); + } + + public static final int EXPLICIT_BUCKETS_FIELD_NUMBER = 9; + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return Whether the explicitBuckets field is set. + */ + @java.lang.Override + public boolean hasExplicitBuckets() { + return bucketOptionCase_ == 9; + } + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return The explicitBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets getExplicitBuckets() { + if (bucketOptionCase_ == 9) { + return (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder + getExplicitBucketsOrBuilder() { + if (bucketOptionCase_ == 9) { + return (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + + public static final int EXEMPLARS_FIELD_NUMBER = 10; + private java.util.List exemplars_; + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + @java.lang.Override + public java.util.List getExemplarsList() { + return exemplars_; + } + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + @java.lang.Override + public java.util.List + getExemplarsOrBuilderList() { + return exemplars_; + } + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + @java.lang.Override + public int getExemplarsCount() { + return exemplars_.size(); + } + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + @java.lang.Override + public com.google.api.Distribution.Exemplar getExemplars(int index) { + return exemplars_.get(index); + } + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + @java.lang.Override + public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int index) { + return exemplars_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (count_ != 0L) { + output.writeInt64(1, count_); + } + if (mean_ != 0D) { + output.writeDouble(2, mean_); + } + if (minimum_ != 0D) { + output.writeDouble(3, minimum_); + } + if (maximum_ != 0D) { + output.writeDouble(4, maximum_); + } + if (sumOfSquaredDeviation_ != 0D) { + output.writeDouble(5, sumOfSquaredDeviation_); + } + if (getBucketCountsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(bucketCountsMemoizedSerializedSize); + } + for (int i = 0; i < bucketCounts_.size(); i++) { + output.writeInt64NoTag(bucketCounts_.getLong(i)); + } + if (bucketOptionCase_ == 7) { + output.writeMessage( + 7, (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_); + } + if (bucketOptionCase_ == 8) { + output.writeMessage( + 8, (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_); + } + if (bucketOptionCase_ == 9) { + output.writeMessage( + 9, (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_); + } + for (int i = 0; i < exemplars_.size(); i++) { + output.writeMessage(10, exemplars_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, count_); + } + if (mean_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, mean_); + } + if (minimum_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, minimum_); + } + if (maximum_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, maximum_); + } + if (sumOfSquaredDeviation_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, sumOfSquaredDeviation_); + } + { + int dataSize = 0; + for (int i = 0; i < bucketCounts_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(bucketCounts_.getLong(i)); + } + size += dataSize; + if (!getBucketCountsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + bucketCountsMemoizedSerializedSize = dataSize; + } + if (bucketOptionCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_); + } + if (bucketOptionCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_); + } + if (bucketOptionCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_); + } + for (int i = 0; i < exemplars_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, exemplars_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.servicecontrol.v1.Distribution)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.Distribution other = + (com.google.api.servicecontrol.v1.Distribution) obj; + + if (getCount() != other.getCount()) return false; + if (java.lang.Double.doubleToLongBits(getMean()) + != java.lang.Double.doubleToLongBits(other.getMean())) return false; + if (java.lang.Double.doubleToLongBits(getMinimum()) + != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; + if (java.lang.Double.doubleToLongBits(getMaximum()) + != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; + if (java.lang.Double.doubleToLongBits(getSumOfSquaredDeviation()) + != java.lang.Double.doubleToLongBits(other.getSumOfSquaredDeviation())) return false; + if (!getBucketCountsList().equals(other.getBucketCountsList())) return false; + if (!getExemplarsList().equals(other.getExemplarsList())) return false; + if (!getBucketOptionCase().equals(other.getBucketOptionCase())) return false; + switch (bucketOptionCase_) { + case 7: + if (!getLinearBuckets().equals(other.getLinearBuckets())) return false; + break; + case 8: + if (!getExponentialBuckets().equals(other.getExponentialBuckets())) return false; + break; + case 9: + if (!getExplicitBuckets().equals(other.getExplicitBuckets())) 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (37 * hash) + MEAN_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getMean())); + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMinimum())); + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMaximum())); + hash = (37 * hash) + SUM_OF_SQUARED_DEVIATION_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSumOfSquaredDeviation())); + if (getBucketCountsCount() > 0) { + hash = (37 * hash) + BUCKET_COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getBucketCountsList().hashCode(); + } + if (getExemplarsCount() > 0) { + hash = (37 * hash) + EXEMPLARS_FIELD_NUMBER; + hash = (53 * hash) + getExemplarsList().hashCode(); + } + switch (bucketOptionCase_) { + case 7: + hash = (37 * hash) + LINEAR_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getLinearBuckets().hashCode(); + break; + case 8: + hash = (37 * hash) + EXPONENTIAL_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getExponentialBuckets().hashCode(); + break; + case 9: + hash = (37 * hash) + EXPLICIT_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getExplicitBuckets().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.Distribution parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution 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.api.servicecontrol.v1.Distribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Distribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Distribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution 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.api.servicecontrol.v1.Distribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution 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.api.servicecontrol.v1.Distribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Distribution 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.api.servicecontrol.v1.Distribution 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; + } + /** + * + * + *
+   * Distribution represents a frequency distribution of double-valued sample
+   * points. It contains the size of the population of sample points plus
+   * additional optional information:
+   *   - the arithmetic mean of the samples
+   *   - the minimum and maximum of the samples
+   *   - the sum-squared-deviation of the samples, used to compute variance
+   *   - a histogram of the values of the sample points
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Distribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.Distribution) + com.google.api.servicecontrol.v1.DistributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Distribution.class, + com.google.api.servicecontrol.v1.Distribution.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.Distribution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExemplarsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + count_ = 0L; + + mean_ = 0D; + + minimum_ = 0D; + + maximum_ = 0D; + + sumOfSquaredDeviation_ = 0D; + + bucketCounts_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + exemplarsBuilder_.clear(); + } + bucketOptionCase_ = 0; + bucketOption_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.DistributionProto + .internal_static_google_api_servicecontrol_v1_Distribution_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution build() { + com.google.api.servicecontrol.v1.Distribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution buildPartial() { + com.google.api.servicecontrol.v1.Distribution result = + new com.google.api.servicecontrol.v1.Distribution(this); + int from_bitField0_ = bitField0_; + result.count_ = count_; + result.mean_ = mean_; + result.minimum_ = minimum_; + result.maximum_ = maximum_; + result.sumOfSquaredDeviation_ = sumOfSquaredDeviation_; + if (((bitField0_ & 0x00000001) != 0)) { + bucketCounts_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.bucketCounts_ = bucketCounts_; + if (bucketOptionCase_ == 7) { + if (linearBucketsBuilder_ == null) { + result.bucketOption_ = bucketOption_; + } else { + result.bucketOption_ = linearBucketsBuilder_.build(); + } + } + if (bucketOptionCase_ == 8) { + if (exponentialBucketsBuilder_ == null) { + result.bucketOption_ = bucketOption_; + } else { + result.bucketOption_ = exponentialBucketsBuilder_.build(); + } + } + if (bucketOptionCase_ == 9) { + if (explicitBucketsBuilder_ == null) { + result.bucketOption_ = bucketOption_; + } else { + result.bucketOption_ = explicitBucketsBuilder_.build(); + } + } + if (exemplarsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + exemplars_ = java.util.Collections.unmodifiableList(exemplars_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.exemplars_ = exemplars_; + } else { + result.exemplars_ = exemplarsBuilder_.build(); + } + result.bucketOptionCase_ = bucketOptionCase_; + 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.api.servicecontrol.v1.Distribution) { + return mergeFrom((com.google.api.servicecontrol.v1.Distribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.Distribution other) { + if (other == com.google.api.servicecontrol.v1.Distribution.getDefaultInstance()) return this; + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + if (other.getMean() != 0D) { + setMean(other.getMean()); + } + if (other.getMinimum() != 0D) { + setMinimum(other.getMinimum()); + } + if (other.getMaximum() != 0D) { + setMaximum(other.getMaximum()); + } + if (other.getSumOfSquaredDeviation() != 0D) { + setSumOfSquaredDeviation(other.getSumOfSquaredDeviation()); + } + if (!other.bucketCounts_.isEmpty()) { + if (bucketCounts_.isEmpty()) { + bucketCounts_ = other.bucketCounts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBucketCountsIsMutable(); + bucketCounts_.addAll(other.bucketCounts_); + } + onChanged(); + } + if (exemplarsBuilder_ == null) { + if (!other.exemplars_.isEmpty()) { + if (exemplars_.isEmpty()) { + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExemplarsIsMutable(); + exemplars_.addAll(other.exemplars_); + } + onChanged(); + } + } else { + if (!other.exemplars_.isEmpty()) { + if (exemplarsBuilder_.isEmpty()) { + exemplarsBuilder_.dispose(); + exemplarsBuilder_ = null; + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00000002); + exemplarsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExemplarsFieldBuilder() + : null; + } else { + exemplarsBuilder_.addAllMessages(other.exemplars_); + } + } + } + switch (other.getBucketOptionCase()) { + case LINEAR_BUCKETS: + { + mergeLinearBuckets(other.getLinearBuckets()); + break; + } + case EXPONENTIAL_BUCKETS: + { + mergeExponentialBuckets(other.getExponentialBuckets()); + break; + } + case EXPLICIT_BUCKETS: + { + mergeExplicitBuckets(other.getExplicitBuckets()); + break; + } + case BUCKETOPTION_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.api.servicecontrol.v1.Distribution parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.Distribution) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bucketOptionCase_ = 0; + private java.lang.Object bucketOption_; + + public BucketOptionCase getBucketOptionCase() { + return BucketOptionCase.forNumber(bucketOptionCase_); + } + + public Builder clearBucketOption() { + bucketOptionCase_ = 0; + bucketOption_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private long count_; + /** + * + * + *
+     * The total number of samples in the distribution. Must be >= 0.
+     * 
+ * + * int64 count = 1; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+     * The total number of samples in the distribution. Must be >= 0.
+     * 
+ * + * int64 count = 1; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of samples in the distribution. Must be >= 0.
+     * 
+ * + * int64 count = 1; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + onChanged(); + return this; + } + + private double mean_; + /** + * + * + *
+     * The arithmetic mean of the samples in the distribution. If `count` is
+     * zero then this field must be zero.
+     * 
+ * + * double mean = 2; + * + * @return The mean. + */ + @java.lang.Override + public double getMean() { + return mean_; + } + /** + * + * + *
+     * The arithmetic mean of the samples in the distribution. If `count` is
+     * zero then this field must be zero.
+     * 
+ * + * double mean = 2; + * + * @param value The mean to set. + * @return This builder for chaining. + */ + public Builder setMean(double value) { + + mean_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The arithmetic mean of the samples in the distribution. If `count` is
+     * zero then this field must be zero.
+     * 
+ * + * double mean = 2; + * + * @return This builder for chaining. + */ + public Builder clearMean() { + + mean_ = 0D; + onChanged(); + return this; + } + + private double minimum_; + /** + * + * + *
+     * The minimum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double minimum = 3; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + return minimum_; + } + /** + * + * + *
+     * The minimum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double minimum = 3; + * + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(double value) { + + minimum_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double minimum = 3; + * + * @return This builder for chaining. + */ + public Builder clearMinimum() { + + minimum_ = 0D; + onChanged(); + return this; + } + + private double maximum_; + /** + * + * + *
+     * The maximum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double maximum = 4; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + return maximum_; + } + /** + * + * + *
+     * The maximum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double maximum = 4; + * + * @param value The maximum to set. + * @return This builder for chaining. + */ + public Builder setMaximum(double value) { + + maximum_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum of the population of values. Ignored if `count` is zero.
+     * 
+ * + * double maximum = 4; + * + * @return This builder for chaining. + */ + public Builder clearMaximum() { + + maximum_ = 0D; + onChanged(); + return this; + } + + private double sumOfSquaredDeviation_; + /** + * + * + *
+     * The sum of squared deviations from the mean:
+     *   Sum[i=1..count]((x_i - mean)^2)
+     * where each x_i is a sample values. If `count` is zero then this field
+     * must be zero, otherwise validation of the request fails.
+     * 
+ * + * double sum_of_squared_deviation = 5; + * + * @return The sumOfSquaredDeviation. + */ + @java.lang.Override + public double getSumOfSquaredDeviation() { + return sumOfSquaredDeviation_; + } + /** + * + * + *
+     * The sum of squared deviations from the mean:
+     *   Sum[i=1..count]((x_i - mean)^2)
+     * where each x_i is a sample values. If `count` is zero then this field
+     * must be zero, otherwise validation of the request fails.
+     * 
+ * + * double sum_of_squared_deviation = 5; + * + * @param value The sumOfSquaredDeviation to set. + * @return This builder for chaining. + */ + public Builder setSumOfSquaredDeviation(double value) { + + sumOfSquaredDeviation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The sum of squared deviations from the mean:
+     *   Sum[i=1..count]((x_i - mean)^2)
+     * where each x_i is a sample values. If `count` is zero then this field
+     * must be zero, otherwise validation of the request fails.
+     * 
+ * + * double sum_of_squared_deviation = 5; + * + * @return This builder for chaining. + */ + public Builder clearSumOfSquaredDeviation() { + + sumOfSquaredDeviation_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList bucketCounts_ = emptyLongList(); + + private void ensureBucketCountsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + bucketCounts_ = mutableCopy(bucketCounts_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return A list containing the bucketCounts. + */ + public java.util.List getBucketCountsList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(bucketCounts_) + : bucketCounts_; + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return The count of bucketCounts. + */ + public int getBucketCountsCount() { + return bucketCounts_.size(); + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param index The index of the element to return. + * @return The bucketCounts at the given index. + */ + public long getBucketCounts(int index) { + return bucketCounts_.getLong(index); + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param index The index to set the value at. + * @param value The bucketCounts to set. + * @return This builder for chaining. + */ + public Builder setBucketCounts(int index, long value) { + ensureBucketCountsIsMutable(); + bucketCounts_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param value The bucketCounts to add. + * @return This builder for chaining. + */ + public Builder addBucketCounts(long value) { + ensureBucketCountsIsMutable(); + bucketCounts_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param values The bucketCounts to add. + * @return This builder for chaining. + */ + public Builder addAllBucketCounts(java.lang.Iterable values) { + ensureBucketCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bucketCounts_); + onChanged(); + return this; + } + /** + * + * + *
+     * The number of samples in each histogram bucket. `bucket_counts` are
+     * optional. If present, they must sum to the `count` value.
+     * The buckets are defined below in `bucket_option`. There are N buckets.
+     * `bucket_counts[0]` is the number of samples in the underflow bucket.
+     * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+     * in each of the finite buckets. And `bucket_counts[N] is the number
+     * of samples in the overflow bucket. See the comments of `bucket_option`
+     * below for more details.
+     * Any suffix of trailing zeros may be omitted.
+     * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return This builder for chaining. + */ + public Builder clearBucketCounts() { + bucketCounts_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.LinearBuckets, + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder> + linearBucketsBuilder_; + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return Whether the linearBuckets field is set. + */ + @java.lang.Override + public boolean hasLinearBuckets() { + return bucketOptionCase_ == 7; + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return The linearBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets getLinearBuckets() { + if (linearBucketsBuilder_ == null) { + if (bucketOptionCase_ == 7) { + return (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } else { + if (bucketOptionCase_ == 7) { + return linearBucketsBuilder_.getMessage(); + } + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + public Builder setLinearBuckets( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets value) { + if (linearBucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucketOption_ = value; + onChanged(); + } else { + linearBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 7; + return this; + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + public Builder setLinearBuckets( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder builderForValue) { + if (linearBucketsBuilder_ == null) { + bucketOption_ = builderForValue.build(); + onChanged(); + } else { + linearBucketsBuilder_.setMessage(builderForValue.build()); + } + bucketOptionCase_ = 7; + return this; + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + public Builder mergeLinearBuckets( + com.google.api.servicecontrol.v1.Distribution.LinearBuckets value) { + if (linearBucketsBuilder_ == null) { + if (bucketOptionCase_ == 7 + && bucketOption_ + != com.google.api.servicecontrol.v1.Distribution.LinearBuckets + .getDefaultInstance()) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.newBuilder( + (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_) + .mergeFrom(value) + .buildPartial(); + } else { + bucketOption_ = value; + } + onChanged(); + } else { + if (bucketOptionCase_ == 7) { + linearBucketsBuilder_.mergeFrom(value); + } + linearBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 7; + return this; + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + public Builder clearLinearBuckets() { + if (linearBucketsBuilder_ == null) { + if (bucketOptionCase_ == 7) { + bucketOptionCase_ = 0; + bucketOption_ = null; + onChanged(); + } + } else { + if (bucketOptionCase_ == 7) { + bucketOptionCase_ = 0; + bucketOption_ = null; + } + linearBucketsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + public com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder + getLinearBucketsBuilder() { + return getLinearBucketsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder + getLinearBucketsOrBuilder() { + if ((bucketOptionCase_ == 7) && (linearBucketsBuilder_ != null)) { + return linearBucketsBuilder_.getMessageOrBuilder(); + } else { + if (bucketOptionCase_ == 7) { + return (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with constant width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.LinearBuckets, + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder> + getLinearBucketsFieldBuilder() { + if (linearBucketsBuilder_ == null) { + if (!(bucketOptionCase_ == 7)) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.getDefaultInstance(); + } + linearBucketsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.LinearBuckets, + com.google.api.servicecontrol.v1.Distribution.LinearBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder>( + (com.google.api.servicecontrol.v1.Distribution.LinearBuckets) bucketOption_, + getParentForChildren(), + isClean()); + bucketOption_ = null; + } + bucketOptionCase_ = 7; + onChanged(); + ; + return linearBucketsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets, + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder> + exponentialBucketsBuilder_; + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return Whether the exponentialBuckets field is set. + */ + @java.lang.Override + public boolean hasExponentialBuckets() { + return bucketOptionCase_ == 8; + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return The exponentialBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + getExponentialBuckets() { + if (exponentialBucketsBuilder_ == null) { + if (bucketOptionCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance(); + } else { + if (bucketOptionCase_ == 8) { + return exponentialBucketsBuilder_.getMessage(); + } + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + public Builder setExponentialBuckets( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets value) { + if (exponentialBucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucketOption_ = value; + onChanged(); + } else { + exponentialBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 8; + return this; + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + public Builder setExponentialBuckets( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder builderForValue) { + if (exponentialBucketsBuilder_ == null) { + bucketOption_ = builderForValue.build(); + onChanged(); + } else { + exponentialBucketsBuilder_.setMessage(builderForValue.build()); + } + bucketOptionCase_ = 8; + return this; + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + public Builder mergeExponentialBuckets( + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets value) { + if (exponentialBucketsBuilder_ == null) { + if (bucketOptionCase_ == 8 + && bucketOption_ + != com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance()) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.newBuilder( + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) + bucketOption_) + .mergeFrom(value) + .buildPartial(); + } else { + bucketOption_ = value; + } + onChanged(); + } else { + if (bucketOptionCase_ == 8) { + exponentialBucketsBuilder_.mergeFrom(value); + } + exponentialBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 8; + return this; + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + public Builder clearExponentialBuckets() { + if (exponentialBucketsBuilder_ == null) { + if (bucketOptionCase_ == 8) { + bucketOptionCase_ = 0; + bucketOption_ = null; + onChanged(); + } + } else { + if (bucketOptionCase_ == 8) { + bucketOptionCase_ = 0; + bucketOption_ = null; + } + exponentialBucketsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + public com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder + getExponentialBucketsBuilder() { + return getExponentialBucketsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder + getExponentialBucketsOrBuilder() { + if ((bucketOptionCase_ == 8) && (exponentialBucketsBuilder_ != null)) { + return exponentialBucketsBuilder_.getMessageOrBuilder(); + } else { + if (bucketOptionCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with exponentially growing width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets, + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder> + getExponentialBucketsFieldBuilder() { + if (exponentialBucketsBuilder_ == null) { + if (!(bucketOptionCase_ == 8)) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.getDefaultInstance(); + } + exponentialBucketsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets, + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder>( + (com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets) bucketOption_, + getParentForChildren(), + isClean()); + bucketOption_ = null; + } + bucketOptionCase_ = 8; + onChanged(); + ; + return exponentialBucketsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets, + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder> + explicitBucketsBuilder_; + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return Whether the explicitBuckets field is set. + */ + @java.lang.Override + public boolean hasExplicitBuckets() { + return bucketOptionCase_ == 9; + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return The explicitBuckets. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets getExplicitBuckets() { + if (explicitBucketsBuilder_ == null) { + if (bucketOptionCase_ == 9) { + return (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } else { + if (bucketOptionCase_ == 9) { + return explicitBucketsBuilder_.getMessage(); + } + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + public Builder setExplicitBuckets( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets value) { + if (explicitBucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucketOption_ = value; + onChanged(); + } else { + explicitBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 9; + return this; + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + public Builder setExplicitBuckets( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder builderForValue) { + if (explicitBucketsBuilder_ == null) { + bucketOption_ = builderForValue.build(); + onChanged(); + } else { + explicitBucketsBuilder_.setMessage(builderForValue.build()); + } + bucketOptionCase_ = 9; + return this; + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + public Builder mergeExplicitBuckets( + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets value) { + if (explicitBucketsBuilder_ == null) { + if (bucketOptionCase_ == 9 + && bucketOption_ + != com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets + .getDefaultInstance()) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.newBuilder( + (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_) + .mergeFrom(value) + .buildPartial(); + } else { + bucketOption_ = value; + } + onChanged(); + } else { + if (bucketOptionCase_ == 9) { + explicitBucketsBuilder_.mergeFrom(value); + } + explicitBucketsBuilder_.setMessage(value); + } + bucketOptionCase_ = 9; + return this; + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + public Builder clearExplicitBuckets() { + if (explicitBucketsBuilder_ == null) { + if (bucketOptionCase_ == 9) { + bucketOptionCase_ = 0; + bucketOption_ = null; + onChanged(); + } + } else { + if (bucketOptionCase_ == 9) { + bucketOptionCase_ = 0; + bucketOption_ = null; + } + explicitBucketsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + public com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder + getExplicitBucketsBuilder() { + return getExplicitBucketsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder + getExplicitBucketsOrBuilder() { + if ((bucketOptionCase_ == 9) && (explicitBucketsBuilder_ != null)) { + return explicitBucketsBuilder_.getMessageOrBuilder(); + } else { + if (bucketOptionCase_ == 9) { + return (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_; + } + return com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Buckets with arbitrary user-provided width.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets, + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder> + getExplicitBucketsFieldBuilder() { + if (explicitBucketsBuilder_ == null) { + if (!(bucketOptionCase_ == 9)) { + bucketOption_ = + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.getDefaultInstance(); + } + explicitBucketsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets, + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets.Builder, + com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder>( + (com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets) bucketOption_, + getParentForChildren(), + isClean()); + bucketOption_ = null; + } + bucketOptionCase_ = 9; + onChanged(); + ; + return explicitBucketsBuilder_; + } + + private java.util.List exemplars_ = + java.util.Collections.emptyList(); + + private void ensureExemplarsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + exemplars_ = new java.util.ArrayList(exemplars_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.Distribution.Exemplar, + com.google.api.Distribution.Exemplar.Builder, + com.google.api.Distribution.ExemplarOrBuilder> + exemplarsBuilder_; + + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public java.util.List getExemplarsList() { + if (exemplarsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exemplars_); + } else { + return exemplarsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public int getExemplarsCount() { + if (exemplarsBuilder_ == null) { + return exemplars_.size(); + } else { + return exemplarsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public com.google.api.Distribution.Exemplar getExemplars(int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); + } else { + return exemplarsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder setExemplars(int index, com.google.api.Distribution.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.set(index, value); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder setExemplars( + int index, com.google.api.Distribution.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.set(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder addExemplars(com.google.api.Distribution.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder addExemplars(int index, com.google.api.Distribution.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(index, value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder addExemplars(com.google.api.Distribution.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder addExemplars( + int index, com.google.api.Distribution.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder addAllExemplars( + java.lang.Iterable values) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exemplars_); + onChanged(); + } else { + exemplarsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder clearExemplars() { + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + exemplarsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public Builder removeExemplars(int index) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.remove(index); + onChanged(); + } else { + exemplarsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public com.google.api.Distribution.Exemplar.Builder getExemplarsBuilder(int index) { + return getExemplarsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); + } else { + return exemplarsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public java.util.List + getExemplarsOrBuilderList() { + if (exemplarsBuilder_ != null) { + return exemplarsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exemplars_); + } + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder() { + return getExemplarsFieldBuilder() + .addBuilder(com.google.api.Distribution.Exemplar.getDefaultInstance()); + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder(int index) { + return getExemplarsFieldBuilder() + .addBuilder(index, com.google.api.Distribution.Exemplar.getDefaultInstance()); + } + /** + * + * + *
+     * Example points. Must be in increasing order of `value` field.
+     * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + public java.util.List getExemplarsBuilderList() { + return getExemplarsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.Distribution.Exemplar, + com.google.api.Distribution.Exemplar.Builder, + com.google.api.Distribution.ExemplarOrBuilder> + getExemplarsFieldBuilder() { + if (exemplarsBuilder_ == null) { + exemplarsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.Distribution.Exemplar, + com.google.api.Distribution.Exemplar.Builder, + com.google.api.Distribution.ExemplarOrBuilder>( + exemplars_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + exemplars_ = null; + } + return exemplarsBuilder_; + } + + @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.api.servicecontrol.v1.Distribution) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.Distribution) + private static final com.google.api.servicecontrol.v1.Distribution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.Distribution(); + } + + public static com.google.api.servicecontrol.v1.Distribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Distribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Distribution(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.api.servicecontrol.v1.Distribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionOrBuilder.java new file mode 100644 index 00000000..e7c81618 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionOrBuilder.java @@ -0,0 +1,320 @@ +/* + * 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/api/servicecontrol/v1/distribution.proto + +package com.google.api.servicecontrol.v1; + +public interface DistributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.Distribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of samples in the distribution. Must be >= 0.
+   * 
+ * + * int64 count = 1; + * + * @return The count. + */ + long getCount(); + + /** + * + * + *
+   * The arithmetic mean of the samples in the distribution. If `count` is
+   * zero then this field must be zero.
+   * 
+ * + * double mean = 2; + * + * @return The mean. + */ + double getMean(); + + /** + * + * + *
+   * The minimum of the population of values. Ignored if `count` is zero.
+   * 
+ * + * double minimum = 3; + * + * @return The minimum. + */ + double getMinimum(); + + /** + * + * + *
+   * The maximum of the population of values. Ignored if `count` is zero.
+   * 
+ * + * double maximum = 4; + * + * @return The maximum. + */ + double getMaximum(); + + /** + * + * + *
+   * The sum of squared deviations from the mean:
+   *   Sum[i=1..count]((x_i - mean)^2)
+   * where each x_i is a sample values. If `count` is zero then this field
+   * must be zero, otherwise validation of the request fails.
+   * 
+ * + * double sum_of_squared_deviation = 5; + * + * @return The sumOfSquaredDeviation. + */ + double getSumOfSquaredDeviation(); + + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return A list containing the bucketCounts. + */ + java.util.List getBucketCountsList(); + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @return The count of bucketCounts. + */ + int getBucketCountsCount(); + /** + * + * + *
+   * The number of samples in each histogram bucket. `bucket_counts` are
+   * optional. If present, they must sum to the `count` value.
+   * The buckets are defined below in `bucket_option`. There are N buckets.
+   * `bucket_counts[0]` is the number of samples in the underflow bucket.
+   * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
+   * in each of the finite buckets. And `bucket_counts[N] is the number
+   * of samples in the overflow bucket. See the comments of `bucket_option`
+   * below for more details.
+   * Any suffix of trailing zeros may be omitted.
+   * 
+ * + * repeated int64 bucket_counts = 6; + * + * @param index The index of the element to return. + * @return The bucketCounts at the given index. + */ + long getBucketCounts(int index); + + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return Whether the linearBuckets field is set. + */ + boolean hasLinearBuckets(); + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + * + * @return The linearBuckets. + */ + com.google.api.servicecontrol.v1.Distribution.LinearBuckets getLinearBuckets(); + /** + * + * + *
+   * Buckets with constant width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7; + */ + com.google.api.servicecontrol.v1.Distribution.LinearBucketsOrBuilder getLinearBucketsOrBuilder(); + + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return Whether the exponentialBuckets field is set. + */ + boolean hasExponentialBuckets(); + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + * + * @return The exponentialBuckets. + */ + com.google.api.servicecontrol.v1.Distribution.ExponentialBuckets getExponentialBuckets(); + /** + * + * + *
+   * Buckets with exponentially growing width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8; + * + */ + com.google.api.servicecontrol.v1.Distribution.ExponentialBucketsOrBuilder + getExponentialBucketsOrBuilder(); + + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return Whether the explicitBuckets field is set. + */ + boolean hasExplicitBuckets(); + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + * + * @return The explicitBuckets. + */ + com.google.api.servicecontrol.v1.Distribution.ExplicitBuckets getExplicitBuckets(); + /** + * + * + *
+   * Buckets with arbitrary user-provided width.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9; + */ + com.google.api.servicecontrol.v1.Distribution.ExplicitBucketsOrBuilder + getExplicitBucketsOrBuilder(); + + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + java.util.List getExemplarsList(); + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + com.google.api.Distribution.Exemplar getExemplars(int index); + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + int getExemplarsCount(); + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + java.util.List + getExemplarsOrBuilderList(); + /** + * + * + *
+   * Example points. Must be in increasing order of `value` field.
+   * 
+ * + * repeated .google.api.Distribution.Exemplar exemplars = 10; + */ + com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int index); + + public com.google.api.servicecontrol.v1.Distribution.BucketOptionCase getBucketOptionCase(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionProto.java new file mode 100644 index 00000000..4315e673 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/DistributionProto.java @@ -0,0 +1,140 @@ +/* + * 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/api/servicecontrol/v1/distribution.proto + +package com.google.api.servicecontrol.v1; + +public final class DistributionProto { + private DistributionProto() {} + + 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_api_servicecontrol_v1_Distribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Distribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_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/api/servicecontrol/v1/distribut" + + "ion.proto\022\034google.api.servicecontrol.v1\032" + + "\035google/api/distribution.proto\"\236\005\n\014Distr" + + "ibution\022\r\n\005count\030\001 \001(\003\022\014\n\004mean\030\002 \001(\001\022\017\n\007" + + "minimum\030\003 \001(\001\022\017\n\007maximum\030\004 \001(\001\022 \n\030sum_of" + + "_squared_deviation\030\005 \001(\001\022\025\n\rbucket_count" + + "s\030\006 \003(\003\022R\n\016linear_buckets\030\007 \001(\01328.google" + + ".api.servicecontrol.v1.Distribution.Line" + + "arBucketsH\000\022\\\n\023exponential_buckets\030\010 \001(\013" + + "2=.google.api.servicecontrol.v1.Distribu" + + "tion.ExponentialBucketsH\000\022V\n\020explicit_bu" + + "ckets\030\t \001(\0132:.google.api.servicecontrol." + + "v1.Distribution.ExplicitBucketsH\000\0224\n\texe" + + "mplars\030\n \003(\0132!.google.api.Distribution.E" + + "xemplar\032J\n\rLinearBuckets\022\032\n\022num_finite_b" + + "uckets\030\001 \001(\005\022\r\n\005width\030\002 \001(\001\022\016\n\006offset\030\003 " + + "\001(\001\032V\n\022ExponentialBuckets\022\032\n\022num_finite_" + + "buckets\030\001 \001(\005\022\025\n\rgrowth_factor\030\002 \001(\001\022\r\n\005" + + "scale\030\003 \001(\001\032!\n\017ExplicitBuckets\022\016\n\006bounds" + + "\030\001 \003(\001B\017\n\rbucket_optionB\354\001\n com.google.a" + + "pi.servicecontrol.v1B\021DistributionProtoP" + + "\001ZJgoogle.golang.org/genproto/googleapis" + + "/api/servicecontrol/v1;servicecontrol\370\001\001" + + "\252\002\036Google.Cloud.ServiceControl.V1\312\002\036Goog" + + "le\\Cloud\\ServiceControl\\V1\352\002!Google::Clo" + + "ud::ServiceControl::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.DistributionProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_Distribution_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_Distribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Distribution_descriptor, + new java.lang.String[] { + "Count", + "Mean", + "Minimum", + "Maximum", + "SumOfSquaredDeviation", + "BucketCounts", + "LinearBuckets", + "ExponentialBuckets", + "ExplicitBuckets", + "Exemplars", + "BucketOption", + }); + internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor = + internal_static_google_api_servicecontrol_v1_Distribution_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Distribution_LinearBuckets_descriptor, + new java.lang.String[] { + "NumFiniteBuckets", "Width", "Offset", + }); + internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor = + internal_static_google_api_servicecontrol_v1_Distribution_descriptor + .getNestedTypes() + .get(1); + internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Distribution_ExponentialBuckets_descriptor, + new java.lang.String[] { + "NumFiniteBuckets", "GrowthFactor", "Scale", + }); + internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor = + internal_static_google_api_servicecontrol_v1_Distribution_descriptor + .getNestedTypes() + .get(2); + internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Distribution_ExplicitBuckets_descriptor, + new java.lang.String[] { + "Bounds", + }); + com.google.api.DistributionProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequest.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequest.java new file mode 100644 index 00000000..084bc394 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequest.java @@ -0,0 +1,2710 @@ +/* + * 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/api/servicecontrol/v1/http_request.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * A common proto for logging HTTP requests. Only contains semantics
+ * defined by the HTTP specification. Product-specific logging
+ * information MUST be defined in a separate message.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.HttpRequest} + */ +public final class HttpRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.HttpRequest) + HttpRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use HttpRequest.newBuilder() to construct. + private HttpRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HttpRequest() { + requestMethod_ = ""; + requestUrl_ = ""; + userAgent_ = ""; + remoteIp_ = ""; + serverIp_ = ""; + referer_ = ""; + protocol_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HttpRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HttpRequest( + 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(); + + requestMethod_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestUrl_ = s; + break; + } + case 24: + { + requestSize_ = input.readInt64(); + break; + } + case 32: + { + status_ = input.readInt32(); + break; + } + case 40: + { + responseSize_ = input.readInt64(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + remoteIp_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + referer_ = s; + break; + } + case 72: + { + cacheHit_ = input.readBool(); + break; + } + case 80: + { + cacheValidatedWithOriginServer_ = input.readBool(); + break; + } + case 88: + { + cacheLookup_ = input.readBool(); + break; + } + case 96: + { + cacheFillBytes_ = input.readInt64(); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + serverIp_ = s; + break; + } + case 114: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (latency_ != null) { + subBuilder = latency_.toBuilder(); + } + latency_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latency_); + latency_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + protocol_ = 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.api.servicecontrol.v1.HttpRequestProto + .internal_static_google_api_servicecontrol_v1_HttpRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.HttpRequestProto + .internal_static_google_api_servicecontrol_v1_HttpRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.HttpRequest.class, + com.google.api.servicecontrol.v1.HttpRequest.Builder.class); + } + + public static final int REQUEST_METHOD_FIELD_NUMBER = 1; + private volatile java.lang.Object requestMethod_; + /** + * + * + *
+   * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+   * 
+ * + * string request_method = 1; + * + * @return The requestMethod. + */ + @java.lang.Override + public java.lang.String getRequestMethod() { + java.lang.Object ref = requestMethod_; + 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(); + requestMethod_ = s; + return s; + } + } + /** + * + * + *
+   * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+   * 
+ * + * string request_method = 1; + * + * @return The bytes for requestMethod. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestMethodBytes() { + java.lang.Object ref = requestMethod_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_URL_FIELD_NUMBER = 2; + private volatile java.lang.Object requestUrl_; + /** + * + * + *
+   * The scheme (http, https), the host name, the path, and the query
+   * portion of the URL that was requested.
+   * Example: `"http://example.com/some/info?color=red"`.
+   * 
+ * + * string request_url = 2; + * + * @return The requestUrl. + */ + @java.lang.Override + public java.lang.String getRequestUrl() { + java.lang.Object ref = requestUrl_; + 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(); + requestUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The scheme (http, https), the host name, the path, and the query
+   * portion of the URL that was requested.
+   * Example: `"http://example.com/some/info?color=red"`.
+   * 
+ * + * string request_url = 2; + * + * @return The bytes for requestUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestUrlBytes() { + java.lang.Object ref = requestUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_SIZE_FIELD_NUMBER = 3; + private long requestSize_; + /** + * + * + *
+   * The size of the HTTP request message in bytes, including the request
+   * headers and the request body.
+   * 
+ * + * int64 request_size = 3; + * + * @return The requestSize. + */ + @java.lang.Override + public long getRequestSize() { + return requestSize_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private int status_; + /** + * + * + *
+   * The response code indicating the status of the response.
+   * Examples: 200, 404.
+   * 
+ * + * int32 status = 4; + * + * @return The status. + */ + @java.lang.Override + public int getStatus() { + return status_; + } + + public static final int RESPONSE_SIZE_FIELD_NUMBER = 5; + private long responseSize_; + /** + * + * + *
+   * The size of the HTTP response message sent back to the client, in bytes,
+   * including the response headers and the response body.
+   * 
+ * + * int64 response_size = 5; + * + * @return The responseSize. + */ + @java.lang.Override + public long getResponseSize() { + return responseSize_; + } + + public static final int USER_AGENT_FIELD_NUMBER = 6; + private volatile java.lang.Object userAgent_; + /** + * + * + *
+   * The user agent sent by the client. Example:
+   * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+   * CLR 1.0.3705)"`.
+   * 
+ * + * string user_agent = 6; + * + * @return The userAgent. + */ + @java.lang.Override + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + 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(); + userAgent_ = s; + return s; + } + } + /** + * + * + *
+   * The user agent sent by the client. Example:
+   * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+   * CLR 1.0.3705)"`.
+   * 
+ * + * string user_agent = 6; + * + * @return The bytes for userAgent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMOTE_IP_FIELD_NUMBER = 7; + private volatile java.lang.Object remoteIp_; + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+   * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+   * 
+ * + * string remote_ip = 7; + * + * @return The remoteIp. + */ + @java.lang.Override + public java.lang.String getRemoteIp() { + java.lang.Object ref = remoteIp_; + 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(); + remoteIp_ = s; + return s; + } + } + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+   * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+   * 
+ * + * string remote_ip = 7; + * + * @return The bytes for remoteIp. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRemoteIpBytes() { + java.lang.Object ref = remoteIp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remoteIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_IP_FIELD_NUMBER = 13; + private volatile java.lang.Object serverIp_; + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the origin server that the request was
+   * sent to.
+   * 
+ * + * string server_ip = 13; + * + * @return The serverIp. + */ + @java.lang.Override + public java.lang.String getServerIp() { + java.lang.Object ref = serverIp_; + 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(); + serverIp_ = s; + return s; + } + } + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the origin server that the request was
+   * sent to.
+   * 
+ * + * string server_ip = 13; + * + * @return The bytes for serverIp. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerIpBytes() { + java.lang.Object ref = serverIp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERER_FIELD_NUMBER = 8; + private volatile java.lang.Object referer_; + /** + * + * + *
+   * The referer URL of the request, as defined in
+   * [HTTP/1.1 Header Field
+   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+   * 
+ * + * string referer = 8; + * + * @return The referer. + */ + @java.lang.Override + public java.lang.String getReferer() { + java.lang.Object ref = referer_; + 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(); + referer_ = s; + return s; + } + } + /** + * + * + *
+   * The referer URL of the request, as defined in
+   * [HTTP/1.1 Header Field
+   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+   * 
+ * + * string referer = 8; + * + * @return The bytes for referer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRefererBytes() { + java.lang.Object ref = referer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LATENCY_FIELD_NUMBER = 14; + private com.google.protobuf.Duration latency_; + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return Whether the latency field is set. + */ + @java.lang.Override + public boolean hasLatency() { + return latency_ != null; + } + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return The latency. + */ + @java.lang.Override + public com.google.protobuf.Duration getLatency() { + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; + } + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { + return getLatency(); + } + + public static final int CACHE_LOOKUP_FIELD_NUMBER = 11; + private boolean cacheLookup_; + /** + * + * + *
+   * Whether or not a cache lookup was attempted.
+   * 
+ * + * bool cache_lookup = 11; + * + * @return The cacheLookup. + */ + @java.lang.Override + public boolean getCacheLookup() { + return cacheLookup_; + } + + public static final int CACHE_HIT_FIELD_NUMBER = 9; + private boolean cacheHit_; + /** + * + * + *
+   * Whether or not an entity was served from cache
+   * (with or without validation).
+   * 
+ * + * bool cache_hit = 9; + * + * @return The cacheHit. + */ + @java.lang.Override + public boolean getCacheHit() { + return cacheHit_; + } + + public static final int CACHE_VALIDATED_WITH_ORIGIN_SERVER_FIELD_NUMBER = 10; + private boolean cacheValidatedWithOriginServer_; + /** + * + * + *
+   * Whether or not the response was validated with the origin server before
+   * being served from cache. This field is only meaningful if `cache_hit` is
+   * True.
+   * 
+ * + * bool cache_validated_with_origin_server = 10; + * + * @return The cacheValidatedWithOriginServer. + */ + @java.lang.Override + public boolean getCacheValidatedWithOriginServer() { + return cacheValidatedWithOriginServer_; + } + + public static final int CACHE_FILL_BYTES_FIELD_NUMBER = 12; + private long cacheFillBytes_; + /** + * + * + *
+   * The number of HTTP response bytes inserted into cache. Set only when a
+   * cache fill was attempted.
+   * 
+ * + * int64 cache_fill_bytes = 12; + * + * @return The cacheFillBytes. + */ + @java.lang.Override + public long getCacheFillBytes() { + return cacheFillBytes_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 15; + private volatile java.lang.Object protocol_; + /** + * + * + *
+   * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+   * 
+ * + * string protocol = 15; + * + * @return The protocol. + */ + @java.lang.Override + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + 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(); + protocol_ = s; + return s; + } + } + /** + * + * + *
+   * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+   * 
+ * + * string protocol = 15; + * + * @return The bytes for protocol. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + protocol_ = 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 (!getRequestMethodBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestMethod_); + } + if (!getRequestUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestUrl_); + } + if (requestSize_ != 0L) { + output.writeInt64(3, requestSize_); + } + if (status_ != 0) { + output.writeInt32(4, status_); + } + if (responseSize_ != 0L) { + output.writeInt64(5, responseSize_); + } + if (!getUserAgentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, userAgent_); + } + if (!getRemoteIpBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, remoteIp_); + } + if (!getRefererBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, referer_); + } + if (cacheHit_ != false) { + output.writeBool(9, cacheHit_); + } + if (cacheValidatedWithOriginServer_ != false) { + output.writeBool(10, cacheValidatedWithOriginServer_); + } + if (cacheLookup_ != false) { + output.writeBool(11, cacheLookup_); + } + if (cacheFillBytes_ != 0L) { + output.writeInt64(12, cacheFillBytes_); + } + if (!getServerIpBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, serverIp_); + } + if (latency_ != null) { + output.writeMessage(14, getLatency()); + } + if (!getProtocolBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, protocol_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRequestMethodBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestMethod_); + } + if (!getRequestUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestUrl_); + } + if (requestSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, requestSize_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, status_); + } + if (responseSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, responseSize_); + } + if (!getUserAgentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, userAgent_); + } + if (!getRemoteIpBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, remoteIp_); + } + if (!getRefererBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, referer_); + } + if (cacheHit_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, cacheHit_); + } + if (cacheValidatedWithOriginServer_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 10, cacheValidatedWithOriginServer_); + } + if (cacheLookup_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, cacheLookup_); + } + if (cacheFillBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(12, cacheFillBytes_); + } + if (!getServerIpBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, serverIp_); + } + if (latency_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getLatency()); + } + if (!getProtocolBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, protocol_); + } + 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.api.servicecontrol.v1.HttpRequest)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.HttpRequest other = + (com.google.api.servicecontrol.v1.HttpRequest) obj; + + if (!getRequestMethod().equals(other.getRequestMethod())) return false; + if (!getRequestUrl().equals(other.getRequestUrl())) return false; + if (getRequestSize() != other.getRequestSize()) return false; + if (getStatus() != other.getStatus()) return false; + if (getResponseSize() != other.getResponseSize()) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (!getRemoteIp().equals(other.getRemoteIp())) return false; + if (!getServerIp().equals(other.getServerIp())) return false; + if (!getReferer().equals(other.getReferer())) return false; + if (hasLatency() != other.hasLatency()) return false; + if (hasLatency()) { + if (!getLatency().equals(other.getLatency())) return false; + } + if (getCacheLookup() != other.getCacheLookup()) return false; + if (getCacheHit() != other.getCacheHit()) return false; + if (getCacheValidatedWithOriginServer() != other.getCacheValidatedWithOriginServer()) + return false; + if (getCacheFillBytes() != other.getCacheFillBytes()) return false; + if (!getProtocol().equals(other.getProtocol())) 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) + REQUEST_METHOD_FIELD_NUMBER; + hash = (53 * hash) + getRequestMethod().hashCode(); + hash = (37 * hash) + REQUEST_URL_FIELD_NUMBER; + hash = (53 * hash) + getRequestUrl().hashCode(); + hash = (37 * hash) + REQUEST_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestSize()); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (37 * hash) + RESPONSE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResponseSize()); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + REMOTE_IP_FIELD_NUMBER; + hash = (53 * hash) + getRemoteIp().hashCode(); + hash = (37 * hash) + SERVER_IP_FIELD_NUMBER; + hash = (53 * hash) + getServerIp().hashCode(); + hash = (37 * hash) + REFERER_FIELD_NUMBER; + hash = (53 * hash) + getReferer().hashCode(); + if (hasLatency()) { + hash = (37 * hash) + LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getLatency().hashCode(); + } + hash = (37 * hash) + CACHE_LOOKUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCacheLookup()); + hash = (37 * hash) + CACHE_HIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCacheHit()); + hash = (37 * hash) + CACHE_VALIDATED_WITH_ORIGIN_SERVER_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCacheValidatedWithOriginServer()); + hash = (37 * hash) + CACHE_FILL_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCacheFillBytes()); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.HttpRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.HttpRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.HttpRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.HttpRequest 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.api.servicecontrol.v1.HttpRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.HttpRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.HttpRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.HttpRequest 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.api.servicecontrol.v1.HttpRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.HttpRequest 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.api.servicecontrol.v1.HttpRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.HttpRequest 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.api.servicecontrol.v1.HttpRequest 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 common proto for logging HTTP requests. Only contains semantics
+   * defined by the HTTP specification. Product-specific logging
+   * information MUST be defined in a separate message.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.HttpRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.HttpRequest) + com.google.api.servicecontrol.v1.HttpRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.HttpRequestProto + .internal_static_google_api_servicecontrol_v1_HttpRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.HttpRequestProto + .internal_static_google_api_servicecontrol_v1_HttpRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.HttpRequest.class, + com.google.api.servicecontrol.v1.HttpRequest.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.HttpRequest.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(); + requestMethod_ = ""; + + requestUrl_ = ""; + + requestSize_ = 0L; + + status_ = 0; + + responseSize_ = 0L; + + userAgent_ = ""; + + remoteIp_ = ""; + + serverIp_ = ""; + + referer_ = ""; + + if (latencyBuilder_ == null) { + latency_ = null; + } else { + latency_ = null; + latencyBuilder_ = null; + } + cacheLookup_ = false; + + cacheHit_ = false; + + cacheValidatedWithOriginServer_ = false; + + cacheFillBytes_ = 0L; + + protocol_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.HttpRequestProto + .internal_static_google_api_servicecontrol_v1_HttpRequest_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.HttpRequest getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.HttpRequest build() { + com.google.api.servicecontrol.v1.HttpRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.HttpRequest buildPartial() { + com.google.api.servicecontrol.v1.HttpRequest result = + new com.google.api.servicecontrol.v1.HttpRequest(this); + result.requestMethod_ = requestMethod_; + result.requestUrl_ = requestUrl_; + result.requestSize_ = requestSize_; + result.status_ = status_; + result.responseSize_ = responseSize_; + result.userAgent_ = userAgent_; + result.remoteIp_ = remoteIp_; + result.serverIp_ = serverIp_; + result.referer_ = referer_; + if (latencyBuilder_ == null) { + result.latency_ = latency_; + } else { + result.latency_ = latencyBuilder_.build(); + } + result.cacheLookup_ = cacheLookup_; + result.cacheHit_ = cacheHit_; + result.cacheValidatedWithOriginServer_ = cacheValidatedWithOriginServer_; + result.cacheFillBytes_ = cacheFillBytes_; + result.protocol_ = protocol_; + 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.api.servicecontrol.v1.HttpRequest) { + return mergeFrom((com.google.api.servicecontrol.v1.HttpRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.HttpRequest other) { + if (other == com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance()) return this; + if (!other.getRequestMethod().isEmpty()) { + requestMethod_ = other.requestMethod_; + onChanged(); + } + if (!other.getRequestUrl().isEmpty()) { + requestUrl_ = other.requestUrl_; + onChanged(); + } + if (other.getRequestSize() != 0L) { + setRequestSize(other.getRequestSize()); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + if (other.getResponseSize() != 0L) { + setResponseSize(other.getResponseSize()); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (!other.getRemoteIp().isEmpty()) { + remoteIp_ = other.remoteIp_; + onChanged(); + } + if (!other.getServerIp().isEmpty()) { + serverIp_ = other.serverIp_; + onChanged(); + } + if (!other.getReferer().isEmpty()) { + referer_ = other.referer_; + onChanged(); + } + if (other.hasLatency()) { + mergeLatency(other.getLatency()); + } + if (other.getCacheLookup() != false) { + setCacheLookup(other.getCacheLookup()); + } + if (other.getCacheHit() != false) { + setCacheHit(other.getCacheHit()); + } + if (other.getCacheValidatedWithOriginServer() != false) { + setCacheValidatedWithOriginServer(other.getCacheValidatedWithOriginServer()); + } + if (other.getCacheFillBytes() != 0L) { + setCacheFillBytes(other.getCacheFillBytes()); + } + if (!other.getProtocol().isEmpty()) { + protocol_ = other.protocol_; + 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.api.servicecontrol.v1.HttpRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.HttpRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object requestMethod_ = ""; + /** + * + * + *
+     * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+     * 
+ * + * string request_method = 1; + * + * @return The requestMethod. + */ + public java.lang.String getRequestMethod() { + java.lang.Object ref = requestMethod_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestMethod_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+     * 
+ * + * string request_method = 1; + * + * @return The bytes for requestMethod. + */ + public com.google.protobuf.ByteString getRequestMethodBytes() { + java.lang.Object ref = requestMethod_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+     * 
+ * + * string request_method = 1; + * + * @param value The requestMethod to set. + * @return This builder for chaining. + */ + public Builder setRequestMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+     * 
+ * + * string request_method = 1; + * + * @return This builder for chaining. + */ + public Builder clearRequestMethod() { + + requestMethod_ = getDefaultInstance().getRequestMethod(); + onChanged(); + return this; + } + /** + * + * + *
+     * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+     * 
+ * + * string request_method = 1; + * + * @param value The bytes for requestMethod to set. + * @return This builder for chaining. + */ + public Builder setRequestMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestMethod_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestUrl_ = ""; + /** + * + * + *
+     * The scheme (http, https), the host name, the path, and the query
+     * portion of the URL that was requested.
+     * Example: `"http://example.com/some/info?color=red"`.
+     * 
+ * + * string request_url = 2; + * + * @return The requestUrl. + */ + public java.lang.String getRequestUrl() { + java.lang.Object ref = requestUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The scheme (http, https), the host name, the path, and the query
+     * portion of the URL that was requested.
+     * Example: `"http://example.com/some/info?color=red"`.
+     * 
+ * + * string request_url = 2; + * + * @return The bytes for requestUrl. + */ + public com.google.protobuf.ByteString getRequestUrlBytes() { + java.lang.Object ref = requestUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The scheme (http, https), the host name, the path, and the query
+     * portion of the URL that was requested.
+     * Example: `"http://example.com/some/info?color=red"`.
+     * 
+ * + * string request_url = 2; + * + * @param value The requestUrl to set. + * @return This builder for chaining. + */ + public Builder setRequestUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The scheme (http, https), the host name, the path, and the query
+     * portion of the URL that was requested.
+     * Example: `"http://example.com/some/info?color=red"`.
+     * 
+ * + * string request_url = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestUrl() { + + requestUrl_ = getDefaultInstance().getRequestUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The scheme (http, https), the host name, the path, and the query
+     * portion of the URL that was requested.
+     * Example: `"http://example.com/some/info?color=red"`.
+     * 
+ * + * string request_url = 2; + * + * @param value The bytes for requestUrl to set. + * @return This builder for chaining. + */ + public Builder setRequestUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestUrl_ = value; + onChanged(); + return this; + } + + private long requestSize_; + /** + * + * + *
+     * The size of the HTTP request message in bytes, including the request
+     * headers and the request body.
+     * 
+ * + * int64 request_size = 3; + * + * @return The requestSize. + */ + @java.lang.Override + public long getRequestSize() { + return requestSize_; + } + /** + * + * + *
+     * The size of the HTTP request message in bytes, including the request
+     * headers and the request body.
+     * 
+ * + * int64 request_size = 3; + * + * @param value The requestSize to set. + * @return This builder for chaining. + */ + public Builder setRequestSize(long value) { + + requestSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the HTTP request message in bytes, including the request
+     * headers and the request body.
+     * 
+ * + * int64 request_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestSize() { + + requestSize_ = 0L; + onChanged(); + return this; + } + + private int status_; + /** + * + * + *
+     * The response code indicating the status of the response.
+     * Examples: 200, 404.
+     * 
+ * + * int32 status = 4; + * + * @return The status. + */ + @java.lang.Override + public int getStatus() { + return status_; + } + /** + * + * + *
+     * The response code indicating the status of the response.
+     * Examples: 200, 404.
+     * 
+ * + * int32 status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The response code indicating the status of the response.
+     * Examples: 200, 404.
+     * 
+ * + * int32 status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + + private long responseSize_; + /** + * + * + *
+     * The size of the HTTP response message sent back to the client, in bytes,
+     * including the response headers and the response body.
+     * 
+ * + * int64 response_size = 5; + * + * @return The responseSize. + */ + @java.lang.Override + public long getResponseSize() { + return responseSize_; + } + /** + * + * + *
+     * The size of the HTTP response message sent back to the client, in bytes,
+     * including the response headers and the response body.
+     * 
+ * + * int64 response_size = 5; + * + * @param value The responseSize to set. + * @return This builder for chaining. + */ + public Builder setResponseSize(long value) { + + responseSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the HTTP response message sent back to the client, in bytes,
+     * including the response headers and the response body.
+     * 
+ * + * int64 response_size = 5; + * + * @return This builder for chaining. + */ + public Builder clearResponseSize() { + + responseSize_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * The user agent sent by the client. Example:
+     * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+     * CLR 1.0.3705)"`.
+     * 
+ * + * string user_agent = 6; + * + * @return The userAgent. + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user agent sent by the client. Example:
+     * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+     * CLR 1.0.3705)"`.
+     * 
+ * + * string user_agent = 6; + * + * @return The bytes for userAgent. + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user agent sent by the client. Example:
+     * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+     * CLR 1.0.3705)"`.
+     * 
+ * + * string user_agent = 6; + * + * @param value The userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user agent sent by the client. Example:
+     * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+     * CLR 1.0.3705)"`.
+     * 
+ * + * string user_agent = 6; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user agent sent by the client. Example:
+     * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+     * CLR 1.0.3705)"`.
+     * 
+ * + * string user_agent = 6; + * + * @param value The bytes for userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private java.lang.Object remoteIp_ = ""; + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+     * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+     * 
+ * + * string remote_ip = 7; + * + * @return The remoteIp. + */ + public java.lang.String getRemoteIp() { + java.lang.Object ref = remoteIp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteIp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+     * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+     * 
+ * + * string remote_ip = 7; + * + * @return The bytes for remoteIp. + */ + public com.google.protobuf.ByteString getRemoteIpBytes() { + java.lang.Object ref = remoteIp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remoteIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+     * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+     * 
+ * + * string remote_ip = 7; + * + * @param value The remoteIp to set. + * @return This builder for chaining. + */ + public Builder setRemoteIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remoteIp_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+     * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+     * 
+ * + * string remote_ip = 7; + * + * @return This builder for chaining. + */ + public Builder clearRemoteIp() { + + remoteIp_ = getDefaultInstance().getRemoteIp(); + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+     * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+     * 
+ * + * string remote_ip = 7; + * + * @param value The bytes for remoteIp to set. + * @return This builder for chaining. + */ + public Builder setRemoteIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remoteIp_ = value; + onChanged(); + return this; + } + + private java.lang.Object serverIp_ = ""; + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the origin server that the request was
+     * sent to.
+     * 
+ * + * string server_ip = 13; + * + * @return The serverIp. + */ + public java.lang.String getServerIp() { + java.lang.Object ref = serverIp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverIp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the origin server that the request was
+     * sent to.
+     * 
+ * + * string server_ip = 13; + * + * @return The bytes for serverIp. + */ + public com.google.protobuf.ByteString getServerIpBytes() { + java.lang.Object ref = serverIp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverIp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the origin server that the request was
+     * sent to.
+     * 
+ * + * string server_ip = 13; + * + * @param value The serverIp to set. + * @return This builder for chaining. + */ + public Builder setServerIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serverIp_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the origin server that the request was
+     * sent to.
+     * 
+ * + * string server_ip = 13; + * + * @return This builder for chaining. + */ + public Builder clearServerIp() { + + serverIp_ = getDefaultInstance().getServerIp(); + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address (IPv4 or IPv6) of the origin server that the request was
+     * sent to.
+     * 
+ * + * string server_ip = 13; + * + * @param value The bytes for serverIp to set. + * @return This builder for chaining. + */ + public Builder setServerIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serverIp_ = value; + onChanged(); + return this; + } + + private java.lang.Object referer_ = ""; + /** + * + * + *
+     * The referer URL of the request, as defined in
+     * [HTTP/1.1 Header Field
+     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+     * 
+ * + * string referer = 8; + * + * @return The referer. + */ + public java.lang.String getReferer() { + java.lang.Object ref = referer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The referer URL of the request, as defined in
+     * [HTTP/1.1 Header Field
+     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+     * 
+ * + * string referer = 8; + * + * @return The bytes for referer. + */ + public com.google.protobuf.ByteString getRefererBytes() { + java.lang.Object ref = referer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The referer URL of the request, as defined in
+     * [HTTP/1.1 Header Field
+     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+     * 
+ * + * string referer = 8; + * + * @param value The referer to set. + * @return This builder for chaining. + */ + public Builder setReferer(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The referer URL of the request, as defined in
+     * [HTTP/1.1 Header Field
+     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+     * 
+ * + * string referer = 8; + * + * @return This builder for chaining. + */ + public Builder clearReferer() { + + referer_ = getDefaultInstance().getReferer(); + onChanged(); + return this; + } + /** + * + * + *
+     * The referer URL of the request, as defined in
+     * [HTTP/1.1 Header Field
+     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+     * 
+ * + * string referer = 8; + * + * @param value The bytes for referer to set. + * @return This builder for chaining. + */ + public Builder setRefererBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referer_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration latency_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + latencyBuilder_; + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return Whether the latency field is set. + */ + public boolean hasLatency() { + return latencyBuilder_ != null || latency_ != null; + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return The latency. + */ + public com.google.protobuf.Duration getLatency() { + if (latencyBuilder_ == null) { + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; + } else { + return latencyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public Builder setLatency(com.google.protobuf.Duration value) { + if (latencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latency_ = value; + onChanged(); + } else { + latencyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public Builder setLatency(com.google.protobuf.Duration.Builder builderForValue) { + if (latencyBuilder_ == null) { + latency_ = builderForValue.build(); + onChanged(); + } else { + latencyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public Builder mergeLatency(com.google.protobuf.Duration value) { + if (latencyBuilder_ == null) { + if (latency_ != null) { + latency_ = + com.google.protobuf.Duration.newBuilder(latency_).mergeFrom(value).buildPartial(); + } else { + latency_ = value; + } + onChanged(); + } else { + latencyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public Builder clearLatency() { + if (latencyBuilder_ == null) { + latency_ = null; + onChanged(); + } else { + latency_ = null; + latencyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public com.google.protobuf.Duration.Builder getLatencyBuilder() { + + onChanged(); + return getLatencyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { + if (latencyBuilder_ != null) { + return latencyBuilder_.getMessageOrBuilder(); + } else { + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; + } + } + /** + * + * + *
+     * The request processing latency on the server, from the time the request was
+     * received until the response was sent.
+     * 
+ * + * .google.protobuf.Duration latency = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getLatencyFieldBuilder() { + if (latencyBuilder_ == null) { + latencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getLatency(), getParentForChildren(), isClean()); + latency_ = null; + } + return latencyBuilder_; + } + + private boolean cacheLookup_; + /** + * + * + *
+     * Whether or not a cache lookup was attempted.
+     * 
+ * + * bool cache_lookup = 11; + * + * @return The cacheLookup. + */ + @java.lang.Override + public boolean getCacheLookup() { + return cacheLookup_; + } + /** + * + * + *
+     * Whether or not a cache lookup was attempted.
+     * 
+ * + * bool cache_lookup = 11; + * + * @param value The cacheLookup to set. + * @return This builder for chaining. + */ + public Builder setCacheLookup(boolean value) { + + cacheLookup_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether or not a cache lookup was attempted.
+     * 
+ * + * bool cache_lookup = 11; + * + * @return This builder for chaining. + */ + public Builder clearCacheLookup() { + + cacheLookup_ = false; + onChanged(); + return this; + } + + private boolean cacheHit_; + /** + * + * + *
+     * Whether or not an entity was served from cache
+     * (with or without validation).
+     * 
+ * + * bool cache_hit = 9; + * + * @return The cacheHit. + */ + @java.lang.Override + public boolean getCacheHit() { + return cacheHit_; + } + /** + * + * + *
+     * Whether or not an entity was served from cache
+     * (with or without validation).
+     * 
+ * + * bool cache_hit = 9; + * + * @param value The cacheHit to set. + * @return This builder for chaining. + */ + public Builder setCacheHit(boolean value) { + + cacheHit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether or not an entity was served from cache
+     * (with or without validation).
+     * 
+ * + * bool cache_hit = 9; + * + * @return This builder for chaining. + */ + public Builder clearCacheHit() { + + cacheHit_ = false; + onChanged(); + return this; + } + + private boolean cacheValidatedWithOriginServer_; + /** + * + * + *
+     * Whether or not the response was validated with the origin server before
+     * being served from cache. This field is only meaningful if `cache_hit` is
+     * True.
+     * 
+ * + * bool cache_validated_with_origin_server = 10; + * + * @return The cacheValidatedWithOriginServer. + */ + @java.lang.Override + public boolean getCacheValidatedWithOriginServer() { + return cacheValidatedWithOriginServer_; + } + /** + * + * + *
+     * Whether or not the response was validated with the origin server before
+     * being served from cache. This field is only meaningful if `cache_hit` is
+     * True.
+     * 
+ * + * bool cache_validated_with_origin_server = 10; + * + * @param value The cacheValidatedWithOriginServer to set. + * @return This builder for chaining. + */ + public Builder setCacheValidatedWithOriginServer(boolean value) { + + cacheValidatedWithOriginServer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether or not the response was validated with the origin server before
+     * being served from cache. This field is only meaningful if `cache_hit` is
+     * True.
+     * 
+ * + * bool cache_validated_with_origin_server = 10; + * + * @return This builder for chaining. + */ + public Builder clearCacheValidatedWithOriginServer() { + + cacheValidatedWithOriginServer_ = false; + onChanged(); + return this; + } + + private long cacheFillBytes_; + /** + * + * + *
+     * The number of HTTP response bytes inserted into cache. Set only when a
+     * cache fill was attempted.
+     * 
+ * + * int64 cache_fill_bytes = 12; + * + * @return The cacheFillBytes. + */ + @java.lang.Override + public long getCacheFillBytes() { + return cacheFillBytes_; + } + /** + * + * + *
+     * The number of HTTP response bytes inserted into cache. Set only when a
+     * cache fill was attempted.
+     * 
+ * + * int64 cache_fill_bytes = 12; + * + * @param value The cacheFillBytes to set. + * @return This builder for chaining. + */ + public Builder setCacheFillBytes(long value) { + + cacheFillBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of HTTP response bytes inserted into cache. Set only when a
+     * cache fill was attempted.
+     * 
+ * + * int64 cache_fill_bytes = 12; + * + * @return This builder for chaining. + */ + public Builder clearCacheFillBytes() { + + cacheFillBytes_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object protocol_ = ""; + /** + * + * + *
+     * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+     * 
+ * + * string protocol = 15; + * + * @return The protocol. + */ + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocol_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+     * 
+ * + * string protocol = 15; + * + * @return The bytes for protocol. + */ + public com.google.protobuf.ByteString getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + protocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+     * 
+ * + * string protocol = 15; + * + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + protocol_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+     * 
+ * + * string protocol = 15; + * + * @return This builder for chaining. + */ + public Builder clearProtocol() { + + protocol_ = getDefaultInstance().getProtocol(); + onChanged(); + return this; + } + /** + * + * + *
+     * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+     * 
+ * + * string protocol = 15; + * + * @param value The bytes for protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + protocol_ = 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.api.servicecontrol.v1.HttpRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.HttpRequest) + private static final com.google.api.servicecontrol.v1.HttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.HttpRequest(); + } + + public static com.google.api.servicecontrol.v1.HttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpRequest(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.api.servicecontrol.v1.HttpRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestOrBuilder.java new file mode 100644 index 00000000..9b20f03b --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestOrBuilder.java @@ -0,0 +1,352 @@ +/* + * 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/api/servicecontrol/v1/http_request.proto + +package com.google.api.servicecontrol.v1; + +public interface HttpRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.HttpRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+   * 
+ * + * string request_method = 1; + * + * @return The requestMethod. + */ + java.lang.String getRequestMethod(); + /** + * + * + *
+   * The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
+   * 
+ * + * string request_method = 1; + * + * @return The bytes for requestMethod. + */ + com.google.protobuf.ByteString getRequestMethodBytes(); + + /** + * + * + *
+   * The scheme (http, https), the host name, the path, and the query
+   * portion of the URL that was requested.
+   * Example: `"http://example.com/some/info?color=red"`.
+   * 
+ * + * string request_url = 2; + * + * @return The requestUrl. + */ + java.lang.String getRequestUrl(); + /** + * + * + *
+   * The scheme (http, https), the host name, the path, and the query
+   * portion of the URL that was requested.
+   * Example: `"http://example.com/some/info?color=red"`.
+   * 
+ * + * string request_url = 2; + * + * @return The bytes for requestUrl. + */ + com.google.protobuf.ByteString getRequestUrlBytes(); + + /** + * + * + *
+   * The size of the HTTP request message in bytes, including the request
+   * headers and the request body.
+   * 
+ * + * int64 request_size = 3; + * + * @return The requestSize. + */ + long getRequestSize(); + + /** + * + * + *
+   * The response code indicating the status of the response.
+   * Examples: 200, 404.
+   * 
+ * + * int32 status = 4; + * + * @return The status. + */ + int getStatus(); + + /** + * + * + *
+   * The size of the HTTP response message sent back to the client, in bytes,
+   * including the response headers and the response body.
+   * 
+ * + * int64 response_size = 5; + * + * @return The responseSize. + */ + long getResponseSize(); + + /** + * + * + *
+   * The user agent sent by the client. Example:
+   * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+   * CLR 1.0.3705)"`.
+   * 
+ * + * string user_agent = 6; + * + * @return The userAgent. + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * The user agent sent by the client. Example:
+   * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
+   * CLR 1.0.3705)"`.
+   * 
+ * + * string user_agent = 6; + * + * @return The bytes for userAgent. + */ + com.google.protobuf.ByteString getUserAgentBytes(); + + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+   * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+   * 
+ * + * string remote_ip = 7; + * + * @return The remoteIp. + */ + java.lang.String getRemoteIp(); + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the client that issued the HTTP
+   * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
+   * 
+ * + * string remote_ip = 7; + * + * @return The bytes for remoteIp. + */ + com.google.protobuf.ByteString getRemoteIpBytes(); + + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the origin server that the request was
+   * sent to.
+   * 
+ * + * string server_ip = 13; + * + * @return The serverIp. + */ + java.lang.String getServerIp(); + /** + * + * + *
+   * The IP address (IPv4 or IPv6) of the origin server that the request was
+   * sent to.
+   * 
+ * + * string server_ip = 13; + * + * @return The bytes for serverIp. + */ + com.google.protobuf.ByteString getServerIpBytes(); + + /** + * + * + *
+   * The referer URL of the request, as defined in
+   * [HTTP/1.1 Header Field
+   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+   * 
+ * + * string referer = 8; + * + * @return The referer. + */ + java.lang.String getReferer(); + /** + * + * + *
+   * The referer URL of the request, as defined in
+   * [HTTP/1.1 Header Field
+   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
+   * 
+ * + * string referer = 8; + * + * @return The bytes for referer. + */ + com.google.protobuf.ByteString getRefererBytes(); + + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return Whether the latency field is set. + */ + boolean hasLatency(); + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + * + * @return The latency. + */ + com.google.protobuf.Duration getLatency(); + /** + * + * + *
+   * The request processing latency on the server, from the time the request was
+   * received until the response was sent.
+   * 
+ * + * .google.protobuf.Duration latency = 14; + */ + com.google.protobuf.DurationOrBuilder getLatencyOrBuilder(); + + /** + * + * + *
+   * Whether or not a cache lookup was attempted.
+   * 
+ * + * bool cache_lookup = 11; + * + * @return The cacheLookup. + */ + boolean getCacheLookup(); + + /** + * + * + *
+   * Whether or not an entity was served from cache
+   * (with or without validation).
+   * 
+ * + * bool cache_hit = 9; + * + * @return The cacheHit. + */ + boolean getCacheHit(); + + /** + * + * + *
+   * Whether or not the response was validated with the origin server before
+   * being served from cache. This field is only meaningful if `cache_hit` is
+   * True.
+   * 
+ * + * bool cache_validated_with_origin_server = 10; + * + * @return The cacheValidatedWithOriginServer. + */ + boolean getCacheValidatedWithOriginServer(); + + /** + * + * + *
+   * The number of HTTP response bytes inserted into cache. Set only when a
+   * cache fill was attempted.
+   * 
+ * + * int64 cache_fill_bytes = 12; + * + * @return The cacheFillBytes. + */ + long getCacheFillBytes(); + + /** + * + * + *
+   * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+   * 
+ * + * string protocol = 15; + * + * @return The protocol. + */ + java.lang.String getProtocol(); + /** + * + * + *
+   * Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
+   * 
+ * + * string protocol = 15; + * + * @return The bytes for protocol. + */ + com.google.protobuf.ByteString getProtocolBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestProto.java new file mode 100644 index 00000000..df33aaaa --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/HttpRequestProto.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/api/servicecontrol/v1/http_request.proto + +package com.google.api.servicecontrol.v1; + +public final class HttpRequestProto { + private HttpRequestProto() {} + + 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_api_servicecontrol_v1_HttpRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_HttpRequest_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/api/servicecontrol/v1/http_requ" + + "est.proto\022\034google.api.servicecontrol.v1\032" + + "\036google/protobuf/duration.proto\"\357\002\n\013Http" + + "Request\022\026\n\016request_method\030\001 \001(\t\022\023\n\013reque" + + "st_url\030\002 \001(\t\022\024\n\014request_size\030\003 \001(\003\022\016\n\006st" + + "atus\030\004 \001(\005\022\025\n\rresponse_size\030\005 \001(\003\022\022\n\nuse" + + "r_agent\030\006 \001(\t\022\021\n\tremote_ip\030\007 \001(\t\022\021\n\tserv" + + "er_ip\030\r \001(\t\022\017\n\007referer\030\010 \001(\t\022*\n\007latency\030" + + "\016 \001(\0132\031.google.protobuf.Duration\022\024\n\014cach" + + "e_lookup\030\013 \001(\010\022\021\n\tcache_hit\030\t \001(\010\022*\n\"cac" + + "he_validated_with_origin_server\030\n \001(\010\022\030\n" + + "\020cache_fill_bytes\030\014 \001(\003\022\020\n\010protocol\030\017 \001(" + + "\tB\350\001\n com.google.api.servicecontrol.v1B\020" + + "HttpRequestProtoP\001ZJgoogle.golang.org/ge" + + "nproto/googleapis/api/servicecontrol/v1;" + + "servicecontrol\252\002\036Google.Cloud.ServiceCon" + + "trol.V1\312\002\036Google\\Cloud\\ServiceControl\\V1" + + "\352\002!Google::Cloud::ServiceControl::V1b\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_HttpRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_HttpRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_HttpRequest_descriptor, + new java.lang.String[] { + "RequestMethod", + "RequestUrl", + "RequestSize", + "Status", + "ResponseSize", + "UserAgent", + "RemoteIp", + "ServerIp", + "Referer", + "Latency", + "CacheLookup", + "CacheHit", + "CacheValidatedWithOriginServer", + "CacheFillBytes", + "Protocol", + }); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntry.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntry.java new file mode 100644 index 00000000..51e4c817 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntry.java @@ -0,0 +1,3620 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * An individual log entry.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntry} + */ +public final class LogEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.LogEntry) + LogEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogEntry.newBuilder() to construct. + private LogEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogEntry() { + name_ = ""; + severity_ = 0; + trace_ = ""; + insertId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogEntry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LogEntry( + 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 18: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (payloadCase_ == 2) { + subBuilder = ((com.google.protobuf.Any) payload_).toBuilder(); + } + payload_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Any) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 2; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + payloadCase_ = 3; + payload_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + insertId_ = s; + break; + } + case 50: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (payloadCase_ == 6) { + subBuilder = ((com.google.protobuf.Struct) payload_).toBuilder(); + } + payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Struct) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 6; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 90: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); + } + + break; + } + case 96: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 106: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 114: + { + com.google.api.servicecontrol.v1.HttpRequest.Builder subBuilder = null; + if (httpRequest_ != null) { + subBuilder = httpRequest_.toBuilder(); + } + httpRequest_ = + input.readMessage( + com.google.api.servicecontrol.v1.HttpRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(httpRequest_); + httpRequest_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + trace_ = s; + break; + } + case 130: + { + com.google.api.servicecontrol.v1.LogEntryOperation.Builder subBuilder = null; + if (operation_ != null) { + subBuilder = operation_.toBuilder(); + } + operation_ = + input.readMessage( + com.google.api.servicecontrol.v1.LogEntryOperation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(operation_); + operation_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder subBuilder = null; + if (sourceLocation_ != null) { + subBuilder = sourceLocation_.toBuilder(); + } + sourceLocation_ = + input.readMessage( + com.google.api.servicecontrol.v1.LogEntrySourceLocation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceLocation_); + sourceLocation_ = 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.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 13: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntry.class, + com.google.api.servicecontrol.v1.LogEntry.Builder.class); + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROTO_PAYLOAD(2), + TEXT_PAYLOAD(3), + STRUCT_PAYLOAD(6), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(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 PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 2: + return PROTO_PAYLOAD; + case 3: + return TEXT_PAYLOAD; + case 6: + return STRUCT_PAYLOAD; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int NAME_FIELD_NUMBER = 10; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+   * `"book_log"`.
+   * 
+ * + * string name = 10; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+   * `"book_log"`.
+   * 
+ * + * string name = 10; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp timestamp_; + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + public static final int SEVERITY_FIELD_NUMBER = 12; + private int severity_; + /** + * + * + *
+   * The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The severity. + */ + @java.lang.Override + public com.google.logging.type.LogSeverity getSeverity() { + @SuppressWarnings("deprecation") + com.google.logging.type.LogSeverity result = + com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + + public static final int HTTP_REQUEST_FIELD_NUMBER = 14; + private com.google.api.servicecontrol.v1.HttpRequest httpRequest_; + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return Whether the httpRequest field is set. + */ + @java.lang.Override + public boolean hasHttpRequest() { + return httpRequest_ != null; + } + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return The httpRequest. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.HttpRequest getHttpRequest() { + return httpRequest_ == null + ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance() + : httpRequest_; + } + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.HttpRequestOrBuilder getHttpRequestOrBuilder() { + return getHttpRequest(); + } + + public static final int TRACE_FIELD_NUMBER = 15; + private volatile java.lang.Object trace_; + /** + * + * + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If this field contains a relative resource name, you can assume the name is
+   * relative to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 15; + * + * @return The trace. + */ + @java.lang.Override + public java.lang.String getTrace() { + java.lang.Object ref = trace_; + 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(); + trace_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If this field contains a relative resource name, you can assume the name is
+   * relative to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 15; + * + * @return The bytes for trace. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTraceBytes() { + java.lang.Object ref = trace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSERT_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object insertId_; + /** + * + * + *
+   * A unique ID for the log entry used for deduplication. If omitted,
+   * the implementation will generate one based on operation_id.
+   * 
+ * + * string insert_id = 4; + * + * @return The insertId. + */ + @java.lang.Override + public java.lang.String getInsertId() { + java.lang.Object ref = insertId_; + 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(); + insertId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique ID for the log entry used for deduplication. If omitted,
+   * the implementation will generate one based on operation_id.
+   * 
+ * + * string insert_id = 4; + * + * @return The bytes for insertId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInsertIdBytes() { + java.lang.Object ref = insertId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + insertId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 13; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PROTO_PAYLOAD_FIELD_NUMBER = 2; + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return Whether the protoPayload field is set. + */ + @java.lang.Override + public boolean hasProtoPayload() { + return payloadCase_ == 2; + } + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return The protoPayload. + */ + @java.lang.Override + public com.google.protobuf.Any getProtoPayload() { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + + public static final int TEXT_PAYLOAD_FIELD_NUMBER = 3; + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return Whether the textPayload field is set. + */ + public boolean hasTextPayload() { + return payloadCase_ == 3; + } + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return The textPayload. + */ + public java.lang.String getTextPayload() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (payloadCase_ == 3) { + payload_ = s; + } + return s; + } + } + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return The bytes for textPayload. + */ + public com.google.protobuf.ByteString getTextPayloadBytes() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (payloadCase_ == 3) { + payload_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STRUCT_PAYLOAD_FIELD_NUMBER = 6; + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return Whether the structPayload field is set. + */ + @java.lang.Override + public boolean hasStructPayload() { + return payloadCase_ == 6; + } + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return The structPayload. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructPayload() { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructPayloadOrBuilder() { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int OPERATION_FIELD_NUMBER = 16; + private com.google.api.servicecontrol.v1.LogEntryOperation operation_; + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return operation_ != null; + } + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return The operation. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOperation getOperation() { + return operation_ == null + ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance() + : operation_; + } + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder getOperationOrBuilder() { + return getOperation(); + } + + public static final int SOURCE_LOCATION_FIELD_NUMBER = 17; + private com.google.api.servicecontrol.v1.LogEntrySourceLocation sourceLocation_; + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return Whether the sourceLocation field is set. + */ + @java.lang.Override + public boolean hasSourceLocation() { + return sourceLocation_ != null; + } + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return The sourceLocation. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntrySourceLocation getSourceLocation() { + return sourceLocation_ == null + ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder + getSourceLocationOrBuilder() { + return getSourceLocation(); + } + + 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 (payloadCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Any) payload_); + } + if (payloadCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, payload_); + } + if (!getInsertIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, insertId_); + } + if (payloadCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Struct) payload_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, name_); + } + if (timestamp_ != null) { + output.writeMessage(11, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + output.writeEnum(12, severity_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 13); + if (httpRequest_ != null) { + output.writeMessage(14, getHttpRequest()); + } + if (!getTraceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, trace_); + } + if (operation_ != null) { + output.writeMessage(16, getOperation()); + } + if (sourceLocation_ != null) { + output.writeMessage(17, getSourceLocation()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Any) payload_); + } + if (payloadCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, payload_); + } + if (!getInsertIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, insertId_); + } + if (payloadCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Struct) payload_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, name_); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, severity_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, labels__); + } + if (httpRequest_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getHttpRequest()); + } + if (!getTraceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, trace_); + } + if (operation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getOperation()); + } + if (sourceLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getSourceLocation()); + } + 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.api.servicecontrol.v1.LogEntry)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.LogEntry other = + (com.google.api.servicecontrol.v1.LogEntry) obj; + + if (!getName().equals(other.getName())) return false; + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) return false; + } + if (severity_ != other.severity_) return false; + if (hasHttpRequest() != other.hasHttpRequest()) return false; + if (hasHttpRequest()) { + if (!getHttpRequest().equals(other.getHttpRequest())) return false; + } + if (!getTrace().equals(other.getTrace())) return false; + if (!getInsertId().equals(other.getInsertId())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasOperation() != other.hasOperation()) return false; + if (hasOperation()) { + if (!getOperation().equals(other.getOperation())) return false; + } + if (hasSourceLocation() != other.hasSourceLocation()) return false; + if (hasSourceLocation()) { + if (!getSourceLocation().equals(other.getSourceLocation())) return false; + } + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 2: + if (!getProtoPayload().equals(other.getProtoPayload())) return false; + break; + case 3: + if (!getTextPayload().equals(other.getTextPayload())) return false; + break; + case 6: + if (!getStructPayload().equals(other.getStructPayload())) 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(); + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + if (hasHttpRequest()) { + hash = (37 * hash) + HTTP_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getHttpRequest().hashCode(); + } + hash = (37 * hash) + TRACE_FIELD_NUMBER; + hash = (53 * hash) + getTrace().hashCode(); + hash = (37 * hash) + INSERT_ID_FIELD_NUMBER; + hash = (53 * hash) + getInsertId().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + if (hasSourceLocation()) { + hash = (37 * hash) + SOURCE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getSourceLocation().hashCode(); + } + switch (payloadCase_) { + case 2: + hash = (37 * hash) + PROTO_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getProtoPayload().hashCode(); + break; + case 3: + hash = (37 * hash) + TEXT_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getTextPayload().hashCode(); + break; + case 6: + hash = (37 * hash) + STRUCT_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getStructPayload().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.LogEntry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntry parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntry 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.api.servicecontrol.v1.LogEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntry 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.api.servicecontrol.v1.LogEntry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntry 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.api.servicecontrol.v1.LogEntry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntry 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.api.servicecontrol.v1.LogEntry 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 individual log entry.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.LogEntry) + com.google.api.servicecontrol.v1.LogEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 13: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 13: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntry.class, + com.google.api.servicecontrol.v1.LogEntry.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.LogEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + severity_ = 0; + + if (httpRequestBuilder_ == null) { + httpRequest_ = null; + } else { + httpRequest_ = null; + httpRequestBuilder_ = null; + } + trace_ = ""; + + insertId_ = ""; + + internalGetMutableLabels().clear(); + if (operationBuilder_ == null) { + operation_ = null; + } else { + operation_ = null; + operationBuilder_ = null; + } + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntry_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntry getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntry build() { + com.google.api.servicecontrol.v1.LogEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntry buildPartial() { + com.google.api.servicecontrol.v1.LogEntry result = + new com.google.api.servicecontrol.v1.LogEntry(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); + } + result.severity_ = severity_; + if (httpRequestBuilder_ == null) { + result.httpRequest_ = httpRequest_; + } else { + result.httpRequest_ = httpRequestBuilder_.build(); + } + result.trace_ = trace_; + result.insertId_ = insertId_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (payloadCase_ == 2) { + if (protoPayloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = protoPayloadBuilder_.build(); + } + } + if (payloadCase_ == 3) { + result.payload_ = payload_; + } + if (payloadCase_ == 6) { + if (structPayloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = structPayloadBuilder_.build(); + } + } + if (operationBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = operationBuilder_.build(); + } + if (sourceLocationBuilder_ == null) { + result.sourceLocation_ = sourceLocation_; + } else { + result.sourceLocation_ = sourceLocationBuilder_.build(); + } + result.payloadCase_ = payloadCase_; + 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.api.servicecontrol.v1.LogEntry) { + return mergeFrom((com.google.api.servicecontrol.v1.LogEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.LogEntry other) { + if (other == com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (other.hasHttpRequest()) { + mergeHttpRequest(other.getHttpRequest()); + } + if (!other.getTrace().isEmpty()) { + trace_ = other.trace_; + onChanged(); + } + if (!other.getInsertId().isEmpty()) { + insertId_ = other.insertId_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (other.hasSourceLocation()) { + mergeSourceLocation(other.getSourceLocation()); + } + switch (other.getPayloadCase()) { + case PROTO_PAYLOAD: + { + mergeProtoPayload(other.getProtoPayload()); + break; + } + case TEXT_PAYLOAD: + { + payloadCase_ = 3; + payload_ = other.payload_; + onChanged(); + break; + } + case STRUCT_PAYLOAD: + { + mergeStructPayload(other.getStructPayload()); + break; + } + case PAYLOAD_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.api.servicecontrol.v1.LogEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.LogEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+     * `"book_log"`.
+     * 
+ * + * string name = 10; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+     * `"book_log"`.
+     * 
+ * + * string name = 10; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+     * `"book_log"`.
+     * 
+ * + * string name = 10; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+     * `"book_log"`.
+     * 
+ * + * string name = 10; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+     * `"book_log"`.
+     * 
+ * + * string name = 10; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampBuilder_; + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + * + * + *
+     * The time the event described by the log entry occurred. If
+     * omitted, defaults to operation start time.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private int severity_ = 0; + /** + * + * + *
+     * The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The severity. + */ + @java.lang.Override + public com.google.logging.type.LogSeverity getSeverity() { + @SuppressWarnings("deprecation") + com.google.logging.type.LogSeverity result = + com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.logging.type.LogSeverity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private com.google.api.servicecontrol.v1.HttpRequest httpRequest_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.HttpRequest, + com.google.api.servicecontrol.v1.HttpRequest.Builder, + com.google.api.servicecontrol.v1.HttpRequestOrBuilder> + httpRequestBuilder_; + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return Whether the httpRequest field is set. + */ + public boolean hasHttpRequest() { + return httpRequestBuilder_ != null || httpRequest_ != null; + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return The httpRequest. + */ + public com.google.api.servicecontrol.v1.HttpRequest getHttpRequest() { + if (httpRequestBuilder_ == null) { + return httpRequest_ == null + ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance() + : httpRequest_; + } else { + return httpRequestBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public Builder setHttpRequest(com.google.api.servicecontrol.v1.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpRequest_ = value; + onChanged(); + } else { + httpRequestBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public Builder setHttpRequest( + com.google.api.servicecontrol.v1.HttpRequest.Builder builderForValue) { + if (httpRequestBuilder_ == null) { + httpRequest_ = builderForValue.build(); + onChanged(); + } else { + httpRequestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public Builder mergeHttpRequest(com.google.api.servicecontrol.v1.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (httpRequest_ != null) { + httpRequest_ = + com.google.api.servicecontrol.v1.HttpRequest.newBuilder(httpRequest_) + .mergeFrom(value) + .buildPartial(); + } else { + httpRequest_ = value; + } + onChanged(); + } else { + httpRequestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public Builder clearHttpRequest() { + if (httpRequestBuilder_ == null) { + httpRequest_ = null; + onChanged(); + } else { + httpRequest_ = null; + httpRequestBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public com.google.api.servicecontrol.v1.HttpRequest.Builder getHttpRequestBuilder() { + + onChanged(); + return getHttpRequestFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + public com.google.api.servicecontrol.v1.HttpRequestOrBuilder getHttpRequestOrBuilder() { + if (httpRequestBuilder_ != null) { + return httpRequestBuilder_.getMessageOrBuilder(); + } else { + return httpRequest_ == null + ? com.google.api.servicecontrol.v1.HttpRequest.getDefaultInstance() + : httpRequest_; + } + } + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.HttpRequest, + com.google.api.servicecontrol.v1.HttpRequest.Builder, + com.google.api.servicecontrol.v1.HttpRequestOrBuilder> + getHttpRequestFieldBuilder() { + if (httpRequestBuilder_ == null) { + httpRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.HttpRequest, + com.google.api.servicecontrol.v1.HttpRequest.Builder, + com.google.api.servicecontrol.v1.HttpRequestOrBuilder>( + getHttpRequest(), getParentForChildren(), isClean()); + httpRequest_ = null; + } + return httpRequestBuilder_; + } + + private java.lang.Object trace_ = ""; + /** + * + * + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If this field contains a relative resource name, you can assume the name is
+     * relative to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 15; + * + * @return The trace. + */ + public java.lang.String getTrace() { + java.lang.Object ref = trace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If this field contains a relative resource name, you can assume the name is
+     * relative to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 15; + * + * @return The bytes for trace. + */ + public com.google.protobuf.ByteString getTraceBytes() { + java.lang.Object ref = trace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If this field contains a relative resource name, you can assume the name is
+     * relative to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 15; + * + * @param value The trace to set. + * @return This builder for chaining. + */ + public Builder setTrace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If this field contains a relative resource name, you can assume the name is
+     * relative to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 15; + * + * @return This builder for chaining. + */ + public Builder clearTrace() { + + trace_ = getDefaultInstance().getTrace(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If this field contains a relative resource name, you can assume the name is
+     * relative to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 15; + * + * @param value The bytes for trace to set. + * @return This builder for chaining. + */ + public Builder setTraceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trace_ = value; + onChanged(); + return this; + } + + private java.lang.Object insertId_ = ""; + /** + * + * + *
+     * A unique ID for the log entry used for deduplication. If omitted,
+     * the implementation will generate one based on operation_id.
+     * 
+ * + * string insert_id = 4; + * + * @return The insertId. + */ + public java.lang.String getInsertId() { + java.lang.Object ref = insertId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + insertId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique ID for the log entry used for deduplication. If omitted,
+     * the implementation will generate one based on operation_id.
+     * 
+ * + * string insert_id = 4; + * + * @return The bytes for insertId. + */ + public com.google.protobuf.ByteString getInsertIdBytes() { + java.lang.Object ref = insertId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + insertId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique ID for the log entry used for deduplication. If omitted,
+     * the implementation will generate one based on operation_id.
+     * 
+ * + * string insert_id = 4; + * + * @param value The insertId to set. + * @return This builder for chaining. + */ + public Builder setInsertId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + insertId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID for the log entry used for deduplication. If omitted,
+     * the implementation will generate one based on operation_id.
+     * 
+ * + * string insert_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearInsertId() { + + insertId_ = getDefaultInstance().getInsertId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID for the log entry used for deduplication. If omitted,
+     * the implementation will generate one based on operation_id.
+     * 
+ * + * string insert_id = 4; + * + * @param value The bytes for insertId to set. + * @return This builder for chaining. + */ + public Builder setInsertIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + insertId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + protoPayloadBuilder_; + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return Whether the protoPayload field is set. + */ + @java.lang.Override + public boolean hasProtoPayload() { + return payloadCase_ == 2; + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return The protoPayload. + */ + @java.lang.Override + public com.google.protobuf.Any getProtoPayload() { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return protoPayloadBuilder_.getMessage(); + } + return com.google.protobuf.Any.getDefaultInstance(); + } + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder setProtoPayload(com.google.protobuf.Any value) { + if (protoPayloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + protoPayloadBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder setProtoPayload(com.google.protobuf.Any.Builder builderForValue) { + if (protoPayloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + protoPayloadBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder mergeProtoPayload(com.google.protobuf.Any value) { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2 && payload_ != com.google.protobuf.Any.getDefaultInstance()) { + payload_ = + com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + protoPayloadBuilder_.mergeFrom(value); + } + protoPayloadBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder clearProtoPayload() { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + protoPayloadBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.Any.Builder getProtoPayloadBuilder() { + return getProtoPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { + if ((payloadCase_ == 2) && (protoPayloadBuilder_ != null)) { + return protoPayloadBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + } + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer that is
+     * expressed as a JSON object. The only accepted type currently is
+     * [AuditLog][google.cloud.audit.AuditLog].
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getProtoPayloadFieldBuilder() { + if (protoPayloadBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.protobuf.Any.getDefaultInstance(); + } + protoPayloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + (com.google.protobuf.Any) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + ; + return protoPayloadBuilder_; + } + + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @return Whether the textPayload field is set. + */ + @java.lang.Override + public boolean hasTextPayload() { + return payloadCase_ == 3; + } + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @return The textPayload. + */ + @java.lang.Override + public java.lang.String getTextPayload() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (payloadCase_ == 3) { + payload_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @return The bytes for textPayload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextPayloadBytes() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (payloadCase_ == 3) { + payload_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @param value The textPayload to set. + * @return This builder for chaining. + */ + public Builder setTextPayload(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + payloadCase_ = 3; + payload_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @return This builder for chaining. + */ + public Builder clearTextPayload() { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + * + * @param value The bytes for textPayload to set. + * @return This builder for chaining. + */ + public Builder setTextPayloadBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + payloadCase_ = 3; + payload_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + structPayloadBuilder_; + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return Whether the structPayload field is set. + */ + @java.lang.Override + public boolean hasStructPayload() { + return payloadCase_ == 6; + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return The structPayload. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructPayload() { + if (structPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (payloadCase_ == 6) { + return structPayloadBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + public Builder setStructPayload(com.google.protobuf.Struct value) { + if (structPayloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + structPayloadBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + public Builder setStructPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (structPayloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + structPayloadBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 6; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + public Builder mergeStructPayload(com.google.protobuf.Struct value) { + if (structPayloadBuilder_ == null) { + if (payloadCase_ == 6 && payload_ != com.google.protobuf.Struct.getDefaultInstance()) { + payload_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 6) { + structPayloadBuilder_.mergeFrom(value); + } + structPayloadBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + public Builder clearStructPayload() { + if (structPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + } + structPayloadBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + public com.google.protobuf.Struct.Builder getStructPayloadBuilder() { + return getStructPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructPayloadOrBuilder() { + if ((payloadCase_ == 6) && (structPayloadBuilder_ != null)) { + return structPayloadBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The log entry payload, represented as a structure that
+     * is expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getStructPayloadFieldBuilder() { + if (structPayloadBuilder_ == null) { + if (!(payloadCase_ == 6)) { + payload_ = com.google.protobuf.Struct.getDefaultInstance(); + } + structPayloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 6; + onChanged(); + ; + return structPayloadBuilder_; + } + + private com.google.api.servicecontrol.v1.LogEntryOperation operation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntryOperation, + com.google.api.servicecontrol.v1.LogEntryOperation.Builder, + com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder> + operationBuilder_; + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return Whether the operation field is set. + */ + public boolean hasOperation() { + return operationBuilder_ != null || operation_ != null; + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return The operation. + */ + public com.google.api.servicecontrol.v1.LogEntryOperation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null + ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance() + : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public Builder setOperation(com.google.api.servicecontrol.v1.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + operationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public Builder setOperation( + com.google.api.servicecontrol.v1.LogEntryOperation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public Builder mergeOperation(com.google.api.servicecontrol.v1.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (operation_ != null) { + operation_ = + com.google.api.servicecontrol.v1.LogEntryOperation.newBuilder(operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + operationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public Builder clearOperation() { + if (operationBuilder_ == null) { + operation_ = null; + onChanged(); + } else { + operation_ = null; + operationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public com.google.api.servicecontrol.v1.LogEntryOperation.Builder getOperationBuilder() { + + onChanged(); + return getOperationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + public com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null + ? com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance() + : operation_; + } + } + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntryOperation, + com.google.api.servicecontrol.v1.LogEntryOperation.Builder, + com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder> + getOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntryOperation, + com.google.api.servicecontrol.v1.LogEntryOperation.Builder, + com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder>( + getOperation(), getParentForChildren(), isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private com.google.api.servicecontrol.v1.LogEntrySourceLocation sourceLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntrySourceLocation, + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder, + com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder> + sourceLocationBuilder_; + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return Whether the sourceLocation field is set. + */ + public boolean hasSourceLocation() { + return sourceLocationBuilder_ != null || sourceLocation_ != null; + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return The sourceLocation. + */ + public com.google.api.servicecontrol.v1.LogEntrySourceLocation getSourceLocation() { + if (sourceLocationBuilder_ == null) { + return sourceLocation_ == null + ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } else { + return sourceLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public Builder setSourceLocation( + com.google.api.servicecontrol.v1.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceLocation_ = value; + onChanged(); + } else { + sourceLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public Builder setSourceLocation( + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder builderForValue) { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = builderForValue.build(); + onChanged(); + } else { + sourceLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public Builder mergeSourceLocation( + com.google.api.servicecontrol.v1.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (sourceLocation_ != null) { + sourceLocation_ = + com.google.api.servicecontrol.v1.LogEntrySourceLocation.newBuilder(sourceLocation_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceLocation_ = value; + } + onChanged(); + } else { + sourceLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public Builder clearSourceLocation() { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + onChanged(); + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder + getSourceLocationBuilder() { + + onChanged(); + return getSourceLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + public com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder + getSourceLocationOrBuilder() { + if (sourceLocationBuilder_ != null) { + return sourceLocationBuilder_.getMessageOrBuilder(); + } else { + return sourceLocation_ == null + ? com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } + } + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntrySourceLocation, + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder, + com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder> + getSourceLocationFieldBuilder() { + if (sourceLocationBuilder_ == null) { + sourceLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntrySourceLocation, + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder, + com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder>( + getSourceLocation(), getParentForChildren(), isClean()); + sourceLocation_ = null; + } + return sourceLocationBuilder_; + } + + @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.api.servicecontrol.v1.LogEntry) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.LogEntry) + private static final com.google.api.servicecontrol.v1.LogEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.LogEntry(); + } + + public static com.google.api.servicecontrol.v1.LogEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntry(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.api.servicecontrol.v1.LogEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperation.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperation.java new file mode 100644 index 00000000..8c5660e5 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperation.java @@ -0,0 +1,1018 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Additional information about a potentially long-running operation with which
+ * a log entry is associated.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntryOperation} + */ +public final class LogEntryOperation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.LogEntryOperation) + LogEntryOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogEntryOperation.newBuilder() to construct. + private LogEntryOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogEntryOperation() { + id_ = ""; + producer_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogEntryOperation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LogEntryOperation( + 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(); + + id_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + producer_ = s; + break; + } + case 24: + { + first_ = input.readBool(); + break; + } + case 32: + { + last_ = 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.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntryOperation.class, + com.google.api.servicecontrol.v1.LogEntryOperation.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCER_FIELD_NUMBER = 2; + private volatile java.lang.Object producer_; + /** + * + * + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + * + * @return The producer. + */ + @java.lang.Override + public java.lang.String getProducer() { + java.lang.Object ref = producer_; + 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(); + producer_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + * + * @return The bytes for producer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProducerBytes() { + java.lang.Object ref = producer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + producer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIRST_FIELD_NUMBER = 3; + private boolean first_; + /** + * + * + *
+   * Optional. Set this to True if this is the first log entry in the operation.
+   * 
+ * + * bool first = 3; + * + * @return The first. + */ + @java.lang.Override + public boolean getFirst() { + return first_; + } + + public static final int LAST_FIELD_NUMBER = 4; + private boolean last_; + /** + * + * + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4; + * + * @return The last. + */ + @java.lang.Override + public boolean getLast() { + return last_; + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getProducerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, producer_); + } + if (first_ != false) { + output.writeBool(3, first_); + } + if (last_ != false) { + output.writeBool(4, last_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getProducerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, producer_); + } + if (first_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, first_); + } + if (last_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, last_); + } + 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.api.servicecontrol.v1.LogEntryOperation)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.LogEntryOperation other = + (com.google.api.servicecontrol.v1.LogEntryOperation) obj; + + if (!getId().equals(other.getId())) return false; + if (!getProducer().equals(other.getProducer())) return false; + if (getFirst() != other.getFirst()) return false; + if (getLast() != other.getLast()) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + PRODUCER_FIELD_NUMBER; + hash = (53 * hash) + getProducer().hashCode(); + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFirst()); + hash = (37 * hash) + LAST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLast()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation 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.api.servicecontrol.v1.LogEntryOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation 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.api.servicecontrol.v1.LogEntryOperation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation 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.api.servicecontrol.v1.LogEntryOperation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation 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.api.servicecontrol.v1.LogEntryOperation 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; + } + /** + * + * + *
+   * Additional information about a potentially long-running operation with which
+   * a log entry is associated.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntryOperation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.LogEntryOperation) + com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntryOperation.class, + com.google.api.servicecontrol.v1.LogEntryOperation.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.LogEntryOperation.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(); + id_ = ""; + + producer_ = ""; + + first_ = false; + + last_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOperation getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOperation build() { + com.google.api.servicecontrol.v1.LogEntryOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOperation buildPartial() { + com.google.api.servicecontrol.v1.LogEntryOperation result = + new com.google.api.servicecontrol.v1.LogEntryOperation(this); + result.id_ = id_; + result.producer_ = producer_; + result.first_ = first_; + result.last_ = last_; + 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.api.servicecontrol.v1.LogEntryOperation) { + return mergeFrom((com.google.api.servicecontrol.v1.LogEntryOperation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.LogEntryOperation other) { + if (other == com.google.api.servicecontrol.v1.LogEntryOperation.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getProducer().isEmpty()) { + producer_ = other.producer_; + onChanged(); + } + if (other.getFirst() != false) { + setFirst(other.getFirst()); + } + if (other.getLast() != false) { + setLast(other.getLast()); + } + 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.api.servicecontrol.v1.LogEntryOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.LogEntryOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object producer_ = ""; + /** + * + * + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + * + * @return The producer. + */ + public java.lang.String getProducer() { + java.lang.Object ref = producer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + producer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + * + * @return The bytes for producer. + */ + public com.google.protobuf.ByteString getProducerBytes() { + java.lang.Object ref = producer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + producer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + * + * @param value The producer to set. + * @return This builder for chaining. + */ + public Builder setProducer(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + producer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + * + * @return This builder for chaining. + */ + public Builder clearProducer() { + + producer_ = getDefaultInstance().getProducer(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + * + * @param value The bytes for producer to set. + * @return This builder for chaining. + */ + public Builder setProducerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + producer_ = value; + onChanged(); + return this; + } + + private boolean first_; + /** + * + * + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + * + * @return The first. + */ + @java.lang.Override + public boolean getFirst() { + return first_; + } + /** + * + * + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + * + * @param value The first to set. + * @return This builder for chaining. + */ + public Builder setFirst(boolean value) { + + first_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + * + * @return This builder for chaining. + */ + public Builder clearFirst() { + + first_ = false; + onChanged(); + return this; + } + + private boolean last_; + /** + * + * + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + * + * @return The last. + */ + @java.lang.Override + public boolean getLast() { + return last_; + } + /** + * + * + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + * + * @param value The last to set. + * @return This builder for chaining. + */ + public Builder setLast(boolean value) { + + last_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + * + * @return This builder for chaining. + */ + public Builder clearLast() { + + last_ = 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.api.servicecontrol.v1.LogEntryOperation) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.LogEntryOperation) + private static final com.google.api.servicecontrol.v1.LogEntryOperation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.LogEntryOperation(); + } + + public static com.google.api.servicecontrol.v1.LogEntryOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogEntryOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntryOperation(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.api.servicecontrol.v1.LogEntryOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperationOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperationOrBuilder.java new file mode 100644 index 00000000..03a79575 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOperationOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +public interface LogEntryOperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.LogEntryOperation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + * + * @return The producer. + */ + java.lang.String getProducer(); + /** + * + * + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + * + * @return The bytes for producer. + */ + com.google.protobuf.ByteString getProducerBytes(); + + /** + * + * + *
+   * Optional. Set this to True if this is the first log entry in the operation.
+   * 
+ * + * bool first = 3; + * + * @return The first. + */ + boolean getFirst(); + + /** + * + * + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4; + * + * @return The last. + */ + boolean getLast(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOrBuilder.java new file mode 100644 index 00000000..24bfcd13 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryOrBuilder.java @@ -0,0 +1,466 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +public interface LogEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.LogEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+   * `"book_log"`.
+   * 
+ * + * string name = 10; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The log to which this log entry belongs. Examples: `"syslog"`,
+   * `"book_log"`.
+   * 
+ * + * string name = 10; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + * + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + * + * + *
+   * The time the event described by the log entry occurred. If
+   * omitted, defaults to operation start time.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 11; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + * + * + *
+   * The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 12; + * + * @return The severity. + */ + com.google.logging.type.LogSeverity getSeverity(); + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return Whether the httpRequest field is set. + */ + boolean hasHttpRequest(); + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + * + * @return The httpRequest. + */ + com.google.api.servicecontrol.v1.HttpRequest getHttpRequest(); + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.HttpRequest http_request = 14; + */ + com.google.api.servicecontrol.v1.HttpRequestOrBuilder getHttpRequestOrBuilder(); + + /** + * + * + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If this field contains a relative resource name, you can assume the name is
+   * relative to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 15; + * + * @return The trace. + */ + java.lang.String getTrace(); + /** + * + * + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If this field contains a relative resource name, you can assume the name is
+   * relative to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 15; + * + * @return The bytes for trace. + */ + com.google.protobuf.ByteString getTraceBytes(); + + /** + * + * + *
+   * A unique ID for the log entry used for deduplication. If omitted,
+   * the implementation will generate one based on operation_id.
+   * 
+ * + * string insert_id = 4; + * + * @return The insertId. + */ + java.lang.String getInsertId(); + /** + * + * + *
+   * A unique ID for the log entry used for deduplication. If omitted,
+   * the implementation will generate one based on operation_id.
+   * 
+ * + * string insert_id = 4; + * + * @return The bytes for insertId. + */ + com.google.protobuf.ByteString getInsertIdBytes(); + + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + int getLabelsCount(); + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 13; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return Whether the protoPayload field is set. + */ + boolean hasProtoPayload(); + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return The protoPayload. + */ + com.google.protobuf.Any getProtoPayload(); + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer that is
+   * expressed as a JSON object. The only accepted type currently is
+   * [AuditLog][google.cloud.audit.AuditLog].
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder(); + + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return Whether the textPayload field is set. + */ + boolean hasTextPayload(); + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return The textPayload. + */ + java.lang.String getTextPayload(); + /** + * + * + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + * + * @return The bytes for textPayload. + */ + com.google.protobuf.ByteString getTextPayloadBytes(); + + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return Whether the structPayload field is set. + */ + boolean hasStructPayload(); + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + * + * @return The structPayload. + */ + com.google.protobuf.Struct getStructPayload(); + /** + * + * + *
+   * The log entry payload, represented as a structure that
+   * is expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct struct_payload = 6; + */ + com.google.protobuf.StructOrBuilder getStructPayloadOrBuilder(); + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + * + * @return The operation. + */ + com.google.api.servicecontrol.v1.LogEntryOperation getOperation(); + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntryOperation operation = 16; + */ + com.google.api.servicecontrol.v1.LogEntryOperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return Whether the sourceLocation field is set. + */ + boolean hasSourceLocation(); + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + * + * @return The sourceLocation. + */ + com.google.api.servicecontrol.v1.LogEntrySourceLocation getSourceLocation(); + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.api.servicecontrol.v1.LogEntrySourceLocation source_location = 17; + */ + com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder(); + + public com.google.api.servicecontrol.v1.LogEntry.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryProto.java new file mode 100644 index 00000000..f7acc324 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntryProto.java @@ -0,0 +1,150 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +public final class LogEntryProto { + private LogEntryProto() {} + + 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_api_servicecontrol_v1_LogEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_LogEntryOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_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/api/servicecontrol/v1/log_entry" + + ".proto\022\034google.api.servicecontrol.v1\032/go" + + "ogle/api/servicecontrol/v1/http_request." + + "proto\032&google/logging/type/log_severity." + + "proto\032\031google/protobuf/any.proto\032\034google" + + "/protobuf/struct.proto\032\037google/protobuf/" + + "timestamp.proto\"\351\004\n\010LogEntry\022\014\n\004name\030\n \001" + + "(\t\022-\n\ttimestamp\030\013 \001(\0132\032.google.protobuf." + + "Timestamp\0222\n\010severity\030\014 \001(\0162 .google.log" + + "ging.type.LogSeverity\022?\n\014http_request\030\016 " + + "\001(\0132).google.api.servicecontrol.v1.HttpR" + + "equest\022\r\n\005trace\030\017 \001(\t\022\021\n\tinsert_id\030\004 \001(\t" + + "\022B\n\006labels\030\r \003(\01322.google.api.servicecon" + + "trol.v1.LogEntry.LabelsEntry\022-\n\rproto_pa" + + "yload\030\002 \001(\0132\024.google.protobuf.AnyH\000\022\026\n\014t" + + "ext_payload\030\003 \001(\tH\000\0221\n\016struct_payload\030\006 " + + "\001(\0132\027.google.protobuf.StructH\000\022B\n\toperat" + + "ion\030\020 \001(\0132/.google.api.servicecontrol.v1" + + ".LogEntryOperation\022M\n\017source_location\030\021 " + + "\001(\01324.google.api.servicecontrol.v1.LogEn" + + "trySourceLocation\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\t\n\007payload\"N\n\021L" + + "ogEntryOperation\022\n\n\002id\030\001 \001(\t\022\020\n\010producer" + + "\030\002 \001(\t\022\r\n\005first\030\003 \001(\010\022\014\n\004last\030\004 \001(\010\"F\n\026L" + + "ogEntrySourceLocation\022\014\n\004file\030\001 \001(\t\022\014\n\004l" + + "ine\030\002 \001(\003\022\020\n\010function\030\003 \001(\tB\345\001\n com.goog" + + "le.api.servicecontrol.v1B\rLogEntryProtoP" + + "\001ZJgoogle.golang.org/genproto/googleapis" + + "/api/servicecontrol/v1;servicecontrol\252\002\036" + + "Google.Cloud.ServiceControl.V1\312\002\036Google\\" + + "Cloud\\ServiceControl\\V1\352\002!Google::Cloud:" + + ":ServiceControl::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.servicecontrol.v1.HttpRequestProto.getDescriptor(), + com.google.logging.type.LogSeverityProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_LogEntry_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_LogEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_LogEntry_descriptor, + new java.lang.String[] { + "Name", + "Timestamp", + "Severity", + "HttpRequest", + "Trace", + "InsertId", + "Labels", + "ProtoPayload", + "TextPayload", + "StructPayload", + "Operation", + "SourceLocation", + "Payload", + }); + internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_descriptor = + internal_static_google_api_servicecontrol_v1_LogEntry_descriptor.getNestedTypes().get(0); + internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_LogEntry_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_servicecontrol_v1_LogEntryOperation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_LogEntryOperation_descriptor, + new java.lang.String[] { + "Id", "Producer", "First", "Last", + }); + internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor, + new java.lang.String[] { + "File", "Line", "Function", + }); + com.google.api.servicecontrol.v1.HttpRequestProto.getDescriptor(); + com.google.logging.type.LogSeverityProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocation.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocation.java new file mode 100644 index 00000000..64c0e604 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocation.java @@ -0,0 +1,954 @@ +/* + * 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/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Additional information about the source code location that produced the log
+ * entry.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntrySourceLocation} + */ +public final class LogEntrySourceLocation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.LogEntrySourceLocation) + LogEntrySourceLocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogEntrySourceLocation.newBuilder() to construct. + private LogEntrySourceLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogEntrySourceLocation() { + file_ = ""; + function_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogEntrySourceLocation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LogEntrySourceLocation( + 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(); + + file_ = s; + break; + } + case 16: + { + line_ = input.readInt64(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + function_ = 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.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntrySourceLocation.class, + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder.class); + } + + public static final int FILE_FIELD_NUMBER = 1; + private volatile java.lang.Object file_; + /** + * + * + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + * + * @return The file. + */ + @java.lang.Override + public java.lang.String getFile() { + java.lang.Object ref = file_; + 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(); + file_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + * + * @return The bytes for file. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINE_FIELD_NUMBER = 2; + private long line_; + /** + * + * + *
+   * Optional. Line within the source file. 1-based; 0 indicates no line number
+   * available.
+   * 
+ * + * int64 line = 2; + * + * @return The line. + */ + @java.lang.Override + public long getLine() { + return line_; + } + + public static final int FUNCTION_FIELD_NUMBER = 3; + private volatile java.lang.Object function_; + /** + * + * + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + * + * @return The function. + */ + @java.lang.Override + public java.lang.String getFunction() { + java.lang.Object ref = function_; + 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(); + function_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + * + * @return The bytes for function. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + function_ = 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 (!getFileBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, file_); + } + if (line_ != 0L) { + output.writeInt64(2, line_); + } + if (!getFunctionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, function_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFileBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, file_); + } + if (line_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, line_); + } + if (!getFunctionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, function_); + } + 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.api.servicecontrol.v1.LogEntrySourceLocation)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.LogEntrySourceLocation other = + (com.google.api.servicecontrol.v1.LogEntrySourceLocation) obj; + + if (!getFile().equals(other.getFile())) return false; + if (getLine() != other.getLine()) return false; + if (!getFunction().equals(other.getFunction())) 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) + FILE_FIELD_NUMBER; + hash = (53 * hash) + getFile().hashCode(); + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLine()); + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation 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.api.servicecontrol.v1.LogEntrySourceLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation 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.api.servicecontrol.v1.LogEntrySourceLocation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation 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.api.servicecontrol.v1.LogEntrySourceLocation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation 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.api.servicecontrol.v1.LogEntrySourceLocation 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; + } + /** + * + * + *
+   * Additional information about the source code location that produced the log
+   * entry.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.LogEntrySourceLocation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.LogEntrySourceLocation) + com.google.api.servicecontrol.v1.LogEntrySourceLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.LogEntrySourceLocation.class, + com.google.api.servicecontrol.v1.LogEntrySourceLocation.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.LogEntrySourceLocation.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(); + file_ = ""; + + line_ = 0L; + + function_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.LogEntryProto + .internal_static_google_api_servicecontrol_v1_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntrySourceLocation getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntrySourceLocation build() { + com.google.api.servicecontrol.v1.LogEntrySourceLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntrySourceLocation buildPartial() { + com.google.api.servicecontrol.v1.LogEntrySourceLocation result = + new com.google.api.servicecontrol.v1.LogEntrySourceLocation(this); + result.file_ = file_; + result.line_ = line_; + result.function_ = function_; + 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.api.servicecontrol.v1.LogEntrySourceLocation) { + return mergeFrom((com.google.api.servicecontrol.v1.LogEntrySourceLocation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.LogEntrySourceLocation other) { + if (other == com.google.api.servicecontrol.v1.LogEntrySourceLocation.getDefaultInstance()) + return this; + if (!other.getFile().isEmpty()) { + file_ = other.file_; + onChanged(); + } + if (other.getLine() != 0L) { + setLine(other.getLine()); + } + if (!other.getFunction().isEmpty()) { + function_ = other.function_; + 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.api.servicecontrol.v1.LogEntrySourceLocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.LogEntrySourceLocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object file_ = ""; + /** + * + * + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + * + * @return The file. + */ + public java.lang.String getFile() { + java.lang.Object ref = file_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + file_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + * + * @return The bytes for file. + */ + public com.google.protobuf.ByteString getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + * + * @param value The file to set. + * @return This builder for chaining. + */ + public Builder setFile(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + file_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + * + * @return This builder for chaining. + */ + public Builder clearFile() { + + file_ = getDefaultInstance().getFile(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + * + * @param value The bytes for file to set. + * @return This builder for chaining. + */ + public Builder setFileBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + file_ = value; + onChanged(); + return this; + } + + private long line_; + /** + * + * + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + * + * @return The line. + */ + @java.lang.Override + public long getLine() { + return line_; + } + /** + * + * + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + * + * @param value The line to set. + * @return This builder for chaining. + */ + public Builder setLine(long value) { + + line_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + * + * @return This builder for chaining. + */ + public Builder clearLine() { + + line_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object function_ = ""; + /** + * + * + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + * + * @return The function. + */ + public java.lang.String getFunction() { + java.lang.Object ref = function_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + function_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + * + * @return The bytes for function. + */ + public com.google.protobuf.ByteString getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + function_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + * + * @param value The function to set. + * @return This builder for chaining. + */ + public Builder setFunction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + function_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + * + * @return This builder for chaining. + */ + public Builder clearFunction() { + + function_ = getDefaultInstance().getFunction(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + * + * @param value The bytes for function to set. + * @return This builder for chaining. + */ + public Builder setFunctionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + function_ = 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.api.servicecontrol.v1.LogEntrySourceLocation) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.LogEntrySourceLocation) + private static final com.google.api.servicecontrol.v1.LogEntrySourceLocation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.LogEntrySourceLocation(); + } + + public static com.google.api.servicecontrol.v1.LogEntrySourceLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogEntrySourceLocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntrySourceLocation(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.api.servicecontrol.v1.LogEntrySourceLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocationOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocationOrBuilder.java new file mode 100644 index 00000000..96ee9717 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/LogEntrySourceLocationOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/servicecontrol/v1/log_entry.proto + +package com.google.api.servicecontrol.v1; + +public interface LogEntrySourceLocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.LogEntrySourceLocation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + * + * @return The file. + */ + java.lang.String getFile(); + /** + * + * + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + * + * @return The bytes for file. + */ + com.google.protobuf.ByteString getFileBytes(); + + /** + * + * + *
+   * Optional. Line within the source file. 1-based; 0 indicates no line number
+   * available.
+   * 
+ * + * int64 line = 2; + * + * @return The line. + */ + long getLine(); + + /** + * + * + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + * + * @return The function. + */ + java.lang.String getFunction(); + /** + * + * + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + * + * @return The bytes for function. + */ + com.google.protobuf.ByteString getFunctionBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValue.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValue.java new file mode 100644 index 00000000..fae03b34 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValue.java @@ -0,0 +1,2447 @@ +/* + * 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/api/servicecontrol/v1/metric_value.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Represents a single metric value.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.MetricValue} + */ +public final class MetricValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.MetricValue) + MetricValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricValue.newBuilder() to construct. + private MetricValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MetricValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MetricValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MetricValue( + 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)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + valueCase_ = 4; + value_ = input.readBool(); + break; + } + case 40: + { + valueCase_ = 5; + value_ = input.readInt64(); + break; + } + case 49: + { + valueCase_ = 6; + value_ = input.readDouble(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 7; + value_ = s; + break; + } + case 66: + { + com.google.api.servicecontrol.v1.Distribution.Builder subBuilder = null; + if (valueCase_ == 8) { + subBuilder = ((com.google.api.servicecontrol.v1.Distribution) value_).toBuilder(); + } + value_ = + input.readMessage( + com.google.api.servicecontrol.v1.Distribution.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.api.servicecontrol.v1.Distribution) value_); + value_ = subBuilder.buildPartial(); + } + valueCase_ = 8; + 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.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.MetricValue.class, + com.google.api.servicecontrol.v1.MetricValue.Builder.class); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BOOL_VALUE(4), + INT64_VALUE(5), + DOUBLE_VALUE(6), + STRING_VALUE(7), + DISTRIBUTION_VALUE(8), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(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 ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 4: + return BOOL_VALUE; + case 5: + return INT64_VALUE; + case 6: + return DOUBLE_VALUE; + case 7: + return STRING_VALUE; + case 8: + return DISTRIBUTION_VALUE; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int LABELS_FIELD_NUMBER = 1; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int BOOL_VALUE_FIELD_NUMBER = 4; + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool bool_value = 4; + * + * @return Whether the boolValue field is set. + */ + @java.lang.Override + public boolean hasBoolValue() { + return valueCase_ == 4; + } + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool bool_value = 4; + * + * @return The boolValue. + */ + @java.lang.Override + public boolean getBoolValue() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + + public static final int INT64_VALUE_FIELD_NUMBER = 5; + /** + * + * + *
+   * A signed 64-bit integer value.
+   * 
+ * + * int64 int64_value = 5; + * + * @return Whether the int64Value field is set. + */ + @java.lang.Override + public boolean hasInt64Value() { + return valueCase_ == 5; + } + /** + * + * + *
+   * A signed 64-bit integer value.
+   * 
+ * + * int64 int64_value = 5; + * + * @return The int64Value. + */ + @java.lang.Override + public long getInt64Value() { + if (valueCase_ == 5) { + return (java.lang.Long) value_; + } + return 0L; + } + + public static final int DOUBLE_VALUE_FIELD_NUMBER = 6; + /** + * + * + *
+   * A double precision floating point value.
+   * 
+ * + * double double_value = 6; + * + * @return Whether the doubleValue field is set. + */ + @java.lang.Override + public boolean hasDoubleValue() { + return valueCase_ == 6; + } + /** + * + * + *
+   * A double precision floating point value.
+   * 
+ * + * double double_value = 6; + * + * @return The doubleValue. + */ + @java.lang.Override + public double getDoubleValue() { + if (valueCase_ == 6) { + return (java.lang.Double) value_; + } + return 0D; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 7; + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return valueCase_ == 7; + } + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 7) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 7) { + value_ = s; + } + return s; + } + } + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 7) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 7) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISTRIBUTION_VALUE_FIELD_NUMBER = 8; + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return Whether the distributionValue field is set. + */ + @java.lang.Override + public boolean hasDistributionValue() { + return valueCase_ == 8; + } + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return The distributionValue. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution getDistributionValue() { + if (valueCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution) value_; + } + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.DistributionOrBuilder getDistributionValueOrBuilder() { + if (valueCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution) value_; + } + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 1); + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(3, getEndTime()); + } + if (valueCase_ == 4) { + output.writeBool(4, (boolean) ((java.lang.Boolean) value_)); + } + if (valueCase_ == 5) { + output.writeInt64(5, (long) ((java.lang.Long) value_)); + } + if (valueCase_ == 6) { + output.writeDouble(6, (double) ((java.lang.Double) value_)); + } + if (valueCase_ == 7) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, value_); + } + if (valueCase_ == 8) { + output.writeMessage(8, (com.google.api.servicecontrol.v1.Distribution) value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, labels__); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + if (valueCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, (boolean) ((java.lang.Boolean) value_)); + } + if (valueCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 5, (long) ((java.lang.Long) value_)); + } + if (valueCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 6, (double) ((java.lang.Double) value_)); + } + if (valueCase_ == 7) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, value_); + } + if (valueCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.api.servicecontrol.v1.Distribution) value_); + } + 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.api.servicecontrol.v1.MetricValue)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.MetricValue other = + (com.google.api.servicecontrol.v1.MetricValue) obj; + + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 4: + if (getBoolValue() != other.getBoolValue()) return false; + break; + case 5: + if (getInt64Value() != other.getInt64Value()) return false; + break; + case 6: + if (java.lang.Double.doubleToLongBits(getDoubleValue()) + != java.lang.Double.doubleToLongBits(other.getDoubleValue())) return false; + break; + case 7: + if (!getStringValue().equals(other.getStringValue())) return false; + break; + case 8: + if (!getDistributionValue().equals(other.getDistributionValue())) 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(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + switch (valueCase_) { + case 4: + hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBoolValue()); + break; + case 5: + hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getInt64Value()); + break; + case 6: + hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getDoubleValue())); + break; + case 7: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 8: + hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDistributionValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.MetricValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.MetricValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValue 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.api.servicecontrol.v1.MetricValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.MetricValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValue 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.api.servicecontrol.v1.MetricValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValue 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.api.servicecontrol.v1.MetricValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValue 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.api.servicecontrol.v1.MetricValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a single metric value.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.MetricValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.MetricValue) + com.google.api.servicecontrol.v1.MetricValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.MetricValue.class, + com.google.api.servicecontrol.v1.MetricValue.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.MetricValue.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(); + internalGetMutableLabels().clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValue getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValue build() { + com.google.api.servicecontrol.v1.MetricValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValue buildPartial() { + com.google.api.servicecontrol.v1.MetricValue result = + new com.google.api.servicecontrol.v1.MetricValue(this); + int from_bitField0_ = bitField0_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + if (valueCase_ == 4) { + result.value_ = value_; + } + if (valueCase_ == 5) { + result.value_ = value_; + } + if (valueCase_ == 6) { + result.value_ = value_; + } + if (valueCase_ == 7) { + result.value_ = value_; + } + if (valueCase_ == 8) { + if (distributionValueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = distributionValueBuilder_.build(); + } + } + result.valueCase_ = valueCase_; + 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.api.servicecontrol.v1.MetricValue) { + return mergeFrom((com.google.api.servicecontrol.v1.MetricValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.MetricValue other) { + if (other == com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance()) return this; + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + switch (other.getValueCase()) { + case BOOL_VALUE: + { + setBoolValue(other.getBoolValue()); + break; + } + case INT64_VALUE: + { + setInt64Value(other.getInt64Value()); + break; + } + case DOUBLE_VALUE: + { + setDoubleValue(other.getDoubleValue()); + break; + } + case STRING_VALUE: + { + valueCase_ = 7; + value_ = other.value_; + onChanged(); + break; + } + case DISTRIBUTION_VALUE: + { + mergeDistributionValue(other.getDistributionValue()); + break; + } + case VALUE_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.api.servicecontrol.v1.MetricValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.MetricValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels describing the metric value.
+     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+     * the overriding relationship.
+     * Note that this map must not contain monitored resource labels.
+     * 
+ * + * map<string, string> labels = 1; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The start of the time period over which this metric value's measurement
+     * applies. The time period has different semantics for different metric
+     * types (cumulative, delta, and gauge). See the metric definition
+     * documentation in the service configuration for details. If not specified,
+     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The end of the time period over which this metric value's measurement
+     * applies.  If not specified,
+     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool bool_value = 4; + * + * @return Whether the boolValue field is set. + */ + public boolean hasBoolValue() { + return valueCase_ == 4; + } + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool bool_value = 4; + * + * @return The boolValue. + */ + public boolean getBoolValue() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool bool_value = 4; + * + * @param value The boolValue to set. + * @return This builder for chaining. + */ + public Builder setBoolValue(boolean value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool bool_value = 4; + * + * @return This builder for chaining. + */ + public Builder clearBoolValue() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A signed 64-bit integer value.
+     * 
+ * + * int64 int64_value = 5; + * + * @return Whether the int64Value field is set. + */ + public boolean hasInt64Value() { + return valueCase_ == 5; + } + /** + * + * + *
+     * A signed 64-bit integer value.
+     * 
+ * + * int64 int64_value = 5; + * + * @return The int64Value. + */ + public long getInt64Value() { + if (valueCase_ == 5) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * + * + *
+     * A signed 64-bit integer value.
+     * 
+ * + * int64 int64_value = 5; + * + * @param value The int64Value to set. + * @return This builder for chaining. + */ + public Builder setInt64Value(long value) { + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A signed 64-bit integer value.
+     * 
+ * + * int64 int64_value = 5; + * + * @return This builder for chaining. + */ + public Builder clearInt64Value() { + if (valueCase_ == 5) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A double precision floating point value.
+     * 
+ * + * double double_value = 6; + * + * @return Whether the doubleValue field is set. + */ + public boolean hasDoubleValue() { + return valueCase_ == 6; + } + /** + * + * + *
+     * A double precision floating point value.
+     * 
+ * + * double double_value = 6; + * + * @return The doubleValue. + */ + public double getDoubleValue() { + if (valueCase_ == 6) { + return (java.lang.Double) value_; + } + return 0D; + } + /** + * + * + *
+     * A double precision floating point value.
+     * 
+ * + * double double_value = 6; + * + * @param value The doubleValue to set. + * @return This builder for chaining. + */ + public Builder setDoubleValue(double value) { + valueCase_ = 6; + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A double precision floating point value.
+     * 
+ * + * double double_value = 6; + * + * @return This builder for chaining. + */ + public Builder clearDoubleValue() { + if (valueCase_ == 6) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return valueCase_ == 7; + } + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 7) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 7) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 7) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 7) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 7; + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (valueCase_ == 7) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A text string value.
+     * 
+ * + * string string_value = 7; + * + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 7; + value_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution, + com.google.api.servicecontrol.v1.Distribution.Builder, + com.google.api.servicecontrol.v1.DistributionOrBuilder> + distributionValueBuilder_; + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return Whether the distributionValue field is set. + */ + @java.lang.Override + public boolean hasDistributionValue() { + return valueCase_ == 8; + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return The distributionValue. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Distribution getDistributionValue() { + if (distributionValueBuilder_ == null) { + if (valueCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution) value_; + } + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } else { + if (valueCase_ == 8) { + return distributionValueBuilder_.getMessage(); + } + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + public Builder setDistributionValue(com.google.api.servicecontrol.v1.Distribution value) { + if (distributionValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + distributionValueBuilder_.setMessage(value); + } + valueCase_ = 8; + return this; + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + public Builder setDistributionValue( + com.google.api.servicecontrol.v1.Distribution.Builder builderForValue) { + if (distributionValueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + distributionValueBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 8; + return this; + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + public Builder mergeDistributionValue(com.google.api.servicecontrol.v1.Distribution value) { + if (distributionValueBuilder_ == null) { + if (valueCase_ == 8 + && value_ != com.google.api.servicecontrol.v1.Distribution.getDefaultInstance()) { + value_ = + com.google.api.servicecontrol.v1.Distribution.newBuilder( + (com.google.api.servicecontrol.v1.Distribution) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 8) { + distributionValueBuilder_.mergeFrom(value); + } + distributionValueBuilder_.setMessage(value); + } + valueCase_ = 8; + return this; + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + public Builder clearDistributionValue() { + if (distributionValueBuilder_ == null) { + if (valueCase_ == 8) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 8) { + valueCase_ = 0; + value_ = null; + } + distributionValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + public com.google.api.servicecontrol.v1.Distribution.Builder getDistributionValueBuilder() { + return getDistributionValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.DistributionOrBuilder getDistributionValueOrBuilder() { + if ((valueCase_ == 8) && (distributionValueBuilder_ != null)) { + return distributionValueBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 8) { + return (com.google.api.servicecontrol.v1.Distribution) value_; + } + return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * A distribution value.
+     * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution, + com.google.api.servicecontrol.v1.Distribution.Builder, + com.google.api.servicecontrol.v1.DistributionOrBuilder> + getDistributionValueFieldBuilder() { + if (distributionValueBuilder_ == null) { + if (!(valueCase_ == 8)) { + value_ = com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); + } + distributionValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.servicecontrol.v1.Distribution, + com.google.api.servicecontrol.v1.Distribution.Builder, + com.google.api.servicecontrol.v1.DistributionOrBuilder>( + (com.google.api.servicecontrol.v1.Distribution) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 8; + onChanged(); + ; + return distributionValueBuilder_; + } + + @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.api.servicecontrol.v1.MetricValue) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.MetricValue) + private static final com.google.api.servicecontrol.v1.MetricValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.MetricValue(); + } + + public static com.google.api.servicecontrol.v1.MetricValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MetricValue(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.api.servicecontrol.v1.MetricValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueOrBuilder.java new file mode 100644 index 00000000..727721d1 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueOrBuilder.java @@ -0,0 +1,331 @@ +/* + * 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/api/servicecontrol/v1/metric_value.proto + +package com.google.api.servicecontrol.v1; + +public interface MetricValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.MetricValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels describing the metric value.
+   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
+   * the overriding relationship.
+   * Note that this map must not contain monitored resource labels.
+   * 
+ * + * map<string, string> labels = 1; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The start of the time period over which this metric value's measurement
+   * applies. The time period has different semantics for different metric
+   * types (cumulative, delta, and gauge). See the metric definition
+   * documentation in the service configuration for details. If not specified,
+   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The end of the time period over which this metric value's measurement
+   * applies.  If not specified,
+   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool bool_value = 4; + * + * @return Whether the boolValue field is set. + */ + boolean hasBoolValue(); + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool bool_value = 4; + * + * @return The boolValue. + */ + boolean getBoolValue(); + + /** + * + * + *
+   * A signed 64-bit integer value.
+   * 
+ * + * int64 int64_value = 5; + * + * @return Whether the int64Value field is set. + */ + boolean hasInt64Value(); + /** + * + * + *
+   * A signed 64-bit integer value.
+   * 
+ * + * int64 int64_value = 5; + * + * @return The int64Value. + */ + long getInt64Value(); + + /** + * + * + *
+   * A double precision floating point value.
+   * 
+ * + * double double_value = 6; + * + * @return Whether the doubleValue field is set. + */ + boolean hasDoubleValue(); + /** + * + * + *
+   * A double precision floating point value.
+   * 
+ * + * double double_value = 6; + * + * @return The doubleValue. + */ + double getDoubleValue(); + + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * + * + *
+   * A text string value.
+   * 
+ * + * string string_value = 7; + * + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString getStringValueBytes(); + + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return Whether the distributionValue field is set. + */ + boolean hasDistributionValue(); + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + * + * @return The distributionValue. + */ + com.google.api.servicecontrol.v1.Distribution getDistributionValue(); + /** + * + * + *
+   * A distribution value.
+   * 
+ * + * .google.api.servicecontrol.v1.Distribution distribution_value = 8; + */ + com.google.api.servicecontrol.v1.DistributionOrBuilder getDistributionValueOrBuilder(); + + public com.google.api.servicecontrol.v1.MetricValue.ValueCase getValueCase(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSet.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSet.java new file mode 100644 index 00000000..88eb21ce --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSet.java @@ -0,0 +1,1135 @@ +/* + * 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/api/servicecontrol/v1/metric_value.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Represents a set of metric values in the same metric.
+ * Each metric value in the set should have a unique combination of start time,
+ * end time, and label values.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.MetricValueSet} + */ +public final class MetricValueSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.MetricValueSet) + MetricValueSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricValueSet.newBuilder() to construct. + private MetricValueSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MetricValueSet() { + metricName_ = ""; + metricValues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MetricValueSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MetricValueSet( + 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(); + + metricName_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metricValues_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + metricValues_.add( + input.readMessage( + com.google.api.servicecontrol.v1.MetricValue.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + metricValues_ = java.util.Collections.unmodifiableList(metricValues_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValueSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.MetricValueSet.class, + com.google.api.servicecontrol.v1.MetricValueSet.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object metricName_; + /** + * + * + *
+   * The metric name defined in the service configuration.
+   * 
+ * + * string metric_name = 1; + * + * @return The metricName. + */ + @java.lang.Override + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + 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(); + metricName_ = s; + return s; + } + } + /** + * + * + *
+   * The metric name defined in the service configuration.
+   * 
+ * + * string metric_name = 1; + * + * @return The bytes for metricName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_VALUES_FIELD_NUMBER = 2; + private java.util.List metricValues_; + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + @java.lang.Override + public java.util.List getMetricValuesList() { + return metricValues_; + } + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + @java.lang.Override + public java.util.List + getMetricValuesOrBuilderList() { + return metricValues_; + } + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + @java.lang.Override + public int getMetricValuesCount() { + return metricValues_.size(); + } + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValue getMetricValues(int index) { + return metricValues_.get(index); + } + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueOrBuilder getMetricValuesOrBuilder(int index) { + return metricValues_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getMetricNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + for (int i = 0; i < metricValues_.size(); i++) { + output.writeMessage(2, metricValues_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMetricNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + for (int i = 0; i < metricValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metricValues_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.servicecontrol.v1.MetricValueSet)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.MetricValueSet other = + (com.google.api.servicecontrol.v1.MetricValueSet) obj; + + if (!getMetricName().equals(other.getMetricName())) return false; + if (!getMetricValuesList().equals(other.getMetricValuesList())) 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) + METRIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricName().hashCode(); + if (getMetricValuesCount() > 0) { + hash = (37 * hash) + METRIC_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getMetricValuesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.MetricValueSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet 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.api.servicecontrol.v1.MetricValueSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet 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.api.servicecontrol.v1.MetricValueSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet 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.api.servicecontrol.v1.MetricValueSet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet 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.api.servicecontrol.v1.MetricValueSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a set of metric values in the same metric.
+   * Each metric value in the set should have a unique combination of start time,
+   * end time, and label values.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.MetricValueSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.MetricValueSet) + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValueSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.MetricValueSet.class, + com.google.api.servicecontrol.v1.MetricValueSet.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.MetricValueSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetricValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + metricName_ = ""; + + if (metricValuesBuilder_ == null) { + metricValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + metricValuesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.MetricValueSetProto + .internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet build() { + com.google.api.servicecontrol.v1.MetricValueSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet buildPartial() { + com.google.api.servicecontrol.v1.MetricValueSet result = + new com.google.api.servicecontrol.v1.MetricValueSet(this); + int from_bitField0_ = bitField0_; + result.metricName_ = metricName_; + if (metricValuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + metricValues_ = java.util.Collections.unmodifiableList(metricValues_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.metricValues_ = metricValues_; + } else { + result.metricValues_ = metricValuesBuilder_.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.api.servicecontrol.v1.MetricValueSet) { + return mergeFrom((com.google.api.servicecontrol.v1.MetricValueSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.MetricValueSet other) { + if (other == com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()) + return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + onChanged(); + } + if (metricValuesBuilder_ == null) { + if (!other.metricValues_.isEmpty()) { + if (metricValues_.isEmpty()) { + metricValues_ = other.metricValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMetricValuesIsMutable(); + metricValues_.addAll(other.metricValues_); + } + onChanged(); + } + } else { + if (!other.metricValues_.isEmpty()) { + if (metricValuesBuilder_.isEmpty()) { + metricValuesBuilder_.dispose(); + metricValuesBuilder_ = null; + metricValues_ = other.metricValues_; + bitField0_ = (bitField0_ & ~0x00000001); + metricValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMetricValuesFieldBuilder() + : null; + } else { + metricValuesBuilder_.addAllMessages(other.metricValues_); + } + } + } + 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.api.servicecontrol.v1.MetricValueSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.MetricValueSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object metricName_ = ""; + /** + * + * + *
+     * The metric name defined in the service configuration.
+     * 
+ * + * string metric_name = 1; + * + * @return The metricName. + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The metric name defined in the service configuration.
+     * 
+ * + * string metric_name = 1; + * + * @return The bytes for metricName. + */ + public com.google.protobuf.ByteString getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The metric name defined in the service configuration.
+     * 
+ * + * string metric_name = 1; + * + * @param value The metricName to set. + * @return This builder for chaining. + */ + public Builder setMetricName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + metricName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The metric name defined in the service configuration.
+     * 
+ * + * string metric_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearMetricName() { + + metricName_ = getDefaultInstance().getMetricName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The metric name defined in the service configuration.
+     * 
+ * + * string metric_name = 1; + * + * @param value The bytes for metricName to set. + * @return This builder for chaining. + */ + public Builder setMetricNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + metricName_ = value; + onChanged(); + return this; + } + + private java.util.List metricValues_ = + java.util.Collections.emptyList(); + + private void ensureMetricValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + metricValues_ = + new java.util.ArrayList(metricValues_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValue, + com.google.api.servicecontrol.v1.MetricValue.Builder, + com.google.api.servicecontrol.v1.MetricValueOrBuilder> + metricValuesBuilder_; + + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public java.util.List getMetricValuesList() { + if (metricValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(metricValues_); + } else { + return metricValuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public int getMetricValuesCount() { + if (metricValuesBuilder_ == null) { + return metricValues_.size(); + } else { + return metricValuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public com.google.api.servicecontrol.v1.MetricValue getMetricValues(int index) { + if (metricValuesBuilder_ == null) { + return metricValues_.get(index); + } else { + return metricValuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder setMetricValues(int index, com.google.api.servicecontrol.v1.MetricValue value) { + if (metricValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValuesIsMutable(); + metricValues_.set(index, value); + onChanged(); + } else { + metricValuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder setMetricValues( + int index, com.google.api.servicecontrol.v1.MetricValue.Builder builderForValue) { + if (metricValuesBuilder_ == null) { + ensureMetricValuesIsMutable(); + metricValues_.set(index, builderForValue.build()); + onChanged(); + } else { + metricValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder addMetricValues(com.google.api.servicecontrol.v1.MetricValue value) { + if (metricValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValuesIsMutable(); + metricValues_.add(value); + onChanged(); + } else { + metricValuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder addMetricValues(int index, com.google.api.servicecontrol.v1.MetricValue value) { + if (metricValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValuesIsMutable(); + metricValues_.add(index, value); + onChanged(); + } else { + metricValuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder addMetricValues( + com.google.api.servicecontrol.v1.MetricValue.Builder builderForValue) { + if (metricValuesBuilder_ == null) { + ensureMetricValuesIsMutable(); + metricValues_.add(builderForValue.build()); + onChanged(); + } else { + metricValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder addMetricValues( + int index, com.google.api.servicecontrol.v1.MetricValue.Builder builderForValue) { + if (metricValuesBuilder_ == null) { + ensureMetricValuesIsMutable(); + metricValues_.add(index, builderForValue.build()); + onChanged(); + } else { + metricValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder addAllMetricValues( + java.lang.Iterable values) { + if (metricValuesBuilder_ == null) { + ensureMetricValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metricValues_); + onChanged(); + } else { + metricValuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder clearMetricValues() { + if (metricValuesBuilder_ == null) { + metricValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + metricValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public Builder removeMetricValues(int index) { + if (metricValuesBuilder_ == null) { + ensureMetricValuesIsMutable(); + metricValues_.remove(index); + onChanged(); + } else { + metricValuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public com.google.api.servicecontrol.v1.MetricValue.Builder getMetricValuesBuilder(int index) { + return getMetricValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public com.google.api.servicecontrol.v1.MetricValueOrBuilder getMetricValuesOrBuilder( + int index) { + if (metricValuesBuilder_ == null) { + return metricValues_.get(index); + } else { + return metricValuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public java.util.List + getMetricValuesOrBuilderList() { + if (metricValuesBuilder_ != null) { + return metricValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metricValues_); + } + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public com.google.api.servicecontrol.v1.MetricValue.Builder addMetricValuesBuilder() { + return getMetricValuesFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance()); + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public com.google.api.servicecontrol.v1.MetricValue.Builder addMetricValuesBuilder(int index) { + return getMetricValuesFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance()); + } + /** + * + * + *
+     * The values in this metric.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + public java.util.List + getMetricValuesBuilderList() { + return getMetricValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValue, + com.google.api.servicecontrol.v1.MetricValue.Builder, + com.google.api.servicecontrol.v1.MetricValueOrBuilder> + getMetricValuesFieldBuilder() { + if (metricValuesBuilder_ == null) { + metricValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValue, + com.google.api.servicecontrol.v1.MetricValue.Builder, + com.google.api.servicecontrol.v1.MetricValueOrBuilder>( + metricValues_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + metricValues_ = null; + } + return metricValuesBuilder_; + } + + @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.api.servicecontrol.v1.MetricValueSet) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.MetricValueSet) + private static final com.google.api.servicecontrol.v1.MetricValueSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.MetricValueSet(); + } + + public static com.google.api.servicecontrol.v1.MetricValueSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricValueSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MetricValueSet(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.api.servicecontrol.v1.MetricValueSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetOrBuilder.java new file mode 100644 index 00000000..5a5f5629 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/servicecontrol/v1/metric_value.proto + +package com.google.api.servicecontrol.v1; + +public interface MetricValueSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.MetricValueSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The metric name defined in the service configuration.
+   * 
+ * + * string metric_name = 1; + * + * @return The metricName. + */ + java.lang.String getMetricName(); + /** + * + * + *
+   * The metric name defined in the service configuration.
+   * 
+ * + * string metric_name = 1; + * + * @return The bytes for metricName. + */ + com.google.protobuf.ByteString getMetricNameBytes(); + + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + java.util.List getMetricValuesList(); + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + com.google.api.servicecontrol.v1.MetricValue getMetricValues(int index); + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + int getMetricValuesCount(); + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + java.util.List + getMetricValuesOrBuilderList(); + /** + * + * + *
+   * The values in this metric.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValue metric_values = 2; + */ + com.google.api.servicecontrol.v1.MetricValueOrBuilder getMetricValuesOrBuilder(int index); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetProto.java new file mode 100644 index 00000000..631740a5 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/MetricValueSetProto.java @@ -0,0 +1,119 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/servicecontrol/v1/metric_value.proto + +package com.google.api.servicecontrol.v1; + +public final class MetricValueSetProto { + private MetricValueSetProto() {} + + 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_api_servicecontrol_v1_MetricValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_MetricValueSet_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/api/servicecontrol/v1/metric_va" + + "lue.proto\022\034google.api.servicecontrol.v1\032" + + "/google/api/servicecontrol/v1/distributi" + + "on.proto\032\037google/protobuf/timestamp.prot" + + "o\"\221\003\n\013MetricValue\022E\n\006labels\030\001 \003(\01325.goog" + + "le.api.servicecontrol.v1.MetricValue.Lab" + + "elsEntry\022.\n\nstart_time\030\002 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022,\n\010end_time\030\003 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022\024\n\nbool_value\030\004 \001" + + "(\010H\000\022\025\n\013int64_value\030\005 \001(\003H\000\022\026\n\014double_va" + + "lue\030\006 \001(\001H\000\022\026\n\014string_value\030\007 \001(\tH\000\022H\n\022d" + + "istribution_value\030\010 \001(\0132*.google.api.ser" + + "vicecontrol.v1.DistributionH\000\032-\n\013LabelsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\007\n\005" + + "value\"g\n\016MetricValueSet\022\023\n\013metric_name\030\001" + + " \001(\t\022@\n\rmetric_values\030\002 \003(\0132).google.api" + + ".servicecontrol.v1.MetricValueB\356\001\n com.g" + + "oogle.api.servicecontrol.v1B\023MetricValue" + + "SetProtoP\001ZJgoogle.golang.org/genproto/g" + + "oogleapis/api/servicecontrol/v1;servicec" + + "ontrol\370\001\001\252\002\036Google.Cloud.ServiceControl." + + "V1\312\002\036Google\\Cloud\\ServiceControl\\V1\352\002!Go" + + "ogle::Cloud::ServiceControl::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.servicecontrol.v1.DistributionProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_MetricValue_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_MetricValue_descriptor, + new java.lang.String[] { + "Labels", + "StartTime", + "EndTime", + "BoolValue", + "Int64Value", + "DoubleValue", + "StringValue", + "DistributionValue", + "Value", + }); + internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_descriptor = + internal_static_google_api_servicecontrol_v1_MetricValue_descriptor.getNestedTypes().get(0); + internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_servicecontrol_v1_MetricValueSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_MetricValueSet_descriptor, + new java.lang.String[] { + "MetricName", "MetricValues", + }); + com.google.api.servicecontrol.v1.DistributionProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Operation.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Operation.java new file mode 100644 index 00000000..d905c6c5 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/Operation.java @@ -0,0 +1,4121 @@ +/* + * 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/api/servicecontrol/v1/operation.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Represents information regarding an operation.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Operation} + */ +public final class Operation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.Operation) + OperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Operation.newBuilder() to construct. + private Operation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Operation() { + operationId_ = ""; + operationName_ = ""; + consumerId_ = ""; + metricValueSets_ = java.util.Collections.emptyList(); + logEntries_ = java.util.Collections.emptyList(); + importance_ = 0; + extensions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Operation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Operation( + 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(); + + operationId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + operationName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + consumerId_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metricValueSets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + metricValueSets_.add( + input.readMessage( + com.google.api.servicecontrol.v1.MetricValueSet.parser(), extensionRegistry)); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + logEntries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + logEntries_.add( + input.readMessage( + com.google.api.servicecontrol.v1.LogEntry.parser(), extensionRegistry)); + break; + } + case 88: + { + int rawValue = input.readEnum(); + + importance_ = rawValue; + break; + } + case 130: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + extensions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + extensions_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + metricValueSets_ = java.util.Collections.unmodifiableList(metricValueSets_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + logEntries_ = java.util.Collections.unmodifiableList(logEntries_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Operation.class, + com.google.api.servicecontrol.v1.Operation.Builder.class); + } + + /** + * + * + *
+   * Defines the importance of the data contained in the operation.
+   * 
+ * + * Protobuf enum {@code google.api.servicecontrol.v1.Operation.Importance} + */ + public enum Importance implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Allows data caching, batching, and aggregation. It provides
+     * higher performance with higher data loss risk.
+     * 
+ * + * LOW = 0; + */ + LOW(0), + /** + * + * + *
+     * Disables data aggregation to minimize data loss. It is for operations
+     * that contains significant monetary value or audit trail. This feature
+     * only applies to the client libraries.
+     * 
+ * + * HIGH = 1; + */ + HIGH(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Allows data caching, batching, and aggregation. It provides
+     * higher performance with higher data loss risk.
+     * 
+ * + * LOW = 0; + */ + public static final int LOW_VALUE = 0; + /** + * + * + *
+     * Disables data aggregation to minimize data loss. It is for operations
+     * that contains significant monetary value or audit trail. This feature
+     * only applies to the client libraries.
+     * 
+ * + * HIGH = 1; + */ + public static final int HIGH_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 Importance 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 Importance forNumber(int value) { + switch (value) { + case 0: + return LOW; + case 1: + return HIGH; + 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 Importance findValueByNumber(int number) { + return Importance.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.servicecontrol.v1.Operation.getDescriptor().getEnumTypes().get(0); + } + + private static final Importance[] VALUES = values(); + + public static Importance 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 Importance(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.Operation.Importance) + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object operationId_; + /** + * + * + *
+   * Identity of the operation. This must be unique within the scope of the
+   * service that generated the operation. If the service calls
+   * Check() and Report() on the same operation, the two calls should carry
+   * the same id.
+   * UUID version 4 is recommended, though not required.
+   * In scenarios where an operation is computed from existing information
+   * and an idempotent id is desirable for deduplication purpose, UUID version 5
+   * is recommended. See RFC 4122 for details.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + 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(); + operationId_ = s; + return s; + } + } + /** + * + * + *
+   * Identity of the operation. This must be unique within the scope of the
+   * service that generated the operation. If the service calls
+   * Check() and Report() on the same operation, the two calls should carry
+   * the same id.
+   * UUID version 4 is recommended, though not required.
+   * In scenarios where an operation is computed from existing information
+   * and an idempotent id is desirable for deduplication purpose, UUID version 5
+   * is recommended. See RFC 4122 for details.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object operationName_; + /** + * + * + *
+   * Fully qualified name of the operation. Reserved for future use.
+   * 
+ * + * string operation_name = 2; + * + * @return The operationName. + */ + @java.lang.Override + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + 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(); + operationName_ = s; + return s; + } + } + /** + * + * + *
+   * Fully qualified name of the operation. Reserved for future use.
+   * 
+ * + * string operation_name = 2; + * + * @return The bytes for operationName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object consumerId_; + /** + * + * + *
+   * Identity of the consumer who is using the service.
+   * This field should be filled in for the operations initiated by a
+   * consumer, but not for service-initiated operations that are
+   * not related to a specific consumer.
+   * - This can be in one of the following formats:
+   *     - project:PROJECT_ID,
+   *     - project`_`number:PROJECT_NUMBER,
+   *     - projects/PROJECT_ID or PROJECT_NUMBER,
+   *     - folders/FOLDER_NUMBER,
+   *     - organizations/ORGANIZATION_NUMBER,
+   *     - api`_`key:API_KEY.
+   * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + @java.lang.Override + public java.lang.String getConsumerId() { + java.lang.Object ref = consumerId_; + 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(); + consumerId_ = s; + return s; + } + } + /** + * + * + *
+   * Identity of the consumer who is using the service.
+   * This field should be filled in for the operations initiated by a
+   * consumer, but not for service-initiated operations that are
+   * not related to a specific consumer.
+   * - This can be in one of the following formats:
+   *     - project:PROJECT_ID,
+   *     - project`_`number:PROJECT_NUMBER,
+   *     - projects/PROJECT_ID or PROJECT_NUMBER,
+   *     - folders/FOLDER_NUMBER,
+   *     - organizations/ORGANIZATION_NUMBER,
+   *     - api`_`key:API_KEY.
+   * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerIdBytes() { + java.lang.Object ref = consumerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int LABELS_FIELD_NUMBER = 6; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METRIC_VALUE_SETS_FIELD_NUMBER = 7; + private java.util.List metricValueSets_; + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + @java.lang.Override + public java.util.List getMetricValueSetsList() { + return metricValueSets_; + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + @java.lang.Override + public java.util.List + getMetricValueSetsOrBuilderList() { + return metricValueSets_; + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + @java.lang.Override + public int getMetricValueSetsCount() { + return metricValueSets_.size(); + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet getMetricValueSets(int index) { + return metricValueSets_.get(index); + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getMetricValueSetsOrBuilder( + int index) { + return metricValueSets_.get(index); + } + + public static final int LOG_ENTRIES_FIELD_NUMBER = 8; + private java.util.List logEntries_; + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + @java.lang.Override + public java.util.List getLogEntriesList() { + return logEntries_; + } + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + @java.lang.Override + public java.util.List + getLogEntriesOrBuilderList() { + return logEntries_; + } + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + @java.lang.Override + public int getLogEntriesCount() { + return logEntries_.size(); + } + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntry getLogEntries(int index) { + return logEntries_.get(index); + } + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.LogEntryOrBuilder getLogEntriesOrBuilder(int index) { + return logEntries_.get(index); + } + + public static final int IMPORTANCE_FIELD_NUMBER = 11; + private int importance_; + /** + * + * + *
+   * DO NOT USE. This is an experimental field.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The enum numeric value on the wire for importance. + */ + @java.lang.Override + public int getImportanceValue() { + return importance_; + } + /** + * + * + *
+   * DO NOT USE. This is an experimental field.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The importance. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation.Importance getImportance() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.Operation.Importance result = + com.google.api.servicecontrol.v1.Operation.Importance.valueOf(importance_); + return result == null + ? com.google.api.servicecontrol.v1.Operation.Importance.UNRECOGNIZED + : result; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 16; + private java.util.List extensions_; + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + @java.lang.Override + public java.util.List getExtensionsList() { + return extensions_; + } + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + @java.lang.Override + public java.util.List getExtensionsOrBuilderList() { + return extensions_; + } + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + @java.lang.Override + public int getExtensionsCount() { + return extensions_.size(); + } + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + @java.lang.Override + public com.google.protobuf.Any getExtensions(int index) { + return extensions_.get(index); + } + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) { + return extensions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getOperationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationId_); + } + if (!getOperationNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, operationName_); + } + if (!getConsumerIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, consumerId_); + } + if (startTime_ != null) { + output.writeMessage(4, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(5, getEndTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); + for (int i = 0; i < metricValueSets_.size(); i++) { + output.writeMessage(7, metricValueSets_.get(i)); + } + for (int i = 0; i < logEntries_.size(); i++) { + output.writeMessage(8, logEntries_.get(i)); + } + if (importance_ != com.google.api.servicecontrol.v1.Operation.Importance.LOW.getNumber()) { + output.writeEnum(11, importance_); + } + for (int i = 0; i < extensions_.size(); i++) { + output.writeMessage(16, extensions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationId_); + } + if (!getOperationNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, operationName_); + } + if (!getConsumerIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, consumerId_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); + } + for (int i = 0; i < metricValueSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, metricValueSets_.get(i)); + } + for (int i = 0; i < logEntries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, logEntries_.get(i)); + } + if (importance_ != com.google.api.servicecontrol.v1.Operation.Importance.LOW.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, importance_); + } + for (int i = 0; i < extensions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, extensions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.servicecontrol.v1.Operation)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.Operation other = + (com.google.api.servicecontrol.v1.Operation) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getOperationName().equals(other.getOperationName())) return false; + if (!getConsumerId().equals(other.getConsumerId())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getMetricValueSetsList().equals(other.getMetricValueSetsList())) return false; + if (!getLogEntriesList().equals(other.getLogEntriesList())) return false; + if (importance_ != other.importance_) return false; + if (!getExtensionsList().equals(other.getExtensionsList())) 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) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + hash = (37 * hash) + OPERATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOperationName().hashCode(); + hash = (37 * hash) + CONSUMER_ID_FIELD_NUMBER; + hash = (53 * hash) + getConsumerId().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getMetricValueSetsCount() > 0) { + hash = (37 * hash) + METRIC_VALUE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getMetricValueSetsList().hashCode(); + } + if (getLogEntriesCount() > 0) { + hash = (37 * hash) + LOG_ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getLogEntriesList().hashCode(); + } + hash = (37 * hash) + IMPORTANCE_FIELD_NUMBER; + hash = (53 * hash) + importance_; + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.Operation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Operation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Operation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Operation 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.api.servicecontrol.v1.Operation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.Operation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.Operation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Operation 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.api.servicecontrol.v1.Operation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Operation 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.api.servicecontrol.v1.Operation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.Operation 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.api.servicecontrol.v1.Operation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents information regarding an operation.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.Operation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.Operation) + com.google.api.servicecontrol.v1.OperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.Operation.class, + com.google.api.servicecontrol.v1.Operation.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.Operation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetricValueSetsFieldBuilder(); + getLogEntriesFieldBuilder(); + getExtensionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + operationId_ = ""; + + operationName_ = ""; + + consumerId_ = ""; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (metricValueSetsBuilder_ == null) { + metricValueSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + metricValueSetsBuilder_.clear(); + } + if (logEntriesBuilder_ == null) { + logEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + logEntriesBuilder_.clear(); + } + importance_ = 0; + + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + extensionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.OperationProto + .internal_static_google_api_servicecontrol_v1_Operation_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.Operation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation build() { + com.google.api.servicecontrol.v1.Operation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation buildPartial() { + com.google.api.servicecontrol.v1.Operation result = + new com.google.api.servicecontrol.v1.Operation(this); + int from_bitField0_ = bitField0_; + result.operationId_ = operationId_; + result.operationName_ = operationName_; + result.consumerId_ = consumerId_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (metricValueSetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + metricValueSets_ = java.util.Collections.unmodifiableList(metricValueSets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.metricValueSets_ = metricValueSets_; + } else { + result.metricValueSets_ = metricValueSetsBuilder_.build(); + } + if (logEntriesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + logEntries_ = java.util.Collections.unmodifiableList(logEntries_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.logEntries_ = logEntries_; + } else { + result.logEntries_ = logEntriesBuilder_.build(); + } + result.importance_ = importance_; + if (extensionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.extensions_ = extensions_; + } else { + result.extensions_ = extensionsBuilder_.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.api.servicecontrol.v1.Operation) { + return mergeFrom((com.google.api.servicecontrol.v1.Operation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.Operation other) { + if (other == com.google.api.servicecontrol.v1.Operation.getDefaultInstance()) return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + onChanged(); + } + if (!other.getOperationName().isEmpty()) { + operationName_ = other.operationName_; + onChanged(); + } + if (!other.getConsumerId().isEmpty()) { + consumerId_ = other.consumerId_; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (metricValueSetsBuilder_ == null) { + if (!other.metricValueSets_.isEmpty()) { + if (metricValueSets_.isEmpty()) { + metricValueSets_ = other.metricValueSets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMetricValueSetsIsMutable(); + metricValueSets_.addAll(other.metricValueSets_); + } + onChanged(); + } + } else { + if (!other.metricValueSets_.isEmpty()) { + if (metricValueSetsBuilder_.isEmpty()) { + metricValueSetsBuilder_.dispose(); + metricValueSetsBuilder_ = null; + metricValueSets_ = other.metricValueSets_; + bitField0_ = (bitField0_ & ~0x00000002); + metricValueSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMetricValueSetsFieldBuilder() + : null; + } else { + metricValueSetsBuilder_.addAllMessages(other.metricValueSets_); + } + } + } + if (logEntriesBuilder_ == null) { + if (!other.logEntries_.isEmpty()) { + if (logEntries_.isEmpty()) { + logEntries_ = other.logEntries_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLogEntriesIsMutable(); + logEntries_.addAll(other.logEntries_); + } + onChanged(); + } + } else { + if (!other.logEntries_.isEmpty()) { + if (logEntriesBuilder_.isEmpty()) { + logEntriesBuilder_.dispose(); + logEntriesBuilder_ = null; + logEntries_ = other.logEntries_; + bitField0_ = (bitField0_ & ~0x00000004); + logEntriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLogEntriesFieldBuilder() + : null; + } else { + logEntriesBuilder_.addAllMessages(other.logEntries_); + } + } + } + if (other.importance_ != 0) { + setImportanceValue(other.getImportanceValue()); + } + if (extensionsBuilder_ == null) { + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + onChanged(); + } + } else { + if (!other.extensions_.isEmpty()) { + if (extensionsBuilder_.isEmpty()) { + extensionsBuilder_.dispose(); + extensionsBuilder_ = null; + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000008); + extensionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExtensionsFieldBuilder() + : null; + } else { + extensionsBuilder_.addAllMessages(other.extensions_); + } + } + } + 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.api.servicecontrol.v1.Operation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.Operation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object operationId_ = ""; + /** + * + * + *
+     * Identity of the operation. This must be unique within the scope of the
+     * service that generated the operation. If the service calls
+     * Check() and Report() on the same operation, the two calls should carry
+     * the same id.
+     * UUID version 4 is recommended, though not required.
+     * In scenarios where an operation is computed from existing information
+     * and an idempotent id is desirable for deduplication purpose, UUID version 5
+     * is recommended. See RFC 4122 for details.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identity of the operation. This must be unique within the scope of the
+     * service that generated the operation. If the service calls
+     * Check() and Report() on the same operation, the two calls should carry
+     * the same id.
+     * UUID version 4 is recommended, though not required.
+     * In scenarios where an operation is computed from existing information
+     * and an idempotent id is desirable for deduplication purpose, UUID version 5
+     * is recommended. See RFC 4122 for details.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identity of the operation. This must be unique within the scope of the
+     * service that generated the operation. If the service calls
+     * Check() and Report() on the same operation, the two calls should carry
+     * the same id.
+     * UUID version 4 is recommended, though not required.
+     * In scenarios where an operation is computed from existing information
+     * and an idempotent id is desirable for deduplication purpose, UUID version 5
+     * is recommended. See RFC 4122 for details.
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the operation. This must be unique within the scope of the
+     * service that generated the operation. If the service calls
+     * Check() and Report() on the same operation, the two calls should carry
+     * the same id.
+     * UUID version 4 is recommended, though not required.
+     * In scenarios where an operation is computed from existing information
+     * and an idempotent id is desirable for deduplication purpose, UUID version 5
+     * is recommended. See RFC 4122 for details.
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + + operationId_ = getDefaultInstance().getOperationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the operation. This must be unique within the scope of the
+     * service that generated the operation. If the service calls
+     * Check() and Report() on the same operation, the two calls should carry
+     * the same id.
+     * UUID version 4 is recommended, though not required.
+     * In scenarios where an operation is computed from existing information
+     * and an idempotent id is desirable for deduplication purpose, UUID version 5
+     * is recommended. See RFC 4122 for details.
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object operationName_ = ""; + /** + * + * + *
+     * Fully qualified name of the operation. Reserved for future use.
+     * 
+ * + * string operation_name = 2; + * + * @return The operationName. + */ + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the operation. Reserved for future use.
+     * 
+ * + * string operation_name = 2; + * + * @return The bytes for operationName. + */ + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the operation. Reserved for future use.
+     * 
+ * + * string operation_name = 2; + * + * @param value The operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the operation. Reserved for future use.
+     * 
+ * + * string operation_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearOperationName() { + + operationName_ = getDefaultInstance().getOperationName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the operation. Reserved for future use.
+     * 
+ * + * string operation_name = 2; + * + * @param value The bytes for operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationName_ = value; + onChanged(); + return this; + } + + private java.lang.Object consumerId_ = ""; + /** + * + * + *
+     * Identity of the consumer who is using the service.
+     * This field should be filled in for the operations initiated by a
+     * consumer, but not for service-initiated operations that are
+     * not related to a specific consumer.
+     * - This can be in one of the following formats:
+     *     - project:PROJECT_ID,
+     *     - project`_`number:PROJECT_NUMBER,
+     *     - projects/PROJECT_ID or PROJECT_NUMBER,
+     *     - folders/FOLDER_NUMBER,
+     *     - organizations/ORGANIZATION_NUMBER,
+     *     - api`_`key:API_KEY.
+     * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + public java.lang.String getConsumerId() { + java.lang.Object ref = consumerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identity of the consumer who is using the service.
+     * This field should be filled in for the operations initiated by a
+     * consumer, but not for service-initiated operations that are
+     * not related to a specific consumer.
+     * - This can be in one of the following formats:
+     *     - project:PROJECT_ID,
+     *     - project`_`number:PROJECT_NUMBER,
+     *     - projects/PROJECT_ID or PROJECT_NUMBER,
+     *     - folders/FOLDER_NUMBER,
+     *     - organizations/ORGANIZATION_NUMBER,
+     *     - api`_`key:API_KEY.
+     * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + public com.google.protobuf.ByteString getConsumerIdBytes() { + java.lang.Object ref = consumerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identity of the consumer who is using the service.
+     * This field should be filled in for the operations initiated by a
+     * consumer, but not for service-initiated operations that are
+     * not related to a specific consumer.
+     * - This can be in one of the following formats:
+     *     - project:PROJECT_ID,
+     *     - project`_`number:PROJECT_NUMBER,
+     *     - projects/PROJECT_ID or PROJECT_NUMBER,
+     *     - folders/FOLDER_NUMBER,
+     *     - organizations/ORGANIZATION_NUMBER,
+     *     - api`_`key:API_KEY.
+     * 
+ * + * string consumer_id = 3; + * + * @param value The consumerId to set. + * @return This builder for chaining. + */ + public Builder setConsumerId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + consumerId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the consumer who is using the service.
+     * This field should be filled in for the operations initiated by a
+     * consumer, but not for service-initiated operations that are
+     * not related to a specific consumer.
+     * - This can be in one of the following formats:
+     *     - project:PROJECT_ID,
+     *     - project`_`number:PROJECT_NUMBER,
+     *     - projects/PROJECT_ID or PROJECT_NUMBER,
+     *     - folders/FOLDER_NUMBER,
+     *     - organizations/ORGANIZATION_NUMBER,
+     *     - api`_`key:API_KEY.
+     * 
+ * + * string consumer_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearConsumerId() { + + consumerId_ = getDefaultInstance().getConsumerId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the consumer who is using the service.
+     * This field should be filled in for the operations initiated by a
+     * consumer, but not for service-initiated operations that are
+     * not related to a specific consumer.
+     * - This can be in one of the following formats:
+     *     - project:PROJECT_ID,
+     *     - project`_`number:PROJECT_NUMBER,
+     *     - projects/PROJECT_ID or PROJECT_NUMBER,
+     *     - folders/FOLDER_NUMBER,
+     *     - organizations/ORGANIZATION_NUMBER,
+     *     - api`_`key:API_KEY.
+     * 
+ * + * string consumer_id = 3; + * + * @param value The bytes for consumerId to set. + * @return This builder for chaining. + */ + public Builder setConsumerIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + consumerId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Required. Start time of the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * End time of the operation.
+     * Required when the operation is used in
+     * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+     * but optional when the operation is used in
+     * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels describing the operation. Only the following labels are allowed:
+     * - Labels describing monitored resources as defined in
+     *   the service configuration.
+     * - Default labels of metric values. When specified, labels defined in the
+     *   metric value override these default.
+     * - The following labels defined by Google Cloud Platform:
+     *     - `cloud.googleapis.com/location` describing the location where the
+     *        operation happened,
+     *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+     *        of the API request,
+     *     - `servicecontrol.googleapis.com/service_agent` describing the service
+     *        used to handle the API request (e.g. ESP),
+     *     - `servicecontrol.googleapis.com/platform` describing the platform
+     *        where the API is served, such as App Engine, Compute Engine, or
+     *        Kubernetes Engine.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List metricValueSets_ = + java.util.Collections.emptyList(); + + private void ensureMetricValueSetsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + metricValueSets_ = + new java.util.ArrayList( + metricValueSets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + metricValueSetsBuilder_; + + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public java.util.List + getMetricValueSetsList() { + if (metricValueSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(metricValueSets_); + } else { + return metricValueSetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public int getMetricValueSetsCount() { + if (metricValueSetsBuilder_ == null) { + return metricValueSets_.size(); + } else { + return metricValueSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public com.google.api.servicecontrol.v1.MetricValueSet getMetricValueSets(int index) { + if (metricValueSetsBuilder_ == null) { + return metricValueSets_.get(index); + } else { + return metricValueSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder setMetricValueSets( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (metricValueSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValueSetsIsMutable(); + metricValueSets_.set(index, value); + onChanged(); + } else { + metricValueSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder setMetricValueSets( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (metricValueSetsBuilder_ == null) { + ensureMetricValueSetsIsMutable(); + metricValueSets_.set(index, builderForValue.build()); + onChanged(); + } else { + metricValueSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder addMetricValueSets(com.google.api.servicecontrol.v1.MetricValueSet value) { + if (metricValueSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValueSetsIsMutable(); + metricValueSets_.add(value); + onChanged(); + } else { + metricValueSetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder addMetricValueSets( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (metricValueSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricValueSetsIsMutable(); + metricValueSets_.add(index, value); + onChanged(); + } else { + metricValueSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder addMetricValueSets( + com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (metricValueSetsBuilder_ == null) { + ensureMetricValueSetsIsMutable(); + metricValueSets_.add(builderForValue.build()); + onChanged(); + } else { + metricValueSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder addMetricValueSets( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (metricValueSetsBuilder_ == null) { + ensureMetricValueSetsIsMutable(); + metricValueSets_.add(index, builderForValue.build()); + onChanged(); + } else { + metricValueSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder addAllMetricValueSets( + java.lang.Iterable values) { + if (metricValueSetsBuilder_ == null) { + ensureMetricValueSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metricValueSets_); + onChanged(); + } else { + metricValueSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder clearMetricValueSets() { + if (metricValueSetsBuilder_ == null) { + metricValueSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + metricValueSetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public Builder removeMetricValueSets(int index) { + if (metricValueSetsBuilder_ == null) { + ensureMetricValueSetsIsMutable(); + metricValueSets_.remove(index); + onChanged(); + } else { + metricValueSetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder getMetricValueSetsBuilder( + int index) { + return getMetricValueSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getMetricValueSetsOrBuilder( + int index) { + if (metricValueSetsBuilder_ == null) { + return metricValueSets_.get(index); + } else { + return metricValueSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public java.util.List + getMetricValueSetsOrBuilderList() { + if (metricValueSetsBuilder_ != null) { + return metricValueSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metricValueSets_); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addMetricValueSetsBuilder() { + return getMetricValueSetsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addMetricValueSetsBuilder( + int index) { + return getMetricValueSetsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + public java.util.List + getMetricValueSetsBuilderList() { + return getMetricValueSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + getMetricValueSetsFieldBuilder() { + if (metricValueSetsBuilder_ == null) { + metricValueSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder>( + metricValueSets_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + metricValueSets_ = null; + } + return metricValueSetsBuilder_; + } + + private java.util.List logEntries_ = + java.util.Collections.emptyList(); + + private void ensureLogEntriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + logEntries_ = + new java.util.ArrayList(logEntries_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntry, + com.google.api.servicecontrol.v1.LogEntry.Builder, + com.google.api.servicecontrol.v1.LogEntryOrBuilder> + logEntriesBuilder_; + + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public java.util.List getLogEntriesList() { + if (logEntriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(logEntries_); + } else { + return logEntriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public int getLogEntriesCount() { + if (logEntriesBuilder_ == null) { + return logEntries_.size(); + } else { + return logEntriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public com.google.api.servicecontrol.v1.LogEntry getLogEntries(int index) { + if (logEntriesBuilder_ == null) { + return logEntries_.get(index); + } else { + return logEntriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder setLogEntries(int index, com.google.api.servicecontrol.v1.LogEntry value) { + if (logEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogEntriesIsMutable(); + logEntries_.set(index, value); + onChanged(); + } else { + logEntriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder setLogEntries( + int index, com.google.api.servicecontrol.v1.LogEntry.Builder builderForValue) { + if (logEntriesBuilder_ == null) { + ensureLogEntriesIsMutable(); + logEntries_.set(index, builderForValue.build()); + onChanged(); + } else { + logEntriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder addLogEntries(com.google.api.servicecontrol.v1.LogEntry value) { + if (logEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogEntriesIsMutable(); + logEntries_.add(value); + onChanged(); + } else { + logEntriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder addLogEntries(int index, com.google.api.servicecontrol.v1.LogEntry value) { + if (logEntriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogEntriesIsMutable(); + logEntries_.add(index, value); + onChanged(); + } else { + logEntriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder addLogEntries( + com.google.api.servicecontrol.v1.LogEntry.Builder builderForValue) { + if (logEntriesBuilder_ == null) { + ensureLogEntriesIsMutable(); + logEntries_.add(builderForValue.build()); + onChanged(); + } else { + logEntriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder addLogEntries( + int index, com.google.api.servicecontrol.v1.LogEntry.Builder builderForValue) { + if (logEntriesBuilder_ == null) { + ensureLogEntriesIsMutable(); + logEntries_.add(index, builderForValue.build()); + onChanged(); + } else { + logEntriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder addAllLogEntries( + java.lang.Iterable values) { + if (logEntriesBuilder_ == null) { + ensureLogEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, logEntries_); + onChanged(); + } else { + logEntriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder clearLogEntries() { + if (logEntriesBuilder_ == null) { + logEntries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + logEntriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public Builder removeLogEntries(int index) { + if (logEntriesBuilder_ == null) { + ensureLogEntriesIsMutable(); + logEntries_.remove(index); + onChanged(); + } else { + logEntriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public com.google.api.servicecontrol.v1.LogEntry.Builder getLogEntriesBuilder(int index) { + return getLogEntriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public com.google.api.servicecontrol.v1.LogEntryOrBuilder getLogEntriesOrBuilder(int index) { + if (logEntriesBuilder_ == null) { + return logEntries_.get(index); + } else { + return logEntriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public java.util.List + getLogEntriesOrBuilderList() { + if (logEntriesBuilder_ != null) { + return logEntriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logEntries_); + } + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public com.google.api.servicecontrol.v1.LogEntry.Builder addLogEntriesBuilder() { + return getLogEntriesFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public com.google.api.servicecontrol.v1.LogEntry.Builder addLogEntriesBuilder(int index) { + return getLogEntriesFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.LogEntry.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information to be logged.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + public java.util.List + getLogEntriesBuilderList() { + return getLogEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntry, + com.google.api.servicecontrol.v1.LogEntry.Builder, + com.google.api.servicecontrol.v1.LogEntryOrBuilder> + getLogEntriesFieldBuilder() { + if (logEntriesBuilder_ == null) { + logEntriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.LogEntry, + com.google.api.servicecontrol.v1.LogEntry.Builder, + com.google.api.servicecontrol.v1.LogEntryOrBuilder>( + logEntries_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + logEntries_ = null; + } + return logEntriesBuilder_; + } + + private int importance_ = 0; + /** + * + * + *
+     * DO NOT USE. This is an experimental field.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The enum numeric value on the wire for importance. + */ + @java.lang.Override + public int getImportanceValue() { + return importance_; + } + /** + * + * + *
+     * DO NOT USE. This is an experimental field.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @param value The enum numeric value on the wire for importance to set. + * @return This builder for chaining. + */ + public Builder setImportanceValue(int value) { + + importance_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * DO NOT USE. This is an experimental field.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The importance. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation.Importance getImportance() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.Operation.Importance result = + com.google.api.servicecontrol.v1.Operation.Importance.valueOf(importance_); + return result == null + ? com.google.api.servicecontrol.v1.Operation.Importance.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * DO NOT USE. This is an experimental field.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @param value The importance to set. + * @return This builder for chaining. + */ + public Builder setImportance(com.google.api.servicecontrol.v1.Operation.Importance value) { + if (value == null) { + throw new NullPointerException(); + } + + importance_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * DO NOT USE. This is an experimental field.
+     * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return This builder for chaining. + */ + public Builder clearImportance() { + + importance_ = 0; + onChanged(); + return this; + } + + private java.util.List extensions_ = java.util.Collections.emptyList(); + + private void ensureExtensionsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + extensions_ = new java.util.ArrayList(extensions_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + extensionsBuilder_; + + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public java.util.List getExtensionsList() { + if (extensionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(extensions_); + } else { + return extensionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public int getExtensionsCount() { + if (extensionsBuilder_ == null) { + return extensions_.size(); + } else { + return extensionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public com.google.protobuf.Any getExtensions(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder setExtensions(int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder setExtensions(int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.set(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder addExtensions(com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(value); + onChanged(); + } else { + extensionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder addExtensions(int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(index, value); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder addExtensions(com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder addExtensions(int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder addAllExtensions(java.lang.Iterable values) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, extensions_); + onChanged(); + } else { + extensionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder clearExtensions() { + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + extensionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public Builder removeExtensions(int index) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.remove(index); + onChanged(); + } else { + extensionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public com.google.protobuf.Any.Builder getExtensionsBuilder(int index) { + return getExtensionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public java.util.List getExtensionsOrBuilderList() { + if (extensionsBuilder_ != null) { + return extensionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extensions_); + } + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder() { + return getExtensionsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) { + return getExtensionsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Unimplemented.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + public java.util.List getExtensionsBuilderList() { + return getExtensionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getExtensionsFieldBuilder() { + if (extensionsBuilder_ == null) { + extensionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + extensions_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + extensions_ = null; + } + return extensionsBuilder_; + } + + @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.api.servicecontrol.v1.Operation) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.Operation) + private static final com.google.api.servicecontrol.v1.Operation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.Operation(); + } + + public static com.google.api.servicecontrol.v1.Operation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Operation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Operation(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.api.servicecontrol.v1.Operation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationOrBuilder.java new file mode 100644 index 00000000..c8fc45e4 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationOrBuilder.java @@ -0,0 +1,560 @@ +/* + * 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/api/servicecontrol/v1/operation.proto + +package com.google.api.servicecontrol.v1; + +public interface OperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.Operation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identity of the operation. This must be unique within the scope of the
+   * service that generated the operation. If the service calls
+   * Check() and Report() on the same operation, the two calls should carry
+   * the same id.
+   * UUID version 4 is recommended, though not required.
+   * In scenarios where an operation is computed from existing information
+   * and an idempotent id is desirable for deduplication purpose, UUID version 5
+   * is recommended. See RFC 4122 for details.
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + /** + * + * + *
+   * Identity of the operation. This must be unique within the scope of the
+   * service that generated the operation. If the service calls
+   * Check() and Report() on the same operation, the two calls should carry
+   * the same id.
+   * UUID version 4 is recommended, though not required.
+   * In scenarios where an operation is computed from existing information
+   * and an idempotent id is desirable for deduplication purpose, UUID version 5
+   * is recommended. See RFC 4122 for details.
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); + + /** + * + * + *
+   * Fully qualified name of the operation. Reserved for future use.
+   * 
+ * + * string operation_name = 2; + * + * @return The operationName. + */ + java.lang.String getOperationName(); + /** + * + * + *
+   * Fully qualified name of the operation. Reserved for future use.
+   * 
+ * + * string operation_name = 2; + * + * @return The bytes for operationName. + */ + com.google.protobuf.ByteString getOperationNameBytes(); + + /** + * + * + *
+   * Identity of the consumer who is using the service.
+   * This field should be filled in for the operations initiated by a
+   * consumer, but not for service-initiated operations that are
+   * not related to a specific consumer.
+   * - This can be in one of the following formats:
+   *     - project:PROJECT_ID,
+   *     - project`_`number:PROJECT_NUMBER,
+   *     - projects/PROJECT_ID or PROJECT_NUMBER,
+   *     - folders/FOLDER_NUMBER,
+   *     - organizations/ORGANIZATION_NUMBER,
+   *     - api`_`key:API_KEY.
+   * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + java.lang.String getConsumerId(); + /** + * + * + *
+   * Identity of the consumer who is using the service.
+   * This field should be filled in for the operations initiated by a
+   * consumer, but not for service-initiated operations that are
+   * not related to a specific consumer.
+   * - This can be in one of the following formats:
+   *     - project:PROJECT_ID,
+   *     - project`_`number:PROJECT_NUMBER,
+   *     - projects/PROJECT_ID or PROJECT_NUMBER,
+   *     - folders/FOLDER_NUMBER,
+   *     - organizations/ORGANIZATION_NUMBER,
+   *     - api`_`key:API_KEY.
+   * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + com.google.protobuf.ByteString getConsumerIdBytes(); + + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Required. Start time of the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * End time of the operation.
+   * Required when the operation is used in
+   * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
+   * but optional when the operation is used in
+   * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels describing the operation. Only the following labels are allowed:
+   * - Labels describing monitored resources as defined in
+   *   the service configuration.
+   * - Default labels of metric values. When specified, labels defined in the
+   *   metric value override these default.
+   * - The following labels defined by Google Cloud Platform:
+   *     - `cloud.googleapis.com/location` describing the location where the
+   *        operation happened,
+   *     - `servicecontrol.googleapis.com/user_agent` describing the user agent
+   *        of the API request,
+   *     - `servicecontrol.googleapis.com/service_agent` describing the service
+   *        used to handle the API request (e.g. ESP),
+   *     - `servicecontrol.googleapis.com/platform` describing the platform
+   *        where the API is served, such as App Engine, Compute Engine, or
+   *        Kubernetes Engine.
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + java.util.List getMetricValueSetsList(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + com.google.api.servicecontrol.v1.MetricValueSet getMetricValueSets(int index); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + int getMetricValueSetsCount(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + java.util.List + getMetricValueSetsOrBuilderList(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet metric_value_sets = 7; + */ + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getMetricValueSetsOrBuilder(int index); + + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + java.util.List getLogEntriesList(); + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + com.google.api.servicecontrol.v1.LogEntry getLogEntries(int index); + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + int getLogEntriesCount(); + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + java.util.List + getLogEntriesOrBuilderList(); + /** + * + * + *
+   * Represents information to be logged.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.LogEntry log_entries = 8; + */ + com.google.api.servicecontrol.v1.LogEntryOrBuilder getLogEntriesOrBuilder(int index); + + /** + * + * + *
+   * DO NOT USE. This is an experimental field.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The enum numeric value on the wire for importance. + */ + int getImportanceValue(); + /** + * + * + *
+   * DO NOT USE. This is an experimental field.
+   * 
+ * + * .google.api.servicecontrol.v1.Operation.Importance importance = 11; + * + * @return The importance. + */ + com.google.api.servicecontrol.v1.Operation.Importance getImportance(); + + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + java.util.List getExtensionsList(); + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + com.google.protobuf.Any getExtensions(int index); + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + int getExtensionsCount(); + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + java.util.List getExtensionsOrBuilderList(); + /** + * + * + *
+   * Unimplemented.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 16; + */ + com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationProto.java new file mode 100644 index 00000000..c1aaa62e --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/OperationProto.java @@ -0,0 +1,116 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/servicecontrol/v1/operation.proto + +package com.google.api.servicecontrol.v1; + +public final class OperationProto { + private OperationProto() {} + + 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_api_servicecontrol_v1_Operation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Operation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_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/api/servicecontrol/v1/operation" + + ".proto\022\034google.api.servicecontrol.v1\032,go" + + "ogle/api/servicecontrol/v1/log_entry.pro" + + "to\032/google/api/servicecontrol/v1/metric_" + + "value.proto\032\031google/protobuf/any.proto\032\037" + + "google/protobuf/timestamp.proto\"\271\004\n\tOper" + + "ation\022\024\n\014operation_id\030\001 \001(\t\022\026\n\016operation" + + "_name\030\002 \001(\t\022\023\n\013consumer_id\030\003 \001(\t\022.\n\nstar" + + "t_time\030\004 \001(\0132\032.google.protobuf.Timestamp" + + "\022,\n\010end_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estamp\022C\n\006labels\030\006 \003(\01323.google.api.serv" + + "icecontrol.v1.Operation.LabelsEntry\022G\n\021m" + + "etric_value_sets\030\007 \003(\0132,.google.api.serv" + + "icecontrol.v1.MetricValueSet\022;\n\013log_entr" + + "ies\030\010 \003(\0132&.google.api.servicecontrol.v1" + + ".LogEntry\022F\n\nimportance\030\013 \001(\01622.google.a" + + "pi.servicecontrol.v1.Operation.Importanc" + + "e\022(\n\nextensions\030\020 \003(\0132\024.google.protobuf." + + "Any\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\"\037\n\nImportance\022\007\n\003LOW\020\000\022\010\n\004HIG" + + "H\020\001B\351\001\n com.google.api.servicecontrol.v1" + + "B\016OperationProtoP\001ZJgoogle.golang.org/ge" + + "nproto/googleapis/api/servicecontrol/v1;" + + "servicecontrol\370\001\001\252\002\036Google.Cloud.Service" + + "Control.V1\312\002\036Google\\Cloud\\ServiceControl" + + "\\V1\352\002!Google::Cloud::ServiceControl::V1b" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.servicecontrol.v1.LogEntryProto.getDescriptor(), + com.google.api.servicecontrol.v1.MetricValueSetProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_Operation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_Operation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Operation_descriptor, + new java.lang.String[] { + "OperationId", + "OperationName", + "ConsumerId", + "StartTime", + "EndTime", + "Labels", + "MetricValueSets", + "LogEntries", + "Importance", + "Extensions", + }); + internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_descriptor = + internal_static_google_api_servicecontrol_v1_Operation_descriptor.getNestedTypes().get(0); + internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_Operation_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.servicecontrol.v1.LogEntryProto.getDescriptor(); + com.google.api.servicecontrol.v1.MetricValueSetProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerProto.java new file mode 100644 index 00000000..73a5af3f --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaControllerProto.java @@ -0,0 +1,173 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +public final class QuotaControllerProto { + private QuotaControllerProto() {} + + 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_api_servicecontrol_v1_AllocateQuotaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_QuotaOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_QuotaError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_QuotaError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/api/servicecontrol/v1/quota_con" + + "troller.proto\022\034google.api.servicecontrol" + + ".v1\032\034google/api/annotations.proto\032/googl" + + "e/api/servicecontrol/v1/metric_value.pro" + + "to\032\027google/rpc/status.proto\032\027google/api/" + + "client.proto\"\221\001\n\024AllocateQuotaRequest\022\024\n" + + "\014service_name\030\001 \001(\t\022H\n\022allocate_operatio" + + "n\030\002 \001(\0132,.google.api.servicecontrol.v1.Q" + + "uotaOperation\022\031\n\021service_config_id\030\004 \001(\t" + + "\"\306\003\n\016QuotaOperation\022\024\n\014operation_id\030\001 \001(" + + "\t\022\023\n\013method_name\030\002 \001(\t\022\023\n\013consumer_id\030\003 " + + "\001(\t\022H\n\006labels\030\004 \003(\01328.google.api.service" + + "control.v1.QuotaOperation.LabelsEntry\022C\n" + + "\rquota_metrics\030\005 \003(\0132,.google.api.servic" + + "econtrol.v1.MetricValueSet\022J\n\nquota_mode" + + "\030\006 \001(\01626.google.api.servicecontrol.v1.Qu" + + "otaOperation.QuotaMode\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"j\n\tQuotaMo" + + "de\022\017\n\013UNSPECIFIED\020\000\022\n\n\006NORMAL\020\001\022\017\n\013BEST_" + + "EFFORT\020\002\022\016\n\nCHECK_ONLY\020\003\022\016\n\nQUERY_ONLY\020\004" + + "\022\017\n\013ADJUST_ONLY\020\005\"\320\001\n\025AllocateQuotaRespo" + + "nse\022\024\n\014operation_id\030\001 \001(\t\022A\n\017allocate_er" + + "rors\030\002 \003(\0132(.google.api.servicecontrol.v" + + "1.QuotaError\022C\n\rquota_metrics\030\003 \003(\0132,.go" + + "ogle.api.servicecontrol.v1.MetricValueSe" + + "t\022\031\n\021service_config_id\030\004 \001(\t\"\234\002\n\nQuotaEr" + + "ror\022;\n\004code\030\001 \001(\0162-.google.api.serviceco" + + "ntrol.v1.QuotaError.Code\022\017\n\007subject\030\002 \001(" + + "\t\022\023\n\013description\030\003 \001(\t\022\"\n\006status\030\004 \001(\0132\022" + + ".google.rpc.Status\"\206\001\n\004Code\022\017\n\013UNSPECIFI" + + "ED\020\000\022\026\n\022RESOURCE_EXHAUSTED\020\010\022\026\n\022BILLING_" + + "NOT_ACTIVE\020k\022\023\n\017PROJECT_DELETED\020l\022\023\n\017API" + + "_KEY_INVALID\020i\022\023\n\017API_KEY_EXPIRED\020p2\305\002\n\017" + + "QuotaController\022\256\001\n\rAllocateQuota\0222.goog" + + "le.api.servicecontrol.v1.AllocateQuotaRe" + + "quest\0323.google.api.servicecontrol.v1.All" + + "ocateQuotaResponse\"4\202\323\344\223\002.\")/v1/services" + + "/{service_name}:allocateQuota:\001*\032\200\001\312A\035se" + + "rvicecontrol.googleapis.com\322A]https://ww" + + "w.googleapis.com/auth/cloud-platform,htt" + + "ps://www.googleapis.com/auth/servicecont" + + "rolB\357\001\n com.google.api.servicecontrol.v1" + + "B\024QuotaControllerProtoP\001ZJgoogle.golang." + + "org/genproto/googleapis/api/servicecontr" + + "ol/v1;servicecontrol\370\001\001\252\002\036Google.Cloud.S" + + "erviceControl.V1\312\002\036Google\\Cloud\\ServiceC" + + "ontrol\\V1\352\002!Google::Cloud::ServiceContro" + + "l::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.servicecontrol.v1.MetricValueSetProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor, + new java.lang.String[] { + "ServiceName", "AllocateOperation", "ServiceConfigId", + }); + internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_servicecontrol_v1_QuotaOperation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor, + new java.lang.String[] { + "OperationId", "MethodName", "ConsumerId", "Labels", "QuotaMetrics", "QuotaMode", + }); + internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_descriptor = + internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_AllocateQuotaResponse_descriptor, + new java.lang.String[] { + "OperationId", "AllocateErrors", "QuotaMetrics", "ServiceConfigId", + }); + internal_static_google_api_servicecontrol_v1_QuotaError_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_api_servicecontrol_v1_QuotaError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_QuotaError_descriptor, + new java.lang.String[] { + "Code", "Subject", "Description", "Status", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.servicecontrol.v1.MetricValueSetProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaError.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaError.java new file mode 100644 index 00000000..07270a57 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaError.java @@ -0,0 +1,1483 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation].
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.QuotaError} + */ +public final class QuotaError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.QuotaError) + QuotaErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaError.newBuilder() to construct. + private QuotaError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaError() { + code_ = 0; + subject_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QuotaError( + 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(); + + code_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + subject_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = 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.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.QuotaError.class, + com.google.api.servicecontrol.v1.QuotaError.Builder.class); + } + + /** + * + * + *
+   * Error codes related to project config validations are deprecated since the
+   * quota controller methods do not perform these validations. Instead services
+   * have to call the Check method, without quota_properties field, to perform
+   * these validations before calling the quota controller methods. These
+   * methods check only for project deletion to be wipe out compliant.
+   * 
+ * + * Protobuf enum {@code google.api.servicecontrol.v1.QuotaError.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * This is never used.
+     * 
+ * + * UNSPECIFIED = 0; + */ + UNSPECIFIED(0), + /** + * + * + *
+     * Quota allocation failed.
+     * Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED].
+     * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + RESOURCE_EXHAUSTED(8), + /** + * + * + *
+     * Consumer cannot access the service because the service requires active
+     * billing.
+     * 
+ * + * BILLING_NOT_ACTIVE = 107; + */ + BILLING_NOT_ACTIVE(107), + /** + * + * + *
+     * Consumer's project has been marked as deleted (soft deletion).
+     * 
+ * + * PROJECT_DELETED = 108; + */ + PROJECT_DELETED(108), + /** + * + * + *
+     * Specified API key is invalid.
+     * 
+ * + * API_KEY_INVALID = 105; + */ + API_KEY_INVALID(105), + /** + * + * + *
+     * Specified API Key has expired.
+     * 
+ * + * API_KEY_EXPIRED = 112; + */ + API_KEY_EXPIRED(112), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * This is never used.
+     * 
+ * + * UNSPECIFIED = 0; + */ + public static final int UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Quota allocation failed.
+     * Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED].
+     * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + public static final int RESOURCE_EXHAUSTED_VALUE = 8; + /** + * + * + *
+     * Consumer cannot access the service because the service requires active
+     * billing.
+     * 
+ * + * BILLING_NOT_ACTIVE = 107; + */ + public static final int BILLING_NOT_ACTIVE_VALUE = 107; + /** + * + * + *
+     * Consumer's project has been marked as deleted (soft deletion).
+     * 
+ * + * PROJECT_DELETED = 108; + */ + public static final int PROJECT_DELETED_VALUE = 108; + /** + * + * + *
+     * Specified API key is invalid.
+     * 
+ * + * API_KEY_INVALID = 105; + */ + public static final int API_KEY_INVALID_VALUE = 105; + /** + * + * + *
+     * Specified API Key has expired.
+     * 
+ * + * API_KEY_EXPIRED = 112; + */ + public static final int API_KEY_EXPIRED_VALUE = 112; + + 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 Code 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 Code forNumber(int value) { + switch (value) { + case 0: + return UNSPECIFIED; + case 8: + return RESOURCE_EXHAUSTED; + case 107: + return BILLING_NOT_ACTIVE; + case 108: + return PROJECT_DELETED; + case 105: + return API_KEY_INVALID; + case 112: + return API_KEY_EXPIRED; + 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 Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaError.getDescriptor().getEnumTypes().get(0); + } + + private static final Code[] VALUES = values(); + + public static Code 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 Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.QuotaError.Code) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * Error code.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * Error code.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.QuotaError.Code result = + com.google.api.servicecontrol.v1.QuotaError.Code.valueOf(code_); + return result == null ? com.google.api.servicecontrol.v1.QuotaError.Code.UNRECOGNIZED : result; + } + + public static final int SUBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object subject_; + /** + * + * + *
+   * Subject to whom this error applies. See the specific enum for more details
+   * on this field. For example, "clientip:<ip address of client>" or
+   * "project:<Google developer project id>".
+   * 
+ * + * string subject = 2; + * + * @return The subject. + */ + @java.lang.Override + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + 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(); + subject_ = s; + return s; + } + } + /** + * + * + *
+   * Subject to whom this error applies. See the specific enum for more details
+   * on this field. For example, "clientip:<ip address of client>" or
+   * "project:<Google developer project id>".
+   * 
+ * + * string subject = 2; + * + * @return The bytes for subject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Free-form text that provides details on the cause of the error.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Free-form text that provides details on the cause of the error.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private com.google.rpc.Status status_; + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + 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 (code_ != com.google.api.servicecontrol.v1.QuotaError.Code.UNSPECIFIED.getNumber()) { + output.writeEnum(1, code_); + } + if (!getSubjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (status_ != null) { + output.writeMessage(4, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != com.google.api.servicecontrol.v1.QuotaError.Code.UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!getSubjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStatus()); + } + 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.api.servicecontrol.v1.QuotaError)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.QuotaError other = + (com.google.api.servicecontrol.v1.QuotaError) obj; + + if (code_ != other.code_) return false; + if (!getSubject().equals(other.getSubject())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.QuotaError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.QuotaError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaError 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.api.servicecontrol.v1.QuotaError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.QuotaError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaError 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.api.servicecontrol.v1.QuotaError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaError 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.api.servicecontrol.v1.QuotaError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaError 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.api.servicecontrol.v1.QuotaError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation].
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.QuotaError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.QuotaError) + com.google.api.servicecontrol.v1.QuotaErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.QuotaError.class, + com.google.api.servicecontrol.v1.QuotaError.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.QuotaError.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(); + code_ = 0; + + subject_ = ""; + + description_ = ""; + + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaError_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.QuotaError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError build() { + com.google.api.servicecontrol.v1.QuotaError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError buildPartial() { + com.google.api.servicecontrol.v1.QuotaError result = + new com.google.api.servicecontrol.v1.QuotaError(this); + result.code_ = code_; + result.subject_ = subject_; + result.description_ = description_; + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.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.api.servicecontrol.v1.QuotaError) { + return mergeFrom((com.google.api.servicecontrol.v1.QuotaError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.QuotaError other) { + if (other == com.google.api.servicecontrol.v1.QuotaError.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getSubject().isEmpty()) { + subject_ = other.subject_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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.api.servicecontrol.v1.QuotaError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.QuotaError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * Error code.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Error code.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Error code.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.QuotaError.Code result = + com.google.api.servicecontrol.v1.QuotaError.Code.valueOf(code_); + return result == null + ? com.google.api.servicecontrol.v1.QuotaError.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Error code.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.api.servicecontrol.v1.QuotaError.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Error code.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object subject_ = ""; + /** + * + * + *
+     * Subject to whom this error applies. See the specific enum for more details
+     * on this field. For example, "clientip:<ip address of client>" or
+     * "project:<Google developer project id>".
+     * 
+ * + * string subject = 2; + * + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific enum for more details
+     * on this field. For example, "clientip:<ip address of client>" or
+     * "project:<Google developer project id>".
+     * 
+ * + * string subject = 2; + * + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific enum for more details
+     * on this field. For example, "clientip:<ip address of client>" or
+     * "project:<Google developer project id>".
+     * 
+ * + * string subject = 2; + * + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subject_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific enum for more details
+     * on this field. For example, "clientip:<ip address of client>" or
+     * "project:<Google developer project id>".
+     * 
+ * + * string subject = 2; + * + * @return This builder for chaining. + */ + public Builder clearSubject() { + + subject_ = getDefaultInstance().getSubject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Subject to whom this error applies. See the specific enum for more details
+     * on this field. For example, "clientip:<ip address of client>" or
+     * "project:<Google developer project id>".
+     * 
+ * + * string subject = 2; + * + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subject_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Free-form text that provides details on the cause of the error.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Free-form text that provides details on the cause of the error.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Free-form text that provides details on the cause of the error.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Free-form text that provides details on the cause of the error.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Free-form text that provides details on the cause of the error.
+     * 
+ * + * 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.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+     * Contains additional information about the quota error.
+     * If available, `status.code` will be non zero.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @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.api.servicecontrol.v1.QuotaError) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.QuotaError) + private static final com.google.api.servicecontrol.v1.QuotaError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.QuotaError(); + } + + public static com.google.api.servicecontrol.v1.QuotaError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QuotaError(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.api.servicecontrol.v1.QuotaError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaErrorOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaErrorOrBuilder.java new file mode 100644 index 00000000..b2db58ff --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaErrorOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface QuotaErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.QuotaError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Error code.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * Error code.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaError.Code code = 1; + * + * @return The code. + */ + com.google.api.servicecontrol.v1.QuotaError.Code getCode(); + + /** + * + * + *
+   * Subject to whom this error applies. See the specific enum for more details
+   * on this field. For example, "clientip:<ip address of client>" or
+   * "project:<Google developer project id>".
+   * 
+ * + * string subject = 2; + * + * @return The subject. + */ + java.lang.String getSubject(); + /** + * + * + *
+   * Subject to whom this error applies. See the specific enum for more details
+   * on this field. For example, "clientip:<ip address of client>" or
+   * "project:<Google developer project id>".
+   * 
+ * + * string subject = 2; + * + * @return The bytes for subject. + */ + com.google.protobuf.ByteString getSubjectBytes(); + + /** + * + * + *
+   * Free-form text that provides details on the cause of the error.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Free-form text that provides details on the cause of the error.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+   * Contains additional information about the quota error.
+   * If available, `status.code` will be non zero.
+   * 
+ * + * .google.rpc.Status status = 4; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperation.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperation.java new file mode 100644 index 00000000..8f610122 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperation.java @@ -0,0 +1,2570 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Represents information regarding a quota operation.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.QuotaOperation} + */ +public final class QuotaOperation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.QuotaOperation) + QuotaOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaOperation.newBuilder() to construct. + private QuotaOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaOperation() { + operationId_ = ""; + methodName_ = ""; + consumerId_ = ""; + quotaMetrics_ = java.util.Collections.emptyList(); + quotaMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaOperation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QuotaOperation( + 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(); + + operationId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + methodName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + consumerId_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + quotaMetrics_.add( + input.readMessage( + com.google.api.servicecontrol.v1.MetricValueSet.parser(), extensionRegistry)); + break; + } + case 48: + { + int rawValue = input.readEnum(); + + quotaMode_ = 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_ & 0x00000002) != 0)) { + quotaMetrics_ = java.util.Collections.unmodifiableList(quotaMetrics_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.QuotaOperation.class, + com.google.api.servicecontrol.v1.QuotaOperation.Builder.class); + } + + /** + * + * + *
+   * Supported quota modes.
+   * 
+ * + * Protobuf enum {@code google.api.servicecontrol.v1.QuotaOperation.QuotaMode} + */ + public enum QuotaMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Guard against implicit default. Must not be used.
+     * 
+ * + * UNSPECIFIED = 0; + */ + UNSPECIFIED(0), + /** + * + * + *
+     * For AllocateQuota request, allocates quota for the amount specified in
+     * the service configuration or specified using the quota metrics. If the
+     * amount is higher than the available quota, allocation error will be
+     * returned and no quota will be allocated.
+     * If multiple quotas are part of the request, and one fails, none of the
+     * quotas are allocated or released.
+     * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + * + * + *
+     * The operation allocates quota for the amount specified in the service
+     * configuration or specified using the quota metrics. If the amount is
+     * higher than the available quota, request does not fail but all available
+     * quota will be allocated.
+     * For rate quota, BEST_EFFORT will continue to deduct from other groups
+     * even if one does not have enough quota. For allocation, it will find the
+     * minimum available amount across all groups and deduct that amount from
+     * all the affected groups.
+     * 
+ * + * BEST_EFFORT = 2; + */ + BEST_EFFORT(2), + /** + * + * + *
+     * For AllocateQuota request, only checks if there is enough quota
+     * available and does not change the available quota. No lock is placed on
+     * the available quota either.
+     * 
+ * + * CHECK_ONLY = 3; + */ + CHECK_ONLY(3), + /** + * + * + *
+     * Unimplemented. When used in AllocateQuotaRequest, this returns the
+     * effective quota limit(s) in the response, and no quota check will be
+     * performed. Not supported for other requests, and even for
+     * AllocateQuotaRequest, this is currently supported only for allowlisted
+     * services.
+     * 
+ * + * QUERY_ONLY = 4; + */ + QUERY_ONLY(4), + /** + * + * + *
+     * The operation allocates quota for the amount specified in the service
+     * configuration or specified using the quota metrics. If the requested
+     * amount is higher than the available quota, request does not fail and
+     * remaining quota would become negative (going over the limit).
+     * Not supported for Rate Quota.
+     * 
+ * + * ADJUST_ONLY = 5; + */ + ADJUST_ONLY(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Guard against implicit default. Must not be used.
+     * 
+ * + * UNSPECIFIED = 0; + */ + public static final int UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * For AllocateQuota request, allocates quota for the amount specified in
+     * the service configuration or specified using the quota metrics. If the
+     * amount is higher than the available quota, allocation error will be
+     * returned and no quota will be allocated.
+     * If multiple quotas are part of the request, and one fails, none of the
+     * quotas are allocated or released.
+     * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + /** + * + * + *
+     * The operation allocates quota for the amount specified in the service
+     * configuration or specified using the quota metrics. If the amount is
+     * higher than the available quota, request does not fail but all available
+     * quota will be allocated.
+     * For rate quota, BEST_EFFORT will continue to deduct from other groups
+     * even if one does not have enough quota. For allocation, it will find the
+     * minimum available amount across all groups and deduct that amount from
+     * all the affected groups.
+     * 
+ * + * BEST_EFFORT = 2; + */ + public static final int BEST_EFFORT_VALUE = 2; + /** + * + * + *
+     * For AllocateQuota request, only checks if there is enough quota
+     * available and does not change the available quota. No lock is placed on
+     * the available quota either.
+     * 
+ * + * CHECK_ONLY = 3; + */ + public static final int CHECK_ONLY_VALUE = 3; + /** + * + * + *
+     * Unimplemented. When used in AllocateQuotaRequest, this returns the
+     * effective quota limit(s) in the response, and no quota check will be
+     * performed. Not supported for other requests, and even for
+     * AllocateQuotaRequest, this is currently supported only for allowlisted
+     * services.
+     * 
+ * + * QUERY_ONLY = 4; + */ + public static final int QUERY_ONLY_VALUE = 4; + /** + * + * + *
+     * The operation allocates quota for the amount specified in the service
+     * configuration or specified using the quota metrics. If the requested
+     * amount is higher than the available quota, request does not fail and
+     * remaining quota would become negative (going over the limit).
+     * Not supported for Rate Quota.
+     * 
+ * + * ADJUST_ONLY = 5; + */ + public static final int ADJUST_ONLY_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 QuotaMode 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 QuotaMode forNumber(int value) { + switch (value) { + case 0: + return UNSPECIFIED; + case 1: + return NORMAL; + case 2: + return BEST_EFFORT; + case 3: + return CHECK_ONLY; + case 4: + return QUERY_ONLY; + case 5: + return ADJUST_ONLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public QuotaMode findValueByNumber(int number) { + return QuotaMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaOperation.getDescriptor().getEnumTypes().get(0); + } + + private static final QuotaMode[] VALUES = values(); + + public static QuotaMode 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 QuotaMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.QuotaOperation.QuotaMode) + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object operationId_; + /** + * + * + *
+   * Identity of the operation. This is expected to be unique within the scope
+   * of the service that generated the operation, and guarantees idempotency in
+   * case of retries.
+   * In order to ensure best performance and latency in the Quota backends,
+   * operation_ids are optimally associated with time, so that related
+   * operations can be accessed fast in storage. For this reason, the
+   * recommended token for services that intend to operate at a high QPS is
+   * Unix time in nanos + UUID
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + 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(); + operationId_ = s; + return s; + } + } + /** + * + * + *
+   * Identity of the operation. This is expected to be unique within the scope
+   * of the service that generated the operation, and guarantees idempotency in
+   * case of retries.
+   * In order to ensure best performance and latency in the Quota backends,
+   * operation_ids are optimally associated with time, so that related
+   * operations can be accessed fast in storage. For this reason, the
+   * recommended token for services that intend to operate at a high QPS is
+   * Unix time in nanos + UUID
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METHOD_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object methodName_; + /** + * + * + *
+   * Fully qualified name of the API method for which this quota operation is
+   * requested. This name is used for matching quota rules or metric rules and
+   * billing status rules defined in service configuration.
+   * This field should not be set if any of the following is true:
+   * (1) the quota operation is performed on non-API resources.
+   * (2) quota_metrics is set because the caller is doing quota override.
+   * Example of an RPC method name:
+   *     google.example.library.v1.LibraryService.CreateShelf
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + @java.lang.Override + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + 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(); + methodName_ = s; + return s; + } + } + /** + * + * + *
+   * Fully qualified name of the API method for which this quota operation is
+   * requested. This name is used for matching quota rules or metric rules and
+   * billing status rules defined in service configuration.
+   * This field should not be set if any of the following is true:
+   * (1) the quota operation is performed on non-API resources.
+   * (2) quota_metrics is set because the caller is doing quota override.
+   * Example of an RPC method name:
+   *     google.example.library.v1.LibraryService.CreateShelf
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSUMER_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object consumerId_; + /** + * + * + *
+   * Identity of the consumer for whom this quota operation is being performed.
+   * This can be in one of the following formats:
+   *   project:<project_id>,
+   *   project_number:<project_number>,
+   *   api_key:<api_key>.
+   * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + @java.lang.Override + public java.lang.String getConsumerId() { + java.lang.Object ref = consumerId_; + 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(); + consumerId_ = s; + return s; + } + } + /** + * + * + *
+   * Identity of the consumer for whom this quota operation is being performed.
+   * This can be in one of the following formats:
+   *   project:<project_id>,
+   *   project_number:<project_number>,
+   *   api_key:<api_key>.
+   * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsumerIdBytes() { + java.lang.Object ref = consumerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int QUOTA_METRICS_FIELD_NUMBER = 5; + private java.util.List quotaMetrics_; + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + @java.lang.Override + public java.util.List getQuotaMetricsList() { + return quotaMetrics_; + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + @java.lang.Override + public java.util.List + getQuotaMetricsOrBuilderList() { + return quotaMetrics_; + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + @java.lang.Override + public int getQuotaMetricsCount() { + return quotaMetrics_.size(); + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index) { + return quotaMetrics_.get(index); + } + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder( + int index) { + return quotaMetrics_.get(index); + } + + public static final int QUOTA_MODE_FIELD_NUMBER = 6; + private int quotaMode_; + /** + * + * + *
+   * Quota mode for this operation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The enum numeric value on the wire for quotaMode. + */ + @java.lang.Override + public int getQuotaModeValue() { + return quotaMode_; + } + /** + * + * + *
+   * Quota mode for this operation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The quotaMode. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode getQuotaMode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode result = + com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.valueOf(quotaMode_); + return result == null + ? com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getOperationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationId_); + } + if (!getMethodNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, methodName_); + } + if (!getConsumerIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, consumerId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + for (int i = 0; i < quotaMetrics_.size(); i++) { + output.writeMessage(5, quotaMetrics_.get(i)); + } + if (quotaMode_ + != com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.UNSPECIFIED.getNumber()) { + output.writeEnum(6, quotaMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationId_); + } + if (!getMethodNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, methodName_); + } + if (!getConsumerIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, consumerId_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + for (int i = 0; i < quotaMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, quotaMetrics_.get(i)); + } + if (quotaMode_ + != com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, quotaMode_); + } + 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.api.servicecontrol.v1.QuotaOperation)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.QuotaOperation other = + (com.google.api.servicecontrol.v1.QuotaOperation) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (!getMethodName().equals(other.getMethodName())) return false; + if (!getConsumerId().equals(other.getConsumerId())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getQuotaMetricsList().equals(other.getQuotaMetricsList())) return false; + if (quotaMode_ != other.quotaMode_) 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) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + hash = (37 * hash) + METHOD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMethodName().hashCode(); + hash = (37 * hash) + CONSUMER_ID_FIELD_NUMBER; + hash = (53 * hash) + getConsumerId().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getQuotaMetricsCount() > 0) { + hash = (37 * hash) + QUOTA_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaMetricsList().hashCode(); + } + hash = (37 * hash) + QUOTA_MODE_FIELD_NUMBER; + hash = (53 * hash) + quotaMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.QuotaOperation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation 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.api.servicecontrol.v1.QuotaOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation 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.api.servicecontrol.v1.QuotaOperation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation 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.api.servicecontrol.v1.QuotaOperation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation 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.api.servicecontrol.v1.QuotaOperation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents information regarding a quota operation.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.QuotaOperation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.QuotaOperation) + com.google.api.servicecontrol.v1.QuotaOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.QuotaOperation.class, + com.google.api.servicecontrol.v1.QuotaOperation.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.QuotaOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQuotaMetricsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + operationId_ = ""; + + methodName_ = ""; + + consumerId_ = ""; + + internalGetMutableLabels().clear(); + if (quotaMetricsBuilder_ == null) { + quotaMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + quotaMetricsBuilder_.clear(); + } + quotaMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.QuotaControllerProto + .internal_static_google_api_servicecontrol_v1_QuotaOperation_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation build() { + com.google.api.servicecontrol.v1.QuotaOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation buildPartial() { + com.google.api.servicecontrol.v1.QuotaOperation result = + new com.google.api.servicecontrol.v1.QuotaOperation(this); + int from_bitField0_ = bitField0_; + result.operationId_ = operationId_; + result.methodName_ = methodName_; + result.consumerId_ = consumerId_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (quotaMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = java.util.Collections.unmodifiableList(quotaMetrics_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.quotaMetrics_ = quotaMetrics_; + } else { + result.quotaMetrics_ = quotaMetricsBuilder_.build(); + } + result.quotaMode_ = quotaMode_; + 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.api.servicecontrol.v1.QuotaOperation) { + return mergeFrom((com.google.api.servicecontrol.v1.QuotaOperation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.QuotaOperation other) { + if (other == com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + onChanged(); + } + if (!other.getMethodName().isEmpty()) { + methodName_ = other.methodName_; + onChanged(); + } + if (!other.getConsumerId().isEmpty()) { + consumerId_ = other.consumerId_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (quotaMetricsBuilder_ == null) { + if (!other.quotaMetrics_.isEmpty()) { + if (quotaMetrics_.isEmpty()) { + quotaMetrics_ = other.quotaMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.addAll(other.quotaMetrics_); + } + onChanged(); + } + } else { + if (!other.quotaMetrics_.isEmpty()) { + if (quotaMetricsBuilder_.isEmpty()) { + quotaMetricsBuilder_.dispose(); + quotaMetricsBuilder_ = null; + quotaMetrics_ = other.quotaMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + quotaMetricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaMetricsFieldBuilder() + : null; + } else { + quotaMetricsBuilder_.addAllMessages(other.quotaMetrics_); + } + } + } + if (other.quotaMode_ != 0) { + setQuotaModeValue(other.getQuotaModeValue()); + } + 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.api.servicecontrol.v1.QuotaOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.QuotaOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object operationId_ = ""; + /** + * + * + *
+     * Identity of the operation. This is expected to be unique within the scope
+     * of the service that generated the operation, and guarantees idempotency in
+     * case of retries.
+     * In order to ensure best performance and latency in the Quota backends,
+     * operation_ids are optimally associated with time, so that related
+     * operations can be accessed fast in storage. For this reason, the
+     * recommended token for services that intend to operate at a high QPS is
+     * Unix time in nanos + UUID
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identity of the operation. This is expected to be unique within the scope
+     * of the service that generated the operation, and guarantees idempotency in
+     * case of retries.
+     * In order to ensure best performance and latency in the Quota backends,
+     * operation_ids are optimally associated with time, so that related
+     * operations can be accessed fast in storage. For this reason, the
+     * recommended token for services that intend to operate at a high QPS is
+     * Unix time in nanos + UUID
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identity of the operation. This is expected to be unique within the scope
+     * of the service that generated the operation, and guarantees idempotency in
+     * case of retries.
+     * In order to ensure best performance and latency in the Quota backends,
+     * operation_ids are optimally associated with time, so that related
+     * operations can be accessed fast in storage. For this reason, the
+     * recommended token for services that intend to operate at a high QPS is
+     * Unix time in nanos + UUID
+     * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the operation. This is expected to be unique within the scope
+     * of the service that generated the operation, and guarantees idempotency in
+     * case of retries.
+     * In order to ensure best performance and latency in the Quota backends,
+     * operation_ids are optimally associated with time, so that related
+     * operations can be accessed fast in storage. For this reason, the
+     * recommended token for services that intend to operate at a high QPS is
+     * Unix time in nanos + UUID
+     * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + + operationId_ = getDefaultInstance().getOperationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the operation. This is expected to be unique within the scope
+     * of the service that generated the operation, and guarantees idempotency in
+     * case of retries.
+     * In order to ensure best performance and latency in the Quota backends,
+     * operation_ids are optimally associated with time, so that related
+     * operations can be accessed fast in storage. For this reason, the
+     * recommended token for services that intend to operate at a high QPS is
+     * Unix time in nanos + UUID
+     * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object methodName_ = ""; + /** + * + * + *
+     * Fully qualified name of the API method for which this quota operation is
+     * requested. This name is used for matching quota rules or metric rules and
+     * billing status rules defined in service configuration.
+     * This field should not be set if any of the following is true:
+     * (1) the quota operation is performed on non-API resources.
+     * (2) quota_metrics is set because the caller is doing quota override.
+     * Example of an RPC method name:
+     *     google.example.library.v1.LibraryService.CreateShelf
+     * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method for which this quota operation is
+     * requested. This name is used for matching quota rules or metric rules and
+     * billing status rules defined in service configuration.
+     * This field should not be set if any of the following is true:
+     * (1) the quota operation is performed on non-API resources.
+     * (2) quota_metrics is set because the caller is doing quota override.
+     * Example of an RPC method name:
+     *     google.example.library.v1.LibraryService.CreateShelf
+     * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method for which this quota operation is
+     * requested. This name is used for matching quota rules or metric rules and
+     * billing status rules defined in service configuration.
+     * This field should not be set if any of the following is true:
+     * (1) the quota operation is performed on non-API resources.
+     * (2) quota_metrics is set because the caller is doing quota override.
+     * Example of an RPC method name:
+     *     google.example.library.v1.LibraryService.CreateShelf
+     * 
+ * + * string method_name = 2; + * + * @param value The methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + methodName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method for which this quota operation is
+     * requested. This name is used for matching quota rules or metric rules and
+     * billing status rules defined in service configuration.
+     * This field should not be set if any of the following is true:
+     * (1) the quota operation is performed on non-API resources.
+     * (2) quota_metrics is set because the caller is doing quota override.
+     * Example of an RPC method name:
+     *     google.example.library.v1.LibraryService.CreateShelf
+     * 
+ * + * string method_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMethodName() { + + methodName_ = getDefaultInstance().getMethodName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method for which this quota operation is
+     * requested. This name is used for matching quota rules or metric rules and
+     * billing status rules defined in service configuration.
+     * This field should not be set if any of the following is true:
+     * (1) the quota operation is performed on non-API resources.
+     * (2) quota_metrics is set because the caller is doing quota override.
+     * Example of an RPC method name:
+     *     google.example.library.v1.LibraryService.CreateShelf
+     * 
+ * + * string method_name = 2; + * + * @param value The bytes for methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + methodName_ = value; + onChanged(); + return this; + } + + private java.lang.Object consumerId_ = ""; + /** + * + * + *
+     * Identity of the consumer for whom this quota operation is being performed.
+     * This can be in one of the following formats:
+     *   project:<project_id>,
+     *   project_number:<project_number>,
+     *   api_key:<api_key>.
+     * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + public java.lang.String getConsumerId() { + java.lang.Object ref = consumerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identity of the consumer for whom this quota operation is being performed.
+     * This can be in one of the following formats:
+     *   project:<project_id>,
+     *   project_number:<project_number>,
+     *   api_key:<api_key>.
+     * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + public com.google.protobuf.ByteString getConsumerIdBytes() { + java.lang.Object ref = consumerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consumerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identity of the consumer for whom this quota operation is being performed.
+     * This can be in one of the following formats:
+     *   project:<project_id>,
+     *   project_number:<project_number>,
+     *   api_key:<api_key>.
+     * 
+ * + * string consumer_id = 3; + * + * @param value The consumerId to set. + * @return This builder for chaining. + */ + public Builder setConsumerId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + consumerId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the consumer for whom this quota operation is being performed.
+     * This can be in one of the following formats:
+     *   project:<project_id>,
+     *   project_number:<project_number>,
+     *   api_key:<api_key>.
+     * 
+ * + * string consumer_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearConsumerId() { + + consumerId_ = getDefaultInstance().getConsumerId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identity of the consumer for whom this quota operation is being performed.
+     * This can be in one of the following formats:
+     *   project:<project_id>,
+     *   project_number:<project_number>,
+     *   api_key:<api_key>.
+     * 
+ * + * string consumer_id = 3; + * + * @param value The bytes for consumerId to set. + * @return This builder for chaining. + */ + public Builder setConsumerIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + consumerId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels describing the operation.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List quotaMetrics_ = + java.util.Collections.emptyList(); + + private void ensureQuotaMetricsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + quotaMetrics_ = + new java.util.ArrayList(quotaMetrics_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + quotaMetricsBuilder_; + + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public java.util.List getQuotaMetricsList() { + if (quotaMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaMetrics_); + } else { + return quotaMetricsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public int getQuotaMetricsCount() { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.size(); + } else { + return quotaMetricsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index) { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.get(index); + } else { + return quotaMetricsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder setQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.set(index, value); + onChanged(); + } else { + quotaMetricsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder setQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder addQuotaMetrics(com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(value); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder addQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet value) { + if (quotaMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(index, value); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder addQuotaMetrics( + com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder addQuotaMetrics( + int index, com.google.api.servicecontrol.v1.MetricValueSet.Builder builderForValue) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder addAllQuotaMetrics( + java.lang.Iterable values) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaMetrics_); + onChanged(); + } else { + quotaMetricsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder clearQuotaMetrics() { + if (quotaMetricsBuilder_ == null) { + quotaMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + quotaMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public Builder removeQuotaMetrics(int index) { + if (quotaMetricsBuilder_ == null) { + ensureQuotaMetricsIsMutable(); + quotaMetrics_.remove(index); + onChanged(); + } else { + quotaMetricsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder getQuotaMetricsBuilder( + int index) { + return getQuotaMetricsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder( + int index) { + if (quotaMetricsBuilder_ == null) { + return quotaMetrics_.get(index); + } else { + return quotaMetricsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public java.util.List + getQuotaMetricsOrBuilderList() { + if (quotaMetricsBuilder_ != null) { + return quotaMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaMetrics_); + } + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addQuotaMetricsBuilder() { + return getQuotaMetricsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public com.google.api.servicecontrol.v1.MetricValueSet.Builder addQuotaMetricsBuilder( + int index) { + return getQuotaMetricsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.MetricValueSet.getDefaultInstance()); + } + /** + * + * + *
+     * Represents information about this operation. Each MetricValueSet
+     * corresponds to a metric defined in the service configuration.
+     * The data type used in the MetricValueSet must agree with
+     * the data type specified in the metric definition.
+     * Within a single operation, it is not allowed to have more than one
+     * MetricValue instances that have the same metric names and identical
+     * label value combinations. If a request has such duplicated MetricValue
+     * instances, the entire request is rejected with
+     * an invalid argument error.
+     * This field is mutually exclusive with method_name.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + public java.util.List + getQuotaMetricsBuilderList() { + return getQuotaMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder> + getQuotaMetricsFieldBuilder() { + if (quotaMetricsBuilder_ == null) { + quotaMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.MetricValueSet, + com.google.api.servicecontrol.v1.MetricValueSet.Builder, + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder>( + quotaMetrics_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + quotaMetrics_ = null; + } + return quotaMetricsBuilder_; + } + + private int quotaMode_ = 0; + /** + * + * + *
+     * Quota mode for this operation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The enum numeric value on the wire for quotaMode. + */ + @java.lang.Override + public int getQuotaModeValue() { + return quotaMode_; + } + /** + * + * + *
+     * Quota mode for this operation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @param value The enum numeric value on the wire for quotaMode to set. + * @return This builder for chaining. + */ + public Builder setQuotaModeValue(int value) { + + quotaMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota mode for this operation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The quotaMode. + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode getQuotaMode() { + @SuppressWarnings("deprecation") + com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode result = + com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.valueOf(quotaMode_); + return result == null + ? com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Quota mode for this operation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @param value The quotaMode to set. + * @return This builder for chaining. + */ + public Builder setQuotaMode(com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode value) { + if (value == null) { + throw new NullPointerException(); + } + + quotaMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Quota mode for this operation.
+     * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return This builder for chaining. + */ + public Builder clearQuotaMode() { + + quotaMode_ = 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.api.servicecontrol.v1.QuotaOperation) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.QuotaOperation) + private static final com.google.api.servicecontrol.v1.QuotaOperation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.QuotaOperation(); + } + + public static com.google.api.servicecontrol.v1.QuotaOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QuotaOperation(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.api.servicecontrol.v1.QuotaOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperationOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperationOrBuilder.java new file mode 100644 index 00000000..ffb6d1f1 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/QuotaOperationOrBuilder.java @@ -0,0 +1,312 @@ +/* + * 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/api/servicecontrol/v1/quota_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface QuotaOperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.QuotaOperation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identity of the operation. This is expected to be unique within the scope
+   * of the service that generated the operation, and guarantees idempotency in
+   * case of retries.
+   * In order to ensure best performance and latency in the Quota backends,
+   * operation_ids are optimally associated with time, so that related
+   * operations can be accessed fast in storage. For this reason, the
+   * recommended token for services that intend to operate at a high QPS is
+   * Unix time in nanos + UUID
+   * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + /** + * + * + *
+   * Identity of the operation. This is expected to be unique within the scope
+   * of the service that generated the operation, and guarantees idempotency in
+   * case of retries.
+   * In order to ensure best performance and latency in the Quota backends,
+   * operation_ids are optimally associated with time, so that related
+   * operations can be accessed fast in storage. For this reason, the
+   * recommended token for services that intend to operate at a high QPS is
+   * Unix time in nanos + UUID
+   * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); + + /** + * + * + *
+   * Fully qualified name of the API method for which this quota operation is
+   * requested. This name is used for matching quota rules or metric rules and
+   * billing status rules defined in service configuration.
+   * This field should not be set if any of the following is true:
+   * (1) the quota operation is performed on non-API resources.
+   * (2) quota_metrics is set because the caller is doing quota override.
+   * Example of an RPC method name:
+   *     google.example.library.v1.LibraryService.CreateShelf
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + java.lang.String getMethodName(); + /** + * + * + *
+   * Fully qualified name of the API method for which this quota operation is
+   * requested. This name is used for matching quota rules or metric rules and
+   * billing status rules defined in service configuration.
+   * This field should not be set if any of the following is true:
+   * (1) the quota operation is performed on non-API resources.
+   * (2) quota_metrics is set because the caller is doing quota override.
+   * Example of an RPC method name:
+   *     google.example.library.v1.LibraryService.CreateShelf
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + com.google.protobuf.ByteString getMethodNameBytes(); + + /** + * + * + *
+   * Identity of the consumer for whom this quota operation is being performed.
+   * This can be in one of the following formats:
+   *   project:<project_id>,
+   *   project_number:<project_number>,
+   *   api_key:<api_key>.
+   * 
+ * + * string consumer_id = 3; + * + * @return The consumerId. + */ + java.lang.String getConsumerId(); + /** + * + * + *
+   * Identity of the consumer for whom this quota operation is being performed.
+   * This can be in one of the following formats:
+   *   project:<project_id>,
+   *   project_number:<project_number>,
+   *   api_key:<api_key>.
+   * 
+ * + * string consumer_id = 3; + * + * @return The bytes for consumerId. + */ + com.google.protobuf.ByteString getConsumerIdBytes(); + + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels describing the operation.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + java.util.List getQuotaMetricsList(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + com.google.api.servicecontrol.v1.MetricValueSet getQuotaMetrics(int index); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + int getQuotaMetricsCount(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + java.util.List + getQuotaMetricsOrBuilderList(); + /** + * + * + *
+   * Represents information about this operation. Each MetricValueSet
+   * corresponds to a metric defined in the service configuration.
+   * The data type used in the MetricValueSet must agree with
+   * the data type specified in the metric definition.
+   * Within a single operation, it is not allowed to have more than one
+   * MetricValue instances that have the same metric names and identical
+   * label value combinations. If a request has such duplicated MetricValue
+   * instances, the entire request is rejected with
+   * an invalid argument error.
+   * This field is mutually exclusive with method_name.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.MetricValueSet quota_metrics = 5; + */ + com.google.api.servicecontrol.v1.MetricValueSetOrBuilder getQuotaMetricsOrBuilder(int index); + + /** + * + * + *
+   * Quota mode for this operation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The enum numeric value on the wire for quotaMode. + */ + int getQuotaModeValue(); + /** + * + * + *
+   * Quota mode for this operation.
+   * 
+ * + * .google.api.servicecontrol.v1.QuotaOperation.QuotaMode quota_mode = 6; + * + * @return The quotaMode. + */ + com.google.api.servicecontrol.v1.QuotaOperation.QuotaMode getQuotaMode(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequest.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequest.java new file mode 100644 index 00000000..1c88d028 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequest.java @@ -0,0 +1,1540 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Request message for the Report method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportRequest} + */ +public final class ReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.ReportRequest) + ReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportRequest.newBuilder() to construct. + private ReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportRequest() { + serviceName_ = ""; + operations_ = java.util.Collections.emptyList(); + serviceConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReportRequest( + 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(); + + serviceName_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + operations_.add( + input.readMessage( + com.google.api.servicecontrol.v1.Operation.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = 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)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportRequest.class, + com.google.api.servicecontrol.v1.ReportRequest.Builder.class); + } + + public static final int SERVICE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object serviceName_; + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + @java.lang.Override + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + 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(); + serviceName_ = s; + return s; + } + } + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATIONS_FIELD_NUMBER = 2; + private java.util.List operations_; + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + @java.lang.Override + public java.util.List getOperationsList() { + return operations_; + } + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + @java.lang.Override + public java.util.List + getOperationsOrBuilderList() { + return operations_; + } + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + @java.lang.Override + public int getOperationsCount() { + return operations_.size(); + } + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.Operation getOperations(int index) { + return operations_.get(index); + } + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.OperationOrBuilder getOperationsOrBuilder(int index) { + return operations_.get(index); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * Specifies which version of service config should be used to process the
+   * request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 3; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies which version of service config should be used to process the
+   * request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 3; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = 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 (!getServiceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceName_); + } + for (int i = 0; i < operations_.size(); i++) { + output.writeMessage(2, operations_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceConfigId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceName_); + } + for (int i = 0; i < operations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, operations_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceConfigId_); + } + 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.api.servicecontrol.v1.ReportRequest)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.ReportRequest other = + (com.google.api.servicecontrol.v1.ReportRequest) obj; + + if (!getServiceName().equals(other.getServiceName())) return false; + if (!getOperationsList().equals(other.getOperationsList())) return false; + if (!getServiceConfigId().equals(other.getServiceConfigId())) 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) + SERVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getServiceName().hashCode(); + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.ReportRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportRequest 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.api.servicecontrol.v1.ReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportRequest 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.api.servicecontrol.v1.ReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportRequest 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.api.servicecontrol.v1.ReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportRequest 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.api.servicecontrol.v1.ReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the Report method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.ReportRequest) + com.google.api.servicecontrol.v1.ReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportRequest.class, + com.google.api.servicecontrol.v1.ReportRequest.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.ReportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOperationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + serviceName_ = ""; + + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + operationsBuilder_.clear(); + } + serviceConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportRequest getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.ReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportRequest build() { + com.google.api.servicecontrol.v1.ReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportRequest buildPartial() { + com.google.api.servicecontrol.v1.ReportRequest result = + new com.google.api.servicecontrol.v1.ReportRequest(this); + int from_bitField0_ = bitField0_; + result.serviceName_ = serviceName_; + if (operationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.operations_ = operations_; + } else { + result.operations_ = operationsBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + 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.api.servicecontrol.v1.ReportRequest) { + return mergeFrom((com.google.api.servicecontrol.v1.ReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.ReportRequest other) { + if (other == com.google.api.servicecontrol.v1.ReportRequest.getDefaultInstance()) return this; + if (!other.getServiceName().isEmpty()) { + serviceName_ = other.serviceName_; + onChanged(); + } + if (operationsBuilder_ == null) { + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + } else { + if (!other.operations_.isEmpty()) { + if (operationsBuilder_.isEmpty()) { + operationsBuilder_.dispose(); + operationsBuilder_ = null; + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + operationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOperationsFieldBuilder() + : null; + } else { + operationsBuilder_.addAllMessages(other.operations_); + } + } + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + 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.api.servicecontrol.v1.ReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.ReportRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object serviceName_ = ""; + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + public com.google.protobuf.ByteString getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearServiceName() { + + serviceName_ = getDefaultInstance().getServiceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The service name as specified in its service configuration. For example,
+     * `"pubsub.googleapis.com"`.
+     * See
+     * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+     * for the definition of a service name.
+     * 
+ * + * string service_name = 1; + * + * @param value The bytes for serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceName_ = value; + onChanged(); + return this; + } + + private java.util.List operations_ = + java.util.Collections.emptyList(); + + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + operations_ = + new java.util.ArrayList(operations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder> + operationsBuilder_; + + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public java.util.List getOperationsList() { + if (operationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(operations_); + } else { + return operationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public int getOperationsCount() { + if (operationsBuilder_ == null) { + return operations_.size(); + } else { + return operationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public com.google.api.servicecontrol.v1.Operation getOperations(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder setOperations(int index, com.google.api.servicecontrol.v1.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + } else { + operationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder setOperations( + int index, com.google.api.servicecontrol.v1.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.set(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder addOperations(com.google.api.servicecontrol.v1.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + } else { + operationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder addOperations(int index, com.google.api.servicecontrol.v1.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(index, value); + onChanged(); + } else { + operationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder addOperations( + com.google.api.servicecontrol.v1.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder addOperations( + int index, com.google.api.servicecontrol.v1.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder addAllOperations( + java.lang.Iterable values) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operations_); + onChanged(); + } else { + operationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder clearOperations() { + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + operationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public Builder removeOperations(int index) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.remove(index); + onChanged(); + } else { + operationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public com.google.api.servicecontrol.v1.Operation.Builder getOperationsBuilder(int index) { + return getOperationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public com.google.api.servicecontrol.v1.OperationOrBuilder getOperationsOrBuilder(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public java.util.List + getOperationsOrBuilderList() { + if (operationsBuilder_ != null) { + return operationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(operations_); + } + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public com.google.api.servicecontrol.v1.Operation.Builder addOperationsBuilder() { + return getOperationsFieldBuilder() + .addBuilder(com.google.api.servicecontrol.v1.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public com.google.api.servicecontrol.v1.Operation.Builder addOperationsBuilder(int index) { + return getOperationsFieldBuilder() + .addBuilder(index, com.google.api.servicecontrol.v1.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * Operations to be reported.
+     * Typically the service should report one operation per request.
+     * Putting multiple operations into a single request is allowed, but should
+     * be used only when multiple operations are natually available at the time
+     * of the report.
+     * There is no limit on the number of operations in the same ReportRequest,
+     * however the ReportRequest size should be no larger than 1MB. See
+     * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+     * for partial failure behavior.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + public java.util.List + getOperationsBuilderList() { + return getOperationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder> + getOperationsFieldBuilder() { + if (operationsBuilder_ == null) { + operationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.Operation, + com.google.api.servicecontrol.v1.Operation.Builder, + com.google.api.servicecontrol.v1.OperationOrBuilder>( + operations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + operations_ = null; + } + return operationsBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * Specifies which version of service config should be used to process the
+     * request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 3; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies which version of service config should be used to process the
+     * request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 3; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies which version of service config should be used to process the
+     * request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 3; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service config should be used to process the
+     * request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies which version of service config should be used to process the
+     * request.
+     * If unspecified or no matching version can be found, the
+     * latest one will be used.
+     * 
+ * + * string service_config_id = 3; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = 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.api.servicecontrol.v1.ReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.ReportRequest) + private static final com.google.api.servicecontrol.v1.ReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.ReportRequest(); + } + + public static com.google.api.servicecontrol.v1.ReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportRequest(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.api.servicecontrol.v1.ReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequestOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequestOrBuilder.java new file mode 100644 index 00000000..d4cc0113 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportRequestOrBuilder.java @@ -0,0 +1,181 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface ReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.ReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The serviceName. + */ + java.lang.String getServiceName(); + /** + * + * + *
+   * The service name as specified in its service configuration. For example,
+   * `"pubsub.googleapis.com"`.
+   * See
+   * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)
+   * for the definition of a service name.
+   * 
+ * + * string service_name = 1; + * + * @return The bytes for serviceName. + */ + com.google.protobuf.ByteString getServiceNameBytes(); + + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + java.util.List getOperationsList(); + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + com.google.api.servicecontrol.v1.Operation getOperations(int index); + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + int getOperationsCount(); + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + java.util.List + getOperationsOrBuilderList(); + /** + * + * + *
+   * Operations to be reported.
+   * Typically the service should report one operation per request.
+   * Putting multiple operations into a single request is allowed, but should
+   * be used only when multiple operations are natually available at the time
+   * of the report.
+   * There is no limit on the number of operations in the same ReportRequest,
+   * however the ReportRequest size should be no larger than 1MB. See
+   * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors]
+   * for partial failure behavior.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.Operation operations = 2; + */ + com.google.api.servicecontrol.v1.OperationOrBuilder getOperationsOrBuilder(int index); + + /** + * + * + *
+   * Specifies which version of service config should be used to process the
+   * request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 3; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * Specifies which version of service config should be used to process the
+   * request.
+   * If unspecified or no matching version can be found, the
+   * latest one will be used.
+   * 
+ * + * string service_config_id = 3; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponse.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponse.java new file mode 100644 index 00000000..28bbfe42 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponse.java @@ -0,0 +1,2617 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +/** + * + * + *
+ * Response message for the Report method.
+ * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportResponse} + */ +public final class ReportResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.ReportResponse) + ReportResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportResponse.newBuilder() to construct. + private ReportResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportResponse() { + reportErrors_ = java.util.Collections.emptyList(); + serviceConfigId_ = ""; + serviceRolloutId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReportResponse( + 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)) { + reportErrors_ = + new java.util.ArrayList< + com.google.api.servicecontrol.v1.ReportResponse.ReportError>(); + mutable_bitField0_ |= 0x00000001; + } + reportErrors_.add( + input.readMessage( + com.google.api.servicecontrol.v1.ReportResponse.ReportError.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceConfigId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceRolloutId_ = 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)) { + reportErrors_ = java.util.Collections.unmodifiableList(reportErrors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportResponse.class, + com.google.api.servicecontrol.v1.ReportResponse.Builder.class); + } + + public interface ReportErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.ReportResponse.ReportError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The
+     * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+     * value from the request.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + java.lang.String getOperationId(); + /** + * + * + *
+     * The
+     * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+     * value from the request.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + com.google.protobuf.ByteString getOperationIdBytes(); + + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + /** + * + * + *
+   * Represents the processing error of one
+   * [Operation][google.api.servicecontrol.v1.Operation] in the request.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportResponse.ReportError} + */ + public static final class ReportError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.ReportResponse.ReportError) + ReportErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportError.newBuilder() to construct. + private ReportError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportError() { + operationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReportError( + 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(); + + operationId_ = s; + break; + } + case 18: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = 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.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportResponse.ReportError.class, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder.class); + } + + public static final int OPERATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object operationId_; + /** + * + * + *
+     * The
+     * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+     * value from the request.
+     * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + @java.lang.Override + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + 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(); + operationId_ = s; + return s; + } + } + /** + * + * + *
+     * The
+     * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+     * value from the request.
+     * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 2; + private com.google.rpc.Status status_; + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+     * Details of the error when processing the
+     * [Operation][google.api.servicecontrol.v1.Operation].
+     * 
+ * + * .google.rpc.Status status = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + 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 (!getOperationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationId_); + } + if (status_ != null) { + output.writeMessage(2, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationId_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + 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.api.servicecontrol.v1.ReportResponse.ReportError)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.ReportResponse.ReportError other = + (com.google.api.servicecontrol.v1.ReportResponse.ReportError) obj; + + if (!getOperationId().equals(other.getOperationId())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + OPERATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getOperationId().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError 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.api.servicecontrol.v1.ReportResponse.ReportError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError 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.api.servicecontrol.v1.ReportResponse.ReportError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError 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.api.servicecontrol.v1.ReportResponse.ReportError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError 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.api.servicecontrol.v1.ReportResponse.ReportError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents the processing error of one
+     * [Operation][google.api.servicecontrol.v1.Operation] in the request.
+     * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportResponse.ReportError} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.ReportResponse.ReportError) + com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportResponse.ReportError.class, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.ReportResponse.ReportError.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(); + operationId_ = ""; + + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse.ReportError + getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.ReportResponse.ReportError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse.ReportError build() { + com.google.api.servicecontrol.v1.ReportResponse.ReportError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse.ReportError buildPartial() { + com.google.api.servicecontrol.v1.ReportResponse.ReportError result = + new com.google.api.servicecontrol.v1.ReportResponse.ReportError(this); + result.operationId_ = operationId_; + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.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.api.servicecontrol.v1.ReportResponse.ReportError) { + return mergeFrom((com.google.api.servicecontrol.v1.ReportResponse.ReportError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.ReportResponse.ReportError other) { + if (other + == com.google.api.servicecontrol.v1.ReportResponse.ReportError.getDefaultInstance()) + return this; + if (!other.getOperationId().isEmpty()) { + operationId_ = other.operationId_; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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.api.servicecontrol.v1.ReportResponse.ReportError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.api.servicecontrol.v1.ReportResponse.ReportError) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object operationId_ = ""; + /** + * + * + *
+       * The
+       * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+       * value from the request.
+       * 
+ * + * string operation_id = 1; + * + * @return The operationId. + */ + public java.lang.String getOperationId() { + java.lang.Object ref = operationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The
+       * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+       * value from the request.
+       * 
+ * + * string operation_id = 1; + * + * @return The bytes for operationId. + */ + public com.google.protobuf.ByteString getOperationIdBytes() { + java.lang.Object ref = operationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The
+       * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+       * value from the request.
+       * 
+ * + * string operation_id = 1; + * + * @param value The operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The
+       * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+       * value from the request.
+       * 
+ * + * string operation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationId() { + + operationId_ = getDefaultInstance().getOperationId(); + onChanged(); + return this; + } + /** + * + * + *
+       * The
+       * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id]
+       * value from the request.
+       * 
+ * + * string operation_id = 1; + * + * @param value The bytes for operationId to set. + * @return This builder for chaining. + */ + public Builder setOperationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationId_ = value; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+       * Details of the error when processing the
+       * [Operation][google.api.servicecontrol.v1.Operation].
+       * 
+ * + * .google.rpc.Status status = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @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.api.servicecontrol.v1.ReportResponse.ReportError) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.ReportResponse.ReportError) + private static final com.google.api.servicecontrol.v1.ReportResponse.ReportError + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.ReportResponse.ReportError(); + } + + public static com.google.api.servicecontrol.v1.ReportResponse.ReportError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportError(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.api.servicecontrol.v1.ReportResponse.ReportError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int REPORT_ERRORS_FIELD_NUMBER = 1; + private java.util.List reportErrors_; + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + @java.lang.Override + public java.util.List + getReportErrorsList() { + return reportErrors_; + } + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder> + getReportErrorsOrBuilderList() { + return reportErrors_; + } + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + @java.lang.Override + public int getReportErrorsCount() { + return reportErrors_.size(); + } + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse.ReportError getReportErrors(int index) { + return reportErrors_.get(index); + } + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder + getReportErrorsOrBuilder(int index) { + return reportErrors_.get(index); + } + + public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object serviceConfigId_; + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 2; + * + * @return The serviceConfigId. + */ + @java.lang.Override + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + 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(); + serviceConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 2; + * + * @return The bytes for serviceConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ROLLOUT_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object serviceRolloutId_; + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 4; + * + * @return The serviceRolloutId. + */ + @java.lang.Override + public java.lang.String getServiceRolloutId() { + java.lang.Object ref = serviceRolloutId_; + 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(); + serviceRolloutId_ = s; + return s; + } + } + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 4; + * + * @return The bytes for serviceRolloutId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceRolloutIdBytes() { + java.lang.Object ref = serviceRolloutId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRolloutId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < reportErrors_.size(); i++) { + output.writeMessage(1, reportErrors_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceConfigId_); + } + if (!getServiceRolloutIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceRolloutId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < reportErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, reportErrors_.get(i)); + } + if (!getServiceConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceConfigId_); + } + if (!getServiceRolloutIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceRolloutId_); + } + 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.api.servicecontrol.v1.ReportResponse)) { + return super.equals(obj); + } + com.google.api.servicecontrol.v1.ReportResponse other = + (com.google.api.servicecontrol.v1.ReportResponse) obj; + + if (!getReportErrorsList().equals(other.getReportErrorsList())) return false; + if (!getServiceConfigId().equals(other.getServiceConfigId())) return false; + if (!getServiceRolloutId().equals(other.getServiceRolloutId())) 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 (getReportErrorsCount() > 0) { + hash = (37 * hash) + REPORT_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getReportErrorsList().hashCode(); + } + hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfigId().hashCode(); + hash = (37 * hash) + SERVICE_ROLLOUT_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceRolloutId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.servicecontrol.v1.ReportResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse 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.api.servicecontrol.v1.ReportResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.servicecontrol.v1.ReportResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.servicecontrol.v1.ReportResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse 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.api.servicecontrol.v1.ReportResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse 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.api.servicecontrol.v1.ReportResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.servicecontrol.v1.ReportResponse 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.api.servicecontrol.v1.ReportResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the Report method.
+   * 
+ * + * Protobuf type {@code google.api.servicecontrol.v1.ReportResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.ReportResponse) + com.google.api.servicecontrol.v1.ReportResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.servicecontrol.v1.ReportResponse.class, + com.google.api.servicecontrol.v1.ReportResponse.Builder.class); + } + + // Construct using com.google.api.servicecontrol.v1.ReportResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReportErrorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (reportErrorsBuilder_ == null) { + reportErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + reportErrorsBuilder_.clear(); + } + serviceConfigId_ = ""; + + serviceRolloutId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.servicecontrol.v1.ServiceControllerProto + .internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse getDefaultInstanceForType() { + return com.google.api.servicecontrol.v1.ReportResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse build() { + com.google.api.servicecontrol.v1.ReportResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.servicecontrol.v1.ReportResponse buildPartial() { + com.google.api.servicecontrol.v1.ReportResponse result = + new com.google.api.servicecontrol.v1.ReportResponse(this); + int from_bitField0_ = bitField0_; + if (reportErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + reportErrors_ = java.util.Collections.unmodifiableList(reportErrors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reportErrors_ = reportErrors_; + } else { + result.reportErrors_ = reportErrorsBuilder_.build(); + } + result.serviceConfigId_ = serviceConfigId_; + result.serviceRolloutId_ = serviceRolloutId_; + 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.api.servicecontrol.v1.ReportResponse) { + return mergeFrom((com.google.api.servicecontrol.v1.ReportResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.servicecontrol.v1.ReportResponse other) { + if (other == com.google.api.servicecontrol.v1.ReportResponse.getDefaultInstance()) + return this; + if (reportErrorsBuilder_ == null) { + if (!other.reportErrors_.isEmpty()) { + if (reportErrors_.isEmpty()) { + reportErrors_ = other.reportErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReportErrorsIsMutable(); + reportErrors_.addAll(other.reportErrors_); + } + onChanged(); + } + } else { + if (!other.reportErrors_.isEmpty()) { + if (reportErrorsBuilder_.isEmpty()) { + reportErrorsBuilder_.dispose(); + reportErrorsBuilder_ = null; + reportErrors_ = other.reportErrors_; + bitField0_ = (bitField0_ & ~0x00000001); + reportErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReportErrorsFieldBuilder() + : null; + } else { + reportErrorsBuilder_.addAllMessages(other.reportErrors_); + } + } + } + if (!other.getServiceConfigId().isEmpty()) { + serviceConfigId_ = other.serviceConfigId_; + onChanged(); + } + if (!other.getServiceRolloutId().isEmpty()) { + serviceRolloutId_ = other.serviceRolloutId_; + 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.api.servicecontrol.v1.ReportResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.servicecontrol.v1.ReportResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + reportErrors_ = java.util.Collections.emptyList(); + + private void ensureReportErrorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reportErrors_ = + new java.util.ArrayList( + reportErrors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.ReportResponse.ReportError, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder, + com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder> + reportErrorsBuilder_; + + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public java.util.List + getReportErrorsList() { + if (reportErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reportErrors_); + } else { + return reportErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public int getReportErrorsCount() { + if (reportErrorsBuilder_ == null) { + return reportErrors_.size(); + } else { + return reportErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public com.google.api.servicecontrol.v1.ReportResponse.ReportError getReportErrors(int index) { + if (reportErrorsBuilder_ == null) { + return reportErrors_.get(index); + } else { + return reportErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder setReportErrors( + int index, com.google.api.servicecontrol.v1.ReportResponse.ReportError value) { + if (reportErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportErrorsIsMutable(); + reportErrors_.set(index, value); + onChanged(); + } else { + reportErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder setReportErrors( + int index, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder builderForValue) { + if (reportErrorsBuilder_ == null) { + ensureReportErrorsIsMutable(); + reportErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + reportErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder addReportErrors( + com.google.api.servicecontrol.v1.ReportResponse.ReportError value) { + if (reportErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportErrorsIsMutable(); + reportErrors_.add(value); + onChanged(); + } else { + reportErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder addReportErrors( + int index, com.google.api.servicecontrol.v1.ReportResponse.ReportError value) { + if (reportErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportErrorsIsMutable(); + reportErrors_.add(index, value); + onChanged(); + } else { + reportErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder addReportErrors( + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder builderForValue) { + if (reportErrorsBuilder_ == null) { + ensureReportErrorsIsMutable(); + reportErrors_.add(builderForValue.build()); + onChanged(); + } else { + reportErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder addReportErrors( + int index, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder builderForValue) { + if (reportErrorsBuilder_ == null) { + ensureReportErrorsIsMutable(); + reportErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + reportErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder addAllReportErrors( + java.lang.Iterable + values) { + if (reportErrorsBuilder_ == null) { + ensureReportErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reportErrors_); + onChanged(); + } else { + reportErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder clearReportErrors() { + if (reportErrorsBuilder_ == null) { + reportErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + reportErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public Builder removeReportErrors(int index) { + if (reportErrorsBuilder_ == null) { + ensureReportErrorsIsMutable(); + reportErrors_.remove(index); + onChanged(); + } else { + reportErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder + getReportErrorsBuilder(int index) { + return getReportErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder + getReportErrorsOrBuilder(int index) { + if (reportErrorsBuilder_ == null) { + return reportErrors_.get(index); + } else { + return reportErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public java.util.List< + ? extends com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder> + getReportErrorsOrBuilderList() { + if (reportErrorsBuilder_ != null) { + return reportErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reportErrors_); + } + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder + addReportErrorsBuilder() { + return getReportErrorsFieldBuilder() + .addBuilder( + com.google.api.servicecontrol.v1.ReportResponse.ReportError.getDefaultInstance()); + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder + addReportErrorsBuilder(int index) { + return getReportErrorsFieldBuilder() + .addBuilder( + index, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.getDefaultInstance()); + } + /** + * + * + *
+     * Partial failures, one for each `Operation` in the request that failed
+     * processing. There are three possible combinations of the RPC status:
+     * 1. The combination of a successful RPC status and an empty `report_errors`
+     *    list indicates a complete success where all `Operations` in the
+     *    request are processed successfully.
+     * 2. The combination of a successful RPC status and a non-empty
+     *    `report_errors` list indicates a partial success where some
+     *    `Operations` in the request succeeded. Each
+     *    `Operation` that failed processing has a corresponding item
+     *    in this list.
+     * 3. A failed RPC status indicates a general non-deterministic failure.
+     *    When this happens, it's impossible to know which of the
+     *    'Operations' in the request succeeded or failed.
+     * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + public java.util.List + getReportErrorsBuilderList() { + return getReportErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.ReportResponse.ReportError, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder, + com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder> + getReportErrorsFieldBuilder() { + if (reportErrorsBuilder_ == null) { + reportErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.servicecontrol.v1.ReportResponse.ReportError, + com.google.api.servicecontrol.v1.ReportResponse.ReportError.Builder, + com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder>( + reportErrors_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + reportErrors_ = null; + } + return reportErrorsBuilder_; + } + + private java.lang.Object serviceConfigId_ = ""; + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 2; + * + * @return The serviceConfigId. + */ + public java.lang.String getServiceConfigId() { + java.lang.Object ref = serviceConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 2; + * + * @return The bytes for serviceConfigId. + */ + public com.google.protobuf.ByteString getServiceConfigIdBytes() { + java.lang.Object ref = serviceConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 2; + * + * @param value The serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearServiceConfigId() { + + serviceConfigId_ = getDefaultInstance().getServiceConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The actual config id used to process the request.
+     * 
+ * + * string service_config_id = 2; + * + * @param value The bytes for serviceConfigId to set. + * @return This builder for chaining. + */ + public Builder setServiceConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceConfigId_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceRolloutId_ = ""; + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 4; + * + * @return The serviceRolloutId. + */ + public java.lang.String getServiceRolloutId() { + java.lang.Object ref = serviceRolloutId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceRolloutId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 4; + * + * @return The bytes for serviceRolloutId. + */ + public com.google.protobuf.ByteString getServiceRolloutIdBytes() { + java.lang.Object ref = serviceRolloutId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRolloutId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 4; + * + * @param value The serviceRolloutId to set. + * @return This builder for chaining. + */ + public Builder setServiceRolloutId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceRolloutId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearServiceRolloutId() { + + serviceRolloutId_ = getDefaultInstance().getServiceRolloutId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current service rollout id used to process the request.
+     * 
+ * + * string service_rollout_id = 4; + * + * @param value The bytes for serviceRolloutId to set. + * @return This builder for chaining. + */ + public Builder setServiceRolloutIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceRolloutId_ = 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.api.servicecontrol.v1.ReportResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.ReportResponse) + private static final com.google.api.servicecontrol.v1.ReportResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.ReportResponse(); + } + + public static com.google.api.servicecontrol.v1.ReportResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportResponse(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.api.servicecontrol.v1.ReportResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponseOrBuilder.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponseOrBuilder.java new file mode 100644 index 00000000..0124372d --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ReportResponseOrBuilder.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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +public interface ReportResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.servicecontrol.v1.ReportResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + java.util.List getReportErrorsList(); + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + com.google.api.servicecontrol.v1.ReportResponse.ReportError getReportErrors(int index); + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + int getReportErrorsCount(); + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + java.util.List + getReportErrorsOrBuilderList(); + /** + * + * + *
+   * Partial failures, one for each `Operation` in the request that failed
+   * processing. There are three possible combinations of the RPC status:
+   * 1. The combination of a successful RPC status and an empty `report_errors`
+   *    list indicates a complete success where all `Operations` in the
+   *    request are processed successfully.
+   * 2. The combination of a successful RPC status and a non-empty
+   *    `report_errors` list indicates a partial success where some
+   *    `Operations` in the request succeeded. Each
+   *    `Operation` that failed processing has a corresponding item
+   *    in this list.
+   * 3. A failed RPC status indicates a general non-deterministic failure.
+   *    When this happens, it's impossible to know which of the
+   *    'Operations' in the request succeeded or failed.
+   * 
+ * + * repeated .google.api.servicecontrol.v1.ReportResponse.ReportError report_errors = 1; + * + */ + com.google.api.servicecontrol.v1.ReportResponse.ReportErrorOrBuilder getReportErrorsOrBuilder( + int index); + + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 2; + * + * @return The serviceConfigId. + */ + java.lang.String getServiceConfigId(); + /** + * + * + *
+   * The actual config id used to process the request.
+   * 
+ * + * string service_config_id = 2; + * + * @return The bytes for serviceConfigId. + */ + com.google.protobuf.ByteString getServiceConfigIdBytes(); + + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 4; + * + * @return The serviceRolloutId. + */ + java.lang.String getServiceRolloutId(); + /** + * + * + *
+   * The current service rollout id used to process the request.
+   * 
+ * + * string service_rollout_id = 4; + * + * @return The bytes for serviceRolloutId. + */ + com.google.protobuf.ByteString getServiceRolloutIdBytes(); +} diff --git a/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerProto.java b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerProto.java new file mode 100644 index 00000000..e459f881 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/java/com/google/api/servicecontrol/v1/ServiceControllerProto.java @@ -0,0 +1,210 @@ +/* + * 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/api/servicecontrol/v1/service_controller.proto + +package com.google.api.servicecontrol.v1; + +public final class ServiceControllerProto { + private ServiceControllerProto() {} + + 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_api_servicecontrol_v1_CheckRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_CheckRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_CheckResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_ReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_ReportResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/api/servicecontrol/v1/service_c" + + "ontroller.proto\022\034google.api.servicecontr" + + "ol.v1\032\034google/api/annotations.proto\032\027goo" + + "gle/api/client.proto\032.google/api/service" + + "control/v1/check_error.proto\032,google/api" + + "/servicecontrol/v1/operation.proto\032\037goog" + + "le/protobuf/timestamp.proto\032\027google/rpc/" + + "status.proto\"{\n\014CheckRequest\022\024\n\014service_" + + "name\030\001 \001(\t\022:\n\toperation\030\002 \001(\0132\'.google.a" + + "pi.servicecontrol.v1.Operation\022\031\n\021servic" + + "e_config_id\030\004 \001(\t\"\346\004\n\rCheckResponse\022\024\n\014o" + + "peration_id\030\001 \001(\t\022>\n\014check_errors\030\002 \003(\0132" + + "(.google.api.servicecontrol.v1.CheckErro" + + "r\022\031\n\021service_config_id\030\005 \001(\t\022\032\n\022service_" + + "rollout_id\030\013 \001(\t\022I\n\ncheck_info\030\006 \001(\01325.g" + + "oogle.api.servicecontrol.v1.CheckRespons" + + "e.CheckInfo\032v\n\tCheckInfo\022\030\n\020unused_argum" + + "ents\030\001 \003(\t\022O\n\rconsumer_info\030\002 \001(\01328.goog" + + "le.api.servicecontrol.v1.CheckResponse.C" + + "onsumerInfo\032\204\002\n\014ConsumerInfo\022\026\n\016project_" + + "number\030\001 \001(\003\022S\n\004type\030\002 \001(\0162E.google.api." + + "servicecontrol.v1.CheckResponse.Consumer" + + "Info.ConsumerType\022\027\n\017consumer_number\030\003 \001" + + "(\003\"n\n\014ConsumerType\022\035\n\031CONSUMER_TYPE_UNSP" + + "ECIFIED\020\000\022\013\n\007PROJECT\020\001\022\n\n\006FOLDER\020\002\022\020\n\014OR" + + "GANIZATION\020\003\022\024\n\020SERVICE_SPECIFIC\020\004\"}\n\rRe" + + "portRequest\022\024\n\014service_name\030\001 \001(\t\022;\n\nope" + + "rations\030\002 \003(\0132\'.google.api.servicecontro" + + "l.v1.Operation\022\031\n\021service_config_id\030\003 \001(" + + "\t\"\341\001\n\016ReportResponse\022O\n\rreport_errors\030\001 " + + "\003(\01328.google.api.servicecontrol.v1.Repor" + + "tResponse.ReportError\022\031\n\021service_config_" + + "id\030\002 \001(\t\022\032\n\022service_rollout_id\030\004 \001(\t\032G\n\013" + + "ReportError\022\024\n\014operation_id\030\001 \001(\t\022\"\n\006sta" + + "tus\030\002 \001(\0132\022.google.rpc.Status2\274\003\n\021Servic" + + "eController\022\216\001\n\005Check\022*.google.api.servi" + + "cecontrol.v1.CheckRequest\032+.google.api.s" + + "ervicecontrol.v1.CheckResponse\",\202\323\344\223\002&\"!" + + "/v1/services/{service_name}:check:\001*\022\222\001\n" + + "\006Report\022+.google.api.servicecontrol.v1.R" + + "eportRequest\032,.google.api.servicecontrol" + + ".v1.ReportResponse\"-\202\323\344\223\002\'\"\"/v1/services" + + "/{service_name}:report:\001*\032\200\001\312A\035serviceco" + + "ntrol.googleapis.com\322A]https://www.googl" + + "eapis.com/auth/cloud-platform,https://ww" + + "w.googleapis.com/auth/servicecontrolB\370\001\n" + + " com.google.api.servicecontrol.v1B\026Servi" + + "ceControllerProtoP\001ZJgoogle.golang.org/g" + + "enproto/googleapis/api/servicecontrol/v1" + + ";servicecontrol\370\001\001\242\002\004GASC\252\002\036Google.Cloud" + + ".ServiceControl.V1\312\002\036Google\\Cloud\\Servic" + + "eControl\\V1\352\002!Google::Cloud::ServiceCont" + + "rol::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.servicecontrol.v1.CheckErrorProto.getDescriptor(), + com.google.api.servicecontrol.v1.OperationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_api_servicecontrol_v1_CheckRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_servicecontrol_v1_CheckRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_CheckRequest_descriptor, + new java.lang.String[] { + "ServiceName", "Operation", "ServiceConfigId", + }); + internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_servicecontrol_v1_CheckResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor, + new java.lang.String[] { + "OperationId", "CheckErrors", "ServiceConfigId", "ServiceRolloutId", "CheckInfo", + }); + internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor = + internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_CheckResponse_CheckInfo_descriptor, + new java.lang.String[] { + "UnusedArguments", "ConsumerInfo", + }); + internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor = + internal_static_google_api_servicecontrol_v1_CheckResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_CheckResponse_ConsumerInfo_descriptor, + new java.lang.String[] { + "ProjectNumber", "Type", "ConsumerNumber", + }); + internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_servicecontrol_v1_ReportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_ReportRequest_descriptor, + new java.lang.String[] { + "ServiceName", "Operations", "ServiceConfigId", + }); + internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_api_servicecontrol_v1_ReportResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor, + new java.lang.String[] { + "ReportErrors", "ServiceConfigId", "ServiceRolloutId", + }); + internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor = + internal_static_google_api_servicecontrol_v1_ReportResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_servicecontrol_v1_ReportResponse_ReportError_descriptor, + new java.lang.String[] { + "OperationId", "Status", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.servicecontrol.v1.CheckErrorProto.getDescriptor(); + com.google.api.servicecontrol.v1.OperationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/check_error.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/check_error.proto new file mode 100644 index 00000000..4f63471a --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/check_error.proto @@ -0,0 +1,124 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "CheckErrorProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// Defines the errors to be returned in +// [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors]. +message CheckError { + // Error codes for Check responses. + enum Code { + // This is never used in `CheckResponse`. + ERROR_CODE_UNSPECIFIED = 0; + + // The consumer's project id, network container, or resource container was + // not found. Same as [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND]. + NOT_FOUND = 5; + + // The consumer doesn't have access to the specified resource. + // Same as [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + PERMISSION_DENIED = 7; + + // Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. + RESOURCE_EXHAUSTED = 8; + + // The consumer hasn't activated the service. + SERVICE_NOT_ACTIVATED = 104; + + // The consumer cannot access the service because billing is disabled. + BILLING_DISABLED = 107; + + // The consumer's project has been marked as deleted (soft deletion). + PROJECT_DELETED = 108; + + // The consumer's project number or id does not represent a valid project. + PROJECT_INVALID = 114; + + // The input consumer info does not represent a valid consumer folder or + // organization. + CONSUMER_INVALID = 125; + + // The IP address of the consumer is invalid for the specific consumer + // project. + IP_ADDRESS_BLOCKED = 109; + + // The referer address of the consumer request is invalid for the specific + // consumer project. + REFERER_BLOCKED = 110; + + // The client application of the consumer request is invalid for the + // specific consumer project. + CLIENT_APP_BLOCKED = 111; + + // The API targeted by this request is invalid for the specified consumer + // project. + API_TARGET_BLOCKED = 122; + + // The consumer's API key is invalid. + API_KEY_INVALID = 105; + + // The consumer's API Key has expired. + API_KEY_EXPIRED = 112; + + // The consumer's API Key was not found in config record. + API_KEY_NOT_FOUND = 113; + + // The credential in the request can not be verified. + INVALID_CREDENTIAL = 123; + + // The backend server for looking up project id/number is unavailable. + NAMESPACE_LOOKUP_UNAVAILABLE = 300; + + // The backend server for checking service status is unavailable. + SERVICE_STATUS_UNAVAILABLE = 301; + + // The backend server for checking billing status is unavailable. + BILLING_STATUS_UNAVAILABLE = 302; + + // Cloud Resource Manager backend server is unavailable. + CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE = 305; + } + + // The error code. + Code code = 1; + + // Subject to whom this error applies. See the specific code enum for more + // details on this field. For example: + // + // - "project:" + // - "folder:" + // - "organization:" + string subject = 4; + + // Free-form text providing details on the error cause of the error. + string detail = 2; + + // Contains public information about the check error. If available, + // `status.code` will be non zero and client can propagate it out as public + // error. + google.rpc.Status status = 3; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/distribution.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/distribution.proto new file mode 100644 index 00000000..946a2f97 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/distribution.proto @@ -0,0 +1,166 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/distribution.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "DistributionProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// Distribution represents a frequency distribution of double-valued sample +// points. It contains the size of the population of sample points plus +// additional optional information: +// +// - the arithmetic mean of the samples +// - the minimum and maximum of the samples +// - the sum-squared-deviation of the samples, used to compute variance +// - a histogram of the values of the sample points +message Distribution { + // Describing buckets with constant width. + message LinearBuckets { + // The number of finite buckets. With the underflow and overflow buckets, + // the total number of buckets is `num_finite_buckets` + 2. + // See comments on `bucket_options` for details. + int32 num_finite_buckets = 1; + + // The i'th linear bucket covers the interval + // [offset + (i-1) * width, offset + i * width) + // where i ranges from 1 to num_finite_buckets, inclusive. + // Must be strictly positive. + double width = 2; + + // The i'th linear bucket covers the interval + // [offset + (i-1) * width, offset + i * width) + // where i ranges from 1 to num_finite_buckets, inclusive. + double offset = 3; + } + + // Describing buckets with exponentially growing width. + message ExponentialBuckets { + // The number of finite buckets. With the underflow and overflow buckets, + // the total number of buckets is `num_finite_buckets` + 2. + // See comments on `bucket_options` for details. + int32 num_finite_buckets = 1; + + // The i'th exponential bucket covers the interval + // [scale * growth_factor^(i-1), scale * growth_factor^i) + // where i ranges from 1 to num_finite_buckets inclusive. + // Must be larger than 1.0. + double growth_factor = 2; + + // The i'th exponential bucket covers the interval + // [scale * growth_factor^(i-1), scale * growth_factor^i) + // where i ranges from 1 to num_finite_buckets inclusive. + // Must be > 0. + double scale = 3; + } + + // Describing buckets with arbitrary user-provided width. + message ExplicitBuckets { + // 'bound' is a list of strictly increasing boundaries between + // buckets. Note that a list of length N-1 defines N buckets because + // of fenceposting. See comments on `bucket_options` for details. + // + // The i'th finite bucket covers the interval + // [bound[i-1], bound[i]) + // where i ranges from 1 to bound_size() - 1. Note that there are no + // finite buckets at all if 'bound' only contains a single element; in + // that special case the single bound defines the boundary between the + // underflow and overflow buckets. + // + // bucket number lower bound upper bound + // i == 0 (underflow) -inf bound[i] + // 0 < i < bound_size() bound[i-1] bound[i] + // i == bound_size() (overflow) bound[i-1] +inf + repeated double bounds = 1; + } + + // The total number of samples in the distribution. Must be >= 0. + int64 count = 1; + + // The arithmetic mean of the samples in the distribution. If `count` is + // zero then this field must be zero. + double mean = 2; + + // The minimum of the population of values. Ignored if `count` is zero. + double minimum = 3; + + // The maximum of the population of values. Ignored if `count` is zero. + double maximum = 4; + + // The sum of squared deviations from the mean: + // Sum[i=1..count]((x_i - mean)^2) + // where each x_i is a sample values. If `count` is zero then this field + // must be zero, otherwise validation of the request fails. + double sum_of_squared_deviation = 5; + + // The number of samples in each histogram bucket. `bucket_counts` are + // optional. If present, they must sum to the `count` value. + // + // The buckets are defined below in `bucket_option`. There are N buckets. + // `bucket_counts[0]` is the number of samples in the underflow bucket. + // `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples + // in each of the finite buckets. And `bucket_counts[N] is the number + // of samples in the overflow bucket. See the comments of `bucket_option` + // below for more details. + // + // Any suffix of trailing zeros may be omitted. + repeated int64 bucket_counts = 6; + + // Defines the buckets in the histogram. `bucket_option` and `bucket_counts` + // must be both set, or both unset. + // + // Buckets are numbered in the range of [0, N], with a total of N+1 buckets. + // There must be at least two buckets (a single-bucket histogram gives + // no information that isn't already provided by `count`). + // + // The first bucket is the underflow bucket which has a lower bound + // of -inf. The last bucket is the overflow bucket which has an + // upper bound of +inf. All other buckets (if any) are called "finite" + // buckets because they have finite lower and upper bounds. As described + // below, there are three ways to define the finite buckets. + // + // (1) Buckets with constant width. + // (2) Buckets with exponentially growing widths. + // (3) Buckets with arbitrary user-provided widths. + // + // In all cases, the buckets cover the entire real number line (-inf, + // +inf). Bucket upper bounds are exclusive and lower bounds are + // inclusive. The upper bound of the underflow bucket is equal to the + // lower bound of the smallest finite bucket; the lower bound of the + // overflow bucket is equal to the upper bound of the largest finite + // bucket. + oneof bucket_option { + // Buckets with constant width. + LinearBuckets linear_buckets = 7; + + // Buckets with exponentially growing width. + ExponentialBuckets exponential_buckets = 8; + + // Buckets with arbitrary user-provided width. + ExplicitBuckets explicit_buckets = 9; + } + + // Example points. Must be in increasing order of `value` field. + repeated google.api.Distribution.Exemplar exemplars = 10; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/http_request.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/http_request.proto new file mode 100644 index 00000000..1587203e --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/http_request.proto @@ -0,0 +1,93 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "HttpRequestProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// A common proto for logging HTTP requests. Only contains semantics +// defined by the HTTP specification. Product-specific logging +// information MUST be defined in a separate message. +message HttpRequest { + // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + string request_method = 1; + + // The scheme (http, https), the host name, the path, and the query + // portion of the URL that was requested. + // Example: `"http://example.com/some/info?color=red"`. + string request_url = 2; + + // The size of the HTTP request message in bytes, including the request + // headers and the request body. + int64 request_size = 3; + + // The response code indicating the status of the response. + // Examples: 200, 404. + int32 status = 4; + + // The size of the HTTP response message sent back to the client, in bytes, + // including the response headers and the response body. + int64 response_size = 5; + + // The user agent sent by the client. Example: + // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + // CLR 1.0.3705)"`. + string user_agent = 6; + + // The IP address (IPv4 or IPv6) of the client that issued the HTTP + // request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + string remote_ip = 7; + + // The IP address (IPv4 or IPv6) of the origin server that the request was + // sent to. + string server_ip = 13; + + // The referer URL of the request, as defined in + // [HTTP/1.1 Header Field + // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + string referer = 8; + + // The request processing latency on the server, from the time the request was + // received until the response was sent. + google.protobuf.Duration latency = 14; + + // Whether or not a cache lookup was attempted. + bool cache_lookup = 11; + + // Whether or not an entity was served from cache + // (with or without validation). + bool cache_hit = 9; + + // Whether or not the response was validated with the origin server before + // being served from cache. This field is only meaningful if `cache_hit` is + // True. + bool cache_validated_with_origin_server = 10; + + // The number of HTTP response bytes inserted into cache. Set only when a + // cache fill was attempted. + int64 cache_fill_bytes = 12; + + // Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + string protocol = 15; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/log_entry.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/log_entry.proto new file mode 100644 index 00000000..4f20aef0 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/log_entry.proto @@ -0,0 +1,126 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/servicecontrol/v1/http_request.proto"; +import "google/logging/type/log_severity.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// An individual log entry. +message LogEntry { + // Required. The log to which this log entry belongs. Examples: `"syslog"`, + // `"book_log"`. + string name = 10; + + // The time the event described by the log entry occurred. If + // omitted, defaults to operation start time. + google.protobuf.Timestamp timestamp = 11; + + // The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 12; + + // Optional. Information about the HTTP request associated with this + // log entry, if applicable. + HttpRequest http_request = 14; + + // Optional. Resource name of the trace associated with the log entry, if any. + // If this field contains a relative resource name, you can assume the name is + // relative to `//tracing.googleapis.com`. Example: + // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + string trace = 15; + + // A unique ID for the log entry used for deduplication. If omitted, + // the implementation will generate one based on operation_id. + string insert_id = 4; + + // A set of user-defined (key, value) data that provides additional + // information about the log entry. + map labels = 13; + + // The log entry payload, which can be one of multiple types. + oneof payload { + // The log entry payload, represented as a protocol buffer that is + // expressed as a JSON object. The only accepted type currently is + // [AuditLog][google.cloud.audit.AuditLog]. + google.protobuf.Any proto_payload = 2; + + // The log entry payload, represented as a Unicode string (UTF-8). + string text_payload = 3; + + // The log entry payload, represented as a structure that + // is expressed as a JSON object. + google.protobuf.Struct struct_payload = 6; + } + + // Optional. Information about an operation associated with the log entry, if + // applicable. + LogEntryOperation operation = 16; + + // Optional. Source code location information associated with the log entry, + // if any. + LogEntrySourceLocation source_location = 17; +} + +// Additional information about a potentially long-running operation with which +// a log entry is associated. +message LogEntryOperation { + // Optional. An arbitrary operation identifier. Log entries with the + // same identifier are assumed to be part of the same operation. + string id = 1; + + // Optional. An arbitrary producer identifier. The combination of + // `id` and `producer` must be globally unique. Examples for `producer`: + // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + string producer = 2; + + // Optional. Set this to True if this is the first log entry in the operation. + bool first = 3; + + // Optional. Set this to True if this is the last log entry in the operation. + bool last = 4; +} + +// Additional information about the source code location that produced the log +// entry. +message LogEntrySourceLocation { + // Optional. Source file name. Depending on the runtime environment, this + // might be a simple name or a fully-qualified name. + string file = 1; + + // Optional. Line within the source file. 1-based; 0 indicates no line number + // available. + int64 line = 2; + + // Optional. Human-readable name of the function or method being invoked, with + // optional context such as the class or package name. This information may be + // used in contexts such as the logs viewer, where a file and line number are + // less meaningful. The format can vary by language. For example: + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + // (Python). + string function = 3; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/metric_value.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/metric_value.proto new file mode 100644 index 00000000..c0e2a42d --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/metric_value.proto @@ -0,0 +1,81 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/servicecontrol/v1/distribution.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "MetricValueSetProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// Represents a single metric value. +message MetricValue { + // The labels describing the metric value. + // See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for + // the overriding relationship. + // Note that this map must not contain monitored resource labels. + map labels = 1; + + // The start of the time period over which this metric value's measurement + // applies. The time period has different semantics for different metric + // types (cumulative, delta, and gauge). See the metric definition + // documentation in the service configuration for details. If not specified, + // [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used. + google.protobuf.Timestamp start_time = 2; + + // The end of the time period over which this metric value's measurement + // applies. If not specified, + // [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used. + google.protobuf.Timestamp end_time = 3; + + // The value. The type of value used in the request must + // agree with the metric definition in the service configuration, otherwise + // the MetricValue is rejected. + oneof value { + // A boolean value. + bool bool_value = 4; + + // A signed 64-bit integer value. + int64 int64_value = 5; + + // A double precision floating point value. + double double_value = 6; + + // A text string value. + string string_value = 7; + + // A distribution value. + Distribution distribution_value = 8; + } +} + +// Represents a set of metric values in the same metric. +// Each metric value in the set should have a unique combination of start time, +// end time, and label values. +message MetricValueSet { + // The metric name defined in the service configuration. + string metric_name = 1; + + // The values in this metric. + repeated MetricValue metric_values = 2; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/operation.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/operation.proto new file mode 100644 index 00000000..7ce6cd43 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/operation.proto @@ -0,0 +1,123 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/servicecontrol/v1/log_entry.proto"; +import "google/api/servicecontrol/v1/metric_value.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// Represents information regarding an operation. +message Operation { + // Defines the importance of the data contained in the operation. + enum Importance { + // Allows data caching, batching, and aggregation. It provides + // higher performance with higher data loss risk. + LOW = 0; + + // Disables data aggregation to minimize data loss. It is for operations + // that contains significant monetary value or audit trail. This feature + // only applies to the client libraries. + HIGH = 1; + } + + // Identity of the operation. This must be unique within the scope of the + // service that generated the operation. If the service calls + // Check() and Report() on the same operation, the two calls should carry + // the same id. + // + // UUID version 4 is recommended, though not required. + // In scenarios where an operation is computed from existing information + // and an idempotent id is desirable for deduplication purpose, UUID version 5 + // is recommended. See RFC 4122 for details. + string operation_id = 1; + + // Fully qualified name of the operation. Reserved for future use. + string operation_name = 2; + + // Identity of the consumer who is using the service. + // This field should be filled in for the operations initiated by a + // consumer, but not for service-initiated operations that are + // not related to a specific consumer. + // + // - This can be in one of the following formats: + // - project:PROJECT_ID, + // - project`_`number:PROJECT_NUMBER, + // - projects/PROJECT_ID or PROJECT_NUMBER, + // - folders/FOLDER_NUMBER, + // - organizations/ORGANIZATION_NUMBER, + // - api`_`key:API_KEY. + string consumer_id = 3; + + // Required. Start time of the operation. + google.protobuf.Timestamp start_time = 4; + + // End time of the operation. + // Required when the operation is used in + // [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report], + // but optional when the operation is used in + // [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. + google.protobuf.Timestamp end_time = 5; + + // Labels describing the operation. Only the following labels are allowed: + // + // - Labels describing monitored resources as defined in + // the service configuration. + // - Default labels of metric values. When specified, labels defined in the + // metric value override these default. + // - The following labels defined by Google Cloud Platform: + // - `cloud.googleapis.com/location` describing the location where the + // operation happened, + // - `servicecontrol.googleapis.com/user_agent` describing the user agent + // of the API request, + // - `servicecontrol.googleapis.com/service_agent` describing the service + // used to handle the API request (e.g. ESP), + // - `servicecontrol.googleapis.com/platform` describing the platform + // where the API is served, such as App Engine, Compute Engine, or + // Kubernetes Engine. + map labels = 6; + + // Represents information about this operation. Each MetricValueSet + // corresponds to a metric defined in the service configuration. + // The data type used in the MetricValueSet must agree with + // the data type specified in the metric definition. + // + // Within a single operation, it is not allowed to have more than one + // MetricValue instances that have the same metric names and identical + // label value combinations. If a request has such duplicated MetricValue + // instances, the entire request is rejected with + // an invalid argument error. + repeated MetricValueSet metric_value_sets = 7; + + // Represents information to be logged. + repeated LogEntry log_entries = 8; + + // DO NOT USE. This is an experimental field. + Importance importance = 11; + + // Unimplemented. + repeated google.protobuf.Any extensions = 16; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/quota_controller.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/quota_controller.proto new file mode 100644 index 00000000..58b13ee6 --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/quota_controller.proto @@ -0,0 +1,245 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/annotations.proto"; +import "google/api/servicecontrol/v1/metric_value.proto"; +import "google/rpc/status.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "QuotaControllerProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// [Google Quota Control API](/service-control/overview) +// +// Allows clients to allocate and release quota against a [managed +// service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). +service QuotaController { + option (google.api.default_host) = "servicecontrol.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/servicecontrol"; + + // Attempts to allocate quota for the specified consumer. It should be called + // before the operation is executed. + // + // This method requires the `servicemanagement.services.quota` + // permission on the specified service. For more information, see + // [Cloud IAM](https://cloud.google.com/iam). + // + // **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + // `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + // reliability, the server may inject these errors to prohibit any hard + // dependency on the quota functionality. + rpc AllocateQuota(AllocateQuotaRequest) returns (AllocateQuotaResponse) { + option (google.api.http) = { + post: "/v1/services/{service_name}:allocateQuota" + body: "*" + }; + } +} + +// Request message for the AllocateQuota method. +message AllocateQuotaRequest { + // Name of the service as specified in the service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See [google.api.Service][google.api.Service] for the definition of a service name. + string service_name = 1; + + // Operation that describes the quota allocation. + QuotaOperation allocate_operation = 2; + + // Specifies which version of service configuration should be used to process + // the request. If unspecified or no matching version can be found, the latest + // one will be used. + string service_config_id = 4; +} + +// Represents information regarding a quota operation. +message QuotaOperation { + // Supported quota modes. + enum QuotaMode { + // Guard against implicit default. Must not be used. + UNSPECIFIED = 0; + + // For AllocateQuota request, allocates quota for the amount specified in + // the service configuration or specified using the quota metrics. If the + // amount is higher than the available quota, allocation error will be + // returned and no quota will be allocated. + // If multiple quotas are part of the request, and one fails, none of the + // quotas are allocated or released. + NORMAL = 1; + + // The operation allocates quota for the amount specified in the service + // configuration or specified using the quota metrics. If the amount is + // higher than the available quota, request does not fail but all available + // quota will be allocated. + // For rate quota, BEST_EFFORT will continue to deduct from other groups + // even if one does not have enough quota. For allocation, it will find the + // minimum available amount across all groups and deduct that amount from + // all the affected groups. + BEST_EFFORT = 2; + + // For AllocateQuota request, only checks if there is enough quota + // available and does not change the available quota. No lock is placed on + // the available quota either. + CHECK_ONLY = 3; + + // Unimplemented. When used in AllocateQuotaRequest, this returns the + // effective quota limit(s) in the response, and no quota check will be + // performed. Not supported for other requests, and even for + // AllocateQuotaRequest, this is currently supported only for allowlisted + // services. + QUERY_ONLY = 4; + + // The operation allocates quota for the amount specified in the service + // configuration or specified using the quota metrics. If the requested + // amount is higher than the available quota, request does not fail and + // remaining quota would become negative (going over the limit). + // Not supported for Rate Quota. + ADJUST_ONLY = 5; + } + + // Identity of the operation. This is expected to be unique within the scope + // of the service that generated the operation, and guarantees idempotency in + // case of retries. + // + // In order to ensure best performance and latency in the Quota backends, + // operation_ids are optimally associated with time, so that related + // operations can be accessed fast in storage. For this reason, the + // recommended token for services that intend to operate at a high QPS is + // Unix time in nanos + UUID + string operation_id = 1; + + // Fully qualified name of the API method for which this quota operation is + // requested. This name is used for matching quota rules or metric rules and + // billing status rules defined in service configuration. + // + // This field should not be set if any of the following is true: + // (1) the quota operation is performed on non-API resources. + // (2) quota_metrics is set because the caller is doing quota override. + // + // + // Example of an RPC method name: + // google.example.library.v1.LibraryService.CreateShelf + string method_name = 2; + + // Identity of the consumer for whom this quota operation is being performed. + // + // This can be in one of the following formats: + // project:, + // project_number:, + // api_key:. + string consumer_id = 3; + + // Labels describing the operation. + map labels = 4; + + // Represents information about this operation. Each MetricValueSet + // corresponds to a metric defined in the service configuration. + // The data type used in the MetricValueSet must agree with + // the data type specified in the metric definition. + // + // Within a single operation, it is not allowed to have more than one + // MetricValue instances that have the same metric names and identical + // label value combinations. If a request has such duplicated MetricValue + // instances, the entire request is rejected with + // an invalid argument error. + // + // This field is mutually exclusive with method_name. + repeated MetricValueSet quota_metrics = 5; + + // Quota mode for this operation. + QuotaMode quota_mode = 6; +} + +// Response message for the AllocateQuota method. +message AllocateQuotaResponse { + // The same operation_id value used in the AllocateQuotaRequest. Used for + // logging and diagnostics purposes. + string operation_id = 1; + + // Indicates the decision of the allocate. + repeated QuotaError allocate_errors = 2; + + // Quota metrics to indicate the result of allocation. Depending on the + // request, one or more of the following metrics will be included: + // + // 1. Per quota group or per quota metric incremental usage will be specified + // using the following delta metric : + // "serviceruntime.googleapis.com/api/consumer/quota_used_count" + // + // 2. The quota limit reached condition will be specified using the following + // boolean metric : + // "serviceruntime.googleapis.com/quota/exceeded" + repeated MetricValueSet quota_metrics = 3; + + // ID of the actual config used to process the request. + string service_config_id = 4; +} + +// Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation]. +message QuotaError { + // Error codes related to project config validations are deprecated since the + // quota controller methods do not perform these validations. Instead services + // have to call the Check method, without quota_properties field, to perform + // these validations before calling the quota controller methods. These + // methods check only for project deletion to be wipe out compliant. + enum Code { + // This is never used. + UNSPECIFIED = 0; + + // Quota allocation failed. + // Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. + RESOURCE_EXHAUSTED = 8; + + // Consumer cannot access the service because the service requires active + // billing. + BILLING_NOT_ACTIVE = 107; + + // Consumer's project has been marked as deleted (soft deletion). + PROJECT_DELETED = 108; + + // Specified API key is invalid. + API_KEY_INVALID = 105; + + // Specified API Key has expired. + API_KEY_EXPIRED = 112; + } + + // Error code. + Code code = 1; + + // Subject to whom this error applies. See the specific enum for more details + // on this field. For example, "clientip:" or + // "project:". + string subject = 2; + + // Free-form text that provides details on the cause of the error. + string description = 3; + + // Contains additional information about the quota error. + // If available, `status.code` will be non zero. + google.rpc.Status status = 4; +} diff --git a/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/service_controller.proto b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/service_controller.proto new file mode 100644 index 00000000..8580fc7a --- /dev/null +++ b/proto-google-cloud-service-control-v1/src/main/proto/google/api/servicecontrol/v1/service_controller.proto @@ -0,0 +1,256 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.servicecontrol.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/servicecontrol/v1/check_error.proto"; +import "google/api/servicecontrol/v1/operation.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceControl.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol"; +option java_multiple_files = true; +option java_outer_classname = "ServiceControllerProto"; +option java_package = "com.google.api.servicecontrol.v1"; +option objc_class_prefix = "GASC"; +option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; +option ruby_package = "Google::Cloud::ServiceControl::V1"; + +// [Google Service Control API](/service-control/overview) +// +// Lets clients check and report operations against a [managed +// service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). +service ServiceController { + option (google.api.default_host) = "servicecontrol.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/servicecontrol"; + + // Checks whether an operation on a service should be allowed to proceed + // based on the configuration of the service and related policies. It must be + // called before the operation is executed. + // + // If feasible, the client should cache the check results and reuse them for + // 60 seconds. In case of any server errors, the client should rely on the + // cached results for much longer time to avoid outage. + // WARNING: There is general 60s delay for the configuration and policy + // propagation, therefore callers MUST NOT depend on the `Check` method having + // the latest policy information. + // + // NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has + // the size limit (wire-format byte size) of 1MB. + // + // This method requires the `servicemanagement.services.check` permission + // on the specified service. For more information, see + // [Cloud IAM](https://cloud.google.com/iam). + rpc Check(CheckRequest) returns (CheckResponse) { + option (google.api.http) = { + post: "/v1/services/{service_name}:check" + body: "*" + }; + } + + // Reports operation results to Google Service Control, such as logs and + // metrics. It should be called after an operation is completed. + // + // If feasible, the client should aggregate reporting data for up to 5 + // seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + // reduce data loss during client crashes. Clients should carefully choose + // the aggregation time window to avoid data loss risk more than 0.01% + // for business and compliance reasons. + // + // NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has + // the size limit (wire-format byte size) of 1MB. + // + // This method requires the `servicemanagement.services.report` permission + // on the specified service. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc Report(ReportRequest) returns (ReportResponse) { + option (google.api.http) = { + post: "/v1/services/{service_name}:report" + body: "*" + }; + } +} + +// Request message for the Check method. +message CheckRequest { + // The service name as specified in its service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See + // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + // for the definition of a service name. + string service_name = 1; + + // The operation to be checked. + Operation operation = 2; + + // Specifies which version of service configuration should be used to process + // the request. + // + // If unspecified or no matching version can be found, the + // latest one will be used. + string service_config_id = 4; +} + +// Response message for the Check method. +message CheckResponse { + // Contains additional information about the check operation. + message CheckInfo { + // A list of fields and label keys that are ignored by the server. + // The client doesn't need to send them for following requests to improve + // performance and allow better aggregation. + repeated string unused_arguments = 1; + + // Consumer info of this check. + ConsumerInfo consumer_info = 2; + } + + // `ConsumerInfo` provides information about the consumer. + message ConsumerInfo { + // The type of the consumer as defined in + // [Google Resource Manager](https://cloud.google.com/resource-manager/). + enum ConsumerType { + // This is never used. + CONSUMER_TYPE_UNSPECIFIED = 0; + + // The consumer is a Google Cloud Project. + PROJECT = 1; + + // The consumer is a Google Cloud Folder. + FOLDER = 2; + + // The consumer is a Google Cloud Organization. + ORGANIZATION = 3; + + // Service-specific resource container which is defined by the service + // producer to offer their users the ability to manage service control + // functionalities at a finer level of granularity than the PROJECT. + SERVICE_SPECIFIC = 4; + } + + // The Google cloud project number, e.g. 1234567890. A value of 0 indicates + // no project number is found. + // + // NOTE: This field is deprecated after we support flexible consumer + // id. New code should not depend on this field anymore. + int64 project_number = 1; + + // The type of the consumer which should have been defined in + // [Google Resource Manager](https://cloud.google.com/resource-manager/). + ConsumerType type = 2; + + // The consumer identity number, can be Google cloud project number, folder + // number or organization number e.g. 1234567890. A value of 0 indicates no + // consumer number is found. + int64 consumer_number = 3; + } + + // The same operation_id value used in the + // [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging + // and diagnostics purposes. + string operation_id = 1; + + // Indicate the decision of the check. + // + // If no check errors are present, the service should process the operation. + // Otherwise the service should use the list of errors to determine the + // appropriate action. + repeated CheckError check_errors = 2; + + // The actual config id used to process the request. + string service_config_id = 5; + + // The current service rollout id used to process the request. + string service_rollout_id = 11; + + // Feedback data returned from the server during processing a Check request. + CheckInfo check_info = 6; +} + +// Request message for the Report method. +message ReportRequest { + // The service name as specified in its service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See + // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + // for the definition of a service name. + string service_name = 1; + + // Operations to be reported. + // + // Typically the service should report one operation per request. + // Putting multiple operations into a single request is allowed, but should + // be used only when multiple operations are natually available at the time + // of the report. + // + // There is no limit on the number of operations in the same ReportRequest, + // however the ReportRequest size should be no larger than 1MB. See + // [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors] + // for partial failure behavior. + repeated Operation operations = 2; + + // Specifies which version of service config should be used to process the + // request. + // + // If unspecified or no matching version can be found, the + // latest one will be used. + string service_config_id = 3; +} + +// Response message for the Report method. +message ReportResponse { + // Represents the processing error of one + // [Operation][google.api.servicecontrol.v1.Operation] in the request. + message ReportError { + // The + // [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id] + // value from the request. + string operation_id = 1; + + // Details of the error when processing the + // [Operation][google.api.servicecontrol.v1.Operation]. + google.rpc.Status status = 2; + } + + // Partial failures, one for each `Operation` in the request that failed + // processing. There are three possible combinations of the RPC status: + // + // 1. The combination of a successful RPC status and an empty `report_errors` + // list indicates a complete success where all `Operations` in the + // request are processed successfully. + // 2. The combination of a successful RPC status and a non-empty + // `report_errors` list indicates a partial success where some + // `Operations` in the request succeeded. Each + // `Operation` that failed processing has a corresponding item + // in this list. + // 3. A failed RPC status indicates a general non-deterministic failure. + // When this happens, it's impossible to know which of the + // 'Operations' in the request succeeded or failed. + repeated ReportError report_errors = 1; + + // The actual config id used to process the request. + string service_config_id = 2; + + // The current service rollout id used to process the request. + string service_rollout_id = 4; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..8de5d832 --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-service-control", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..c73a6f30 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + service-control-install-without-bom + jar + Google Service Control API Install Without Bom + https://github.com/googleapis/java-service-control + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-service-control + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..7a36f9d8 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-service-control-samples + 0.0.1-SNAPSHOT + pom + Google Service Control API Samples Parent + https://github.com/googleapis/java-service-control + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..e333d721 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + service-control-snapshot + jar + Google Service Control API Snapshot Samples + https://github.com/googleapis/java-service-control + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-service-control + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..671c3d6a --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + service-control-snippets + jar + Google Service Control API Snippets + https://github.com/googleapis/java-service-control + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-service-control + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..651fa5a2 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-service-control:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-service-control-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-service-control-v1:0.0.0:0.0.1-SNAPSHOT